skia2/resources/particles/spiral.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

30 lines
845 B
JSON

{
"MaxCount": 800,
"Drawable": {
"Type": "SkCircleDrawable",
"Radius": 2
},
"Code": [
"void effectSpawn(inout Effect effect) {",
" effect.lifetime = 4;",
" effect.rate = 120;",
" effect.spin = 6;",
"}",
"",
"void spawn(inout Particle p) {",
" p.lifetime = 2 + rand(p.seed);",
" p.vel = p.dir * mix(50, 60, rand(p.seed));",
"}",
"",
"void update(inout Particle p) {",
" p.scale = 0.5 + 1.5 * p.age;",
" float3 a0 = float3(0.098, 0.141, 0.784);",
" float3 a1 = float3(0.525, 0.886, 0.980);",
" float3 b0 = float3(0.376, 0.121, 0.705);",
" float3 b1 = float3(0.933, 0.227, 0.953);",
" p.color.rgb = mix(mix(a0, a1, p.age), mix(b0, b1, p.age), rand(p.seed));",
"}",
""
],
"Bindings": []
}