Can you write to a custom buffer inside a shader for usage in another later on
I am moderately advanced in writing shaders but this is something I've never done before. Is it possible to create a custom buffer like the depth and stencil buffers where I can write data to it inside a shader?
For example, I could have a bunch of "fire particles" each writing additively into this special buffer. Later, I have an image effect shader which takes this buffer and accesses it as a texture, and use it as a mask for a distortion/displacement map that gets applied on the screen.
I know you can use a GrabPass to do this but it seems like it has some disadvantages.
Sounds like performances would take a hit if you have hundreds of these fire particles
Not very reliable or consistent since I believe the distortion would happen additively every time. So if you have 5 particles in front of each other a little bit, I believe it would distort very badly whereas I'd want it to be more uniform.
Thanks