I have (almost) got the full screen, turbulent, rotating, particle fire effect I was shooting for, but what I really need is a way to distinguish one particle from one another in the shader. All particles have the same texture coordinates, and since by the time they reach the vertex shader the app appears to have baked all the quads into one aggregated model space already, there’s no way for me to do any operations unique to each particle.
Is there some way to bake a per particle vertex semantic (a random value from 0.0 → 1.0), so that each particle can be operated on distinctly (i.e. given a unique starting rotation and texture offset)in the vertex shader?
Right now the per-particle data that goes into the vertex shader is: position (float4), texture coordinate (float2), color (float4). I guess the color is the easiest to (ab)use, e.g. put something into the alpha channel, or so.
Note that texture coordinates can also be different for particles, if UV animation is on in the renderer.
Yup, using Perlin both in the parameter writing step as well as the full screen blit… awesome for fire/smoke isn’t it?
I’m doing the fill intensive pass to a tiny render target (128 x 64), and then using the blurred results as a mask to a fullscreen blit that uses perlin to create turbulence within the mask… it’s pretty good, but could be a lot better if I can get more randomization in the base particles (either a UV offset, or a rotation).
Aras - for continuity, I need a particular particle to maintain its “seed” value throughout its life (for example, if I wanted to have it start with a random rotation offset). Right now I can make all of the particles spin by applying a 2x2 rotation matrix with the _Time value, but unfortunately, they all spin in unison, so that’s not getting me what I need either.
I know that I could write an update function to copy out the particle array, rewrite a color channel, and copy it back, but is there a way to trap just newly created particles to assign them a random value into a color channel?