skia2/resources/particles/native.json
Brian Osman 4c63a1eada Particles + Interpreter: Bind particle's SkRandom to "rand"
Update sample effects to use that (and remove the need for the
hacky workaround "random -> frame" affector I was using).

Current perf on my workstation, 6k particles updating:
native: 0.67 ms
interp: 0.97 ms

Change-Id: I3a2168c210d7431ffffe2b87ab6adade69f1dce7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/214190
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-05-17 14:29:22 +00:00

158 lines
3.6 KiB
JSON

{
"MaxCount": 6000,
"Duration": 5,
"Rate": 2000,
"Life": {
"Input": {
"Source": "Age",
"TileMode": "Repeat",
"Left": 0,
"Right": 1
},
"XValues": [],
"Segments": [
{
"Type": "Constant",
"Ranged": true,
"Bidirectional": false,
"A0": 2,
"A1": 4
}
]
},
"Drawable": {
"Type": "SkCircleDrawable",
"Radius": 2
},
"Spawn": [
{
"Type": "SkLinearVelocityAffector",
"Enabled": true,
"Force": false,
"Frame": "World",
"Angle": {
"Input": {
"Source": "Age",
"TileMode": "Repeat",
"Left": 0,
"Right": 1
},
"XValues": [],
"Segments": [
{
"Type": "Constant",
"Ranged": true,
"Bidirectional": false,
"A0": 80,
"A1": 100
}
]
},
"Strength": {
"Input": {
"Source": "Age",
"TileMode": "Repeat",
"Left": 0,
"Right": 1
},
"XValues": [],
"Segments": [
{
"Type": "Constant",
"Ranged": true,
"Bidirectional": false,
"A0": 50,
"A1": 80
}
]
}
}
],
"Update": [
{
"Type": "SkColorAffector",
"Enabled": true,
"Curve": {
"Input": {
"Source": "Age",
"TileMode": "Repeat",
"Left": 0,
"Right": 1
},
"XValues": [],
"Segments": [
{
"Type": "Linear",
"Ranged": false,
"A0": [ 0, 1, 1, 1 ],
"D0": [ 1, 0, 1, 1 ]
}
]
}
},
{
"Type": "SkSizeAffector",
"Enabled": true,
"Curve": {
"Input": {
"Source": "Age",
"TileMode": "Repeat",
"Left": 0,
"Right": 1
},
"XValues": [],
"Segments": [
{
"Type": "Linear",
"Ranged": true,
"Bidirectional": false,
"A0": 0.5,
"D0": 2,
"A1": 1,
"D1": 0.25
}
]
}
},
{
"Type": "SkLinearVelocityAffector",
"Enabled": true,
"Force": true,
"Frame": "World",
"Angle": {
"Input": {
"Source": "Age",
"TileMode": "Repeat",
"Left": 0,
"Right": 1
},
"XValues": [],
"Segments": [
{
"Type": "Constant",
"Ranged": false,
"Bidirectional": false,
"A0": 0
}
]
},
"Strength": {
"Input": {
"Source": "Age",
"TileMode": "Repeat",
"Left": 0,
"Right": 1
},
"XValues": [],
"Segments": [
{
"Type": "Constant",
"Ranged": false,
"Bidirectional": false,
"A0": -20
}
]
}
}
]
}