skia2/resources/particles/skottie_particle.json
Jorge Betancourt 13fda2a4e7 implement animatable particle drawables
this change relands: https://skia-review.googlesource.com/c/skia/+/538042

It addresses the problem that skqp was excluding skottie source files but still loading particles.

Change-Id: I8849c5285bd2c41b76c2e5fd77b06eca0184719e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/542144
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
2022-05-26 19:03:31 +00:00

28 lines
748 B
JSON

{
"MaxCount": 32,
"Drawable": {
"Type": "SkSkottieDrawable",
"Path": "skottie",
"Name": "skottie_sample_2.json"
},
"Code": [
"void effectSpawn(inout Effect effect) {",
" effect.rate = 15;",
"}",
"",
"void spawn(inout Particle p) {",
" p.lifetime = 1.0 + rand(p.seed) * 2.0;",
" p.scale = 0.25;",
"}",
"",
"void update(inout Particle p) {",
" p.frame = p.age;",
" float a = radians(rand(p.seed) * 360);",
" float invAge = 1 - p.age;",
" p.vel = float2(cos(a), sin(a)) * mix(250, 550, rand(p.seed)) * invAge * invAge;",
" p.dir = normalize(p.vel);",
"}",
""
],
"Bindings": []
}