skia2/resources/particles/default.json
Brian Osman 125daa4d1a Refactor and further generalization of particle model
- Collapsed the per-particle data into a single struct, and
  use that to communicate with drawables, too. Let the drawables
  manage allocation of xforms, colors, etc. Helpful for non-atlas
  drawables, and just to keep the effect code simpler.
- Having all of the params in a single struct allows us to move
  the remaining animated behaviors into affectors (color/frame).
- Added SkColorCurve, which works like SkCurve for SkColor4f.
  Use that to create a color affector (rather than simple
  start/end colors in the effect params).
- Also put the stable random in SkParticleState. This is going
  to be necessary if/when we change affectors to operate on all
  particles (rather than one at a time). Still need to move t
  value into the particle struct (or eval it from the lifetime
  params on demand).

Change-Id: Icf39116acbfd5d6e8eb91e9affbd8898d106211d
Reviewed-on: https://skia-review.googlesource.com/c/193473
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-02-20 18:01:00 +00:00

96 lines
2.2 KiB
JSON

{
"MaxCount": 4096,
"Duration": 1,
"Rate": 1000,
"Life": {
"XValues": [],
"Segments": [
{
"Constant": true,
"Ranged": true,
"Bidirectional": false,
"A0": 1,
"B0": 0,
"C0": 0,
"D0": 0,
"A1": 3,
"B1": 0,
"C1": 0,
"D1": 0
}
]
},
"Drawable": {
"Type": "SkCircleDrawable",
"Radius": 1
},
"Emitter": {
"Type": "SkTextEmitter",
"Text": "SKIA",
"FontSize": 96
},
"Spawn": [
{
"Type": "SkLinearVelocityAffector",
"Force": false,
"Angle": {
"XValues": [],
"Segments": [
{
"Constant": true,
"Ranged": true,
"Bidirectional": false,
"A0": 240,
"B0": 0,
"C0": 0,
"D0": 0,
"A1": 300,
"B1": 0,
"C1": 0,
"D1": 0
}
]
},
"Strength": {
"XValues": [],
"Segments": [
{
"Constant": true,
"Ranged": true,
"Bidirectional": false,
"A0": 10,
"B0": 0,
"C0": 0,
"D0": 0,
"A1": 30,
"B1": 0,
"C1": 0,
"D1": 0
}
]
}
}
],
"Update": [
{
"Type": "SkColorAffector",
"Curve": {
"XValues": [],
"Segments": [
{
"Constant": false,
"Ranged": false,
"A0": [ 1, 0.196078, 0.0784314, 1 ],
"B0": [ 1, 0.392157, 0.0784314, 1 ],
"C0": [ 1, 0.588235, 0.0784314, 1 ],
"D0": [ 1, 0.784314, 0.0784314, 1 ],
"A1": [ 0, 0, 0, 0 ],
"B1": [ 0, 0, 0, 0 ],
"C1": [ 0, 0, 0, 0 ],
"D1": [ 0, 0, 0, 0 ]
}
]
}
}
]
}