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
867 B
JSON
36 lines
867 B
JSON
{
|
|
"MaxCount": 2000,
|
|
"Drawable": {
|
|
"Type": "SkCircleDrawable",
|
|
"Radius": 4
|
|
},
|
|
"EffectCode": [
|
|
"uniform float2 mouse_pos;",
|
|
"",
|
|
"void effectSpawn(inout Effect effect) {",
|
|
" effect.rate = 500;",
|
|
"}",
|
|
"",
|
|
"void effectUpdate(inout Effect effect) {",
|
|
" effect.pos = mouse_pos;",
|
|
"}",
|
|
""
|
|
],
|
|
"Code": [
|
|
"void spawn(inout Particle p) {",
|
|
" p.lifetime = 2 + rand(p.seed);",
|
|
" p.vel.y = (20 * rand(p.seed)) - 10;",
|
|
"}",
|
|
"",
|
|
"void update(inout Particle p) {",
|
|
" p.color.r = p.age;",
|
|
" p.color.g = 1 - p.age;",
|
|
" float s1 = 0.5 + (1.5 * p.age);",
|
|
" float s2 = 1.0 + (-0.75 * p.age);",
|
|
" p.scale = (s1 + (s2 - s1) * rand(p.seed)) * 0.5;",
|
|
" p.vel.y += 20.0 * dt;",
|
|
"}",
|
|
""
|
|
],
|
|
"Bindings": []
|
|
} |