I had some time this evening to try out an idea I always wantet to test.
It’s maybe not the perfect usecase, but the idea is intersting nonetheless, so I thought I’d share it.
Basically I’m sampling the GBuffer to spawn particles based on luminance and I color them also via GBuffer.
In addition, to break up the spawning, I sample a WorldAlignedTexture, which pans and is also used for the ‘rejection’ sampling.
The result looks like this:
I’ve done this quick and dirty, just for testing, here is the breakdown, in case it helps anyone :
- Set to GPU Emitter with very high spawnrate (in my case it’s about 10000, not optimal)
- Create bool ‘KillMe’, which we use later for rejection sampling
- Spawn particles in a cylinder around the area that you want to cover
- Place particles on nearest DepthBuffer location
- Sample the GBuffer for the color and the luminance rejection sampling - whenever the luminance falls underneath the Threshold parameter, I set KillMe to true
- Sample the WorldAligned texture and again, set KillMe to true if SampledColor.R is underneath a threshold (0.3 in my case)
- Kill all KillMe particles
In case your SceneColor doesn’t sample correctly, you can always try BaseColor instead, just make sure you’ve actually plugged something into BaseColor wherever you want to sample it, e.g. here my burning wood decal material:
This method could also be used to only spawn on a specific SceneColor color, rather than luminance based. E.g. only on Red.
That’s it, hope it sparks some ideas for other people