c81378624f
Change-Id: Ic53dc7ecab1b44761fe06e6b528864d24cc5fa58 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/363940 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
30 lines
722 B
JSON
30 lines
722 B
JSON
{
|
|
"MaxCount": 4096,
|
|
"Drawable": {
|
|
"Type": "SkCircleDrawable",
|
|
"Radius": 2
|
|
},
|
|
"Code": [
|
|
"void effectSpawn(inout Effect effect) {",
|
|
" effect.rate = 90;",
|
|
"}",
|
|
"",
|
|
"float2 circle(inout float seed) {",
|
|
" float r = sqrt(rand(seed));",
|
|
" float a = rand(seed) * 6.283185;",
|
|
" return r * float2(sin(a), cos(a));",
|
|
"}",
|
|
"",
|
|
"void spawn(inout Particle p) {",
|
|
" p.lifetime = 30;",
|
|
" p.pos += circle(p.seed) * 40;",
|
|
"}",
|
|
"",
|
|
"void update(inout Particle p) {",
|
|
" p.vel += normalize(p.pos - effect.pos) * dt * 10;",
|
|
" p.scale = mix(0.25, 3, p.age);",
|
|
"}",
|
|
""
|
|
],
|
|
"Bindings": []
|
|
} |