blob: 0b5c33df9b5c39a4f0e678c8d3acd49970f86e28 [file] [log] [blame]
{
"MaxCount": 4096,
"Duration": 1,
"Rate": 30,
"Drawable": {
"Type": "SkCircleDrawable",
"Radius": 1
},
"Code": [
"// float rand; Every read returns a random float [0 .. 1)",
"layout(ctype=float) in uniform float dt;",
"layout(ctype=float) in uniform float effectAge;",
"",
"struct Particle {",
" float age;",
" float lifetime;",
" float2 pos;",
" float2 dir;",
" float scale;",
" float2 vel;",
" float spin;",
" float4 color;",
" float frame;",
"};",
"",
"void spawn(inout Particle p) {",
" p.lifetime = 10;",
" p.vel.y = 10 + rand * 20;",
" p.vel.x = -5 + 10 * rand;",
" p.pos.x = rand * 500;",
"}",
"",
"void update(inout Particle p) {",
" p.scale = size(p.age);",
"}",
""
],
"Bindings": [
{
"Type": "SkCurveBinding",
"Name": "size",
"Curve": {
"XValues": [],
"Segments": [
{
"Type": "Cubic",
"Ranged": true,
"Bidirectional": false,
"A0": 10,
"B0": 10,
"C0": 10,
"D0": 0,
"A1": 10,
"B1": 0,
"C1": 0,
"D1": 0
}
]
}
}
]
}