skia2/resources/particles/warp.json
Brian Osman 559ffe4a23 Particles: Added particle flags for tracking state (one-time triggers, etc)
Also removed some older effects that weren't interesting, improved others,
cleaned up the unused functions in several, and renamed most of them to
reflect which feature they're demonstrating.

Change-Id: Ib44a00ec3d25e852a1d1661918137ba13d30c86b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/244119
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-09-25 15:58:09 +00:00

36 lines
767 B
JSON

{
"MaxCount": 4096,
"Drawable": {
"Type": "SkCircleDrawable",
"Radius": 2
},
"EffectCode": [
"void effectSpawn(inout Effect effect) {",
" effect.rate = 90;",
"}",
""
],
"Code": [
"float2 circle() {",
" float x;",
" float y;",
" do {",
" x = rand * 2 - 1;",
" y = rand * 2 - 1;",
" } while (x*x + y*y > 1);",
" return float2(x, y);",
"}",
"",
"void spawn(inout Particle p) {",
" p.lifetime = 30;",
" p.pos = circle() * 40;",
"}",
"",
"void update(inout Particle p) {",
" p.vel += normalize(p.pos) * dt * 10;",
" p.scale = mix(0.25, 3, p.age);",
"}",
""
],
"Bindings": []
}