I am looking to create a custom bloom effect where the color of the glow emmited by an object would be different from it’s albedo color.
Here is how i would like to achieve this effect:
- I would add an emission texture/color property to the shaders used to render objects in my scene
- The shaders would render normally using their main textures, colors, etc.
- Then, those same shaders would also render the objects into a buffer (similar to a camera opaque texture) using the texture/color from the emission property instead
- After everything is rendered, the emission buffer would be passed through the bloom shader and added on top of the ‘base’ rendered image using a fullscreen render pass.
My question is: how can i render objects into a buffer, and would it be possible to do so using the same shaders used to render the objects normally, but using different properties (the emission properties).
The reason i want it to use the same shader for the base and the buffer is so that whenever, for example, a shader scrolls a texture by multiplying the uv position by time, i would like the scrolling of the main texture and the emission texture to be controlled by the same shader code. Separating the base and the emission into different shaders would be very annoying to work with. If this is not possible, i would at least like to know how i could apply separate materials to objects, and use those to create the emission buffer.