{ "MaxCount": 4096, "Duration": 1, "Rate": 400, "Drawable": { "Type": "SkCircleDrawable", "Radius": 2 }, "Spawn": "// float rand; Every read returns a random float [0 .. 1)\nlayout(ctype=float) in uniform float dt;\nlayout(ctype=float) in uniform float effectAge;\n\nstruct Particle {\n float age;\n float lifetime;\n float2 pos;\n float2 dir;\n float scale;\n float2 vel;\n float spin;\n float4 color;\n float frame;\n};\n\nvoid main(inout Particle p) {\n p.lifetime = 1 + 2 * rand;\n p.pos.x = rand * 50;\n float a = radians(-10 + 20 * rand);\n float s = 50 + 10 * rand;\n p.vel.x = sin(a) * s;\n p.vel.y = -cos(a) * s;\n}\n", "Update": "// float rand; Every read returns a random float [0 .. 1)\nlayout(ctype=float) in uniform float dt;\nlayout(ctype=float) in uniform float effectAge;\n\nstruct Particle {\n float age;\n float lifetime;\n float2 pos;\n float2 dir;\n float scale;\n float2 vel;\n float spin;\n float4 color;\n float frame;\n};\n\nvoid main(inout Particle p) {\n p.vel.x += wind(p.age) * dt;\n p.scale = 3 - (1.5 * p.age);\n p.color = color(p.age);\n}\n", "Bindings": [ { "Type": "SkCurveBinding", "Name": "wind", "Curve": { "XValues": [], "Segments": [ { "Type": "Cubic", "Ranged": false, "Bidirectional": true, "A0": 180, "B0": -90, "C0": -120, "D0": -200 } ] } }, { "Type": "SkColorCurveBinding", "Name": "color", "Curve": { "XValues": [], "Segments": [ { "Type": "Linear", "Ranged": true, "A0": [ 1, 0, 0, 1 ], "D0": [ 1, 0.735294, 0, 1 ], "A1": [ 1, 0.588235, 0, 1 ], "D1": [ 0.941177, 1, 0, 1 ] } ] } } ] }