skia2/resources/particles/mouse_trail.json
Brian Osman c81378624f Update all example particle data to new single-code-chunk format
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>
2021-02-02 18:07:53 +00:00

26 lines
636 B
JSON

{
"MaxCount": 2000,
"Drawable": {
"Type": "SkCircleDrawable",
"Radius": 4
},
"Code": [
"void effectSpawn(inout Effect effect) {",
" effect.rate = 800;",
"}",
"",
"void spawn(inout Particle p) {",
" p.lifetime = 2 + rand(p.seed);",
" float a = radians(rand(p.seed) * 360);",
" p.vel = float2(cos(a), sin(a)) * mix(5, 15, rand(p.seed));",
" p.scale = mix(0.25, 0.75, rand(p.seed));",
"}",
"",
"void update(inout Particle p) {",
" p.color.r = p.age;",
" p.color.g = 1 - p.age;",
"}",
""
],
"Bindings": []
}