2019-10-07 13:38:30 +00:00
|
|
|
{
|
|
|
|
"MaxCount": 200,
|
|
|
|
"Drawable": {
|
|
|
|
"Type": "SkCircleDrawable",
|
|
|
|
"Radius": 8
|
|
|
|
},
|
2021-02-01 19:47:30 +00:00
|
|
|
"Code": [
|
2019-10-07 13:38:30 +00:00
|
|
|
"void effectSpawn(inout Effect effect) {",
|
|
|
|
" effect.lifetime = 2;",
|
|
|
|
"}",
|
|
|
|
"",
|
|
|
|
"void effectUpdate(inout Effect effect) {",
|
|
|
|
" if (effect.age < 0.25 || effect.age > 0.75) { effect.rate = 0; }",
|
|
|
|
" else { effect.rate = 200; }",
|
|
|
|
"}",
|
2021-02-01 19:47:30 +00:00
|
|
|
"",
|
2019-10-07 13:38:30 +00:00
|
|
|
"void spawn(inout Particle p) {",
|
2020-02-10 18:45:22 +00:00
|
|
|
" int idx = int(rand(p.seed) * 4);",
|
2021-01-15 18:20:32 +00:00
|
|
|
" p.color.rgb = (idx == 0) ? float3(0.87, 0.24, 0.11)",
|
|
|
|
" : (idx == 1) ? float3(1.00, 0.90, 0.20)",
|
|
|
|
" : (idx == 2) ? float3(0.44, 0.73, 0.24)",
|
|
|
|
" : float3(0.38, 0.54, 0.95);",
|
2019-10-07 13:38:30 +00:00
|
|
|
"",
|
|
|
|
" p.lifetime = (1 - effect.age) * effect.lifetime;",
|
2020-02-10 18:45:22 +00:00
|
|
|
" p.scale = mix(0.6, 1, rand(p.seed));",
|
2019-10-07 13:38:30 +00:00
|
|
|
"}",
|
|
|
|
"",
|
|
|
|
"void update(inout Particle p) {",
|
|
|
|
" p.color.a = 1 - p.age;",
|
|
|
|
"",
|
2020-02-10 18:45:22 +00:00
|
|
|
" float a = radians(rand(p.seed) * 360);",
|
2019-10-07 13:38:30 +00:00
|
|
|
" float invAge = 1 - p.age;",
|
2020-02-10 18:45:22 +00:00
|
|
|
" p.vel = float2(cos(a), sin(a)) * mix(250, 550, rand(p.seed)) * invAge * invAge;",
|
2019-10-07 13:38:30 +00:00
|
|
|
"}",
|
|
|
|
""
|
|
|
|
],
|
|
|
|
"Bindings": []
|
|
|
|
}
|