95c26efc90
Change-Id: I2cb6255a553852a292427d6dc9ef8c5ed7f8286d Reviewed-on: https://skia-review.googlesource.com/c/skia/+/252926 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Michael Ludwig <michaelludwig@google.com> Reviewed-by: Mike Reed <reed@google.com>
36 lines
814 B
JSON
36 lines
814 B
JSON
{
|
|
"MaxCount": 4096,
|
|
"Drawable": {
|
|
"Type": "SkCircleDrawable",
|
|
"Radius": 2
|
|
},
|
|
"EffectCode": [
|
|
"void effectSpawn(inout Effect effect) {",
|
|
" effect.rate = 90;",
|
|
"}",
|
|
""
|
|
],
|
|
"Code": [
|
|
"float2 circle(inout uint seed) {",
|
|
" float x;",
|
|
" float y;",
|
|
" do {",
|
|
" x = rand(seed) * 2 - 1;",
|
|
" y = rand(seed) * 2 - 1;",
|
|
" } while (x*x + y*y > 1);",
|
|
" return float2(x, y);",
|
|
"}",
|
|
"",
|
|
"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": []
|
|
} |