Bloom effect on model with background without bloom

In engine, if you enable post effects on a camera, then automatically all previous cameras that render to the same render target (framebuffer in this case) are considered a camera stack and are all switched to rendering to a texture and postprocessed at the end. And the result is copied into your original framebuffer).

You’re hoping that yourCamera-Background gets rendered to framebuffer, and only Camera-Bloom renders to texture and gets postprocessed. Missing bit there is that what happens next … the best we can do is to to copy that postprocessed render target into framebuffer, which would overwrite what Camera-Background rendered there. It would need some step to compose those somehow.

So a solution here is for you to set up the Camera-Bloom to render to a texture, and apply postprocessing on it (see example for this step here: https://github.com/playcanvas/engine/pull/3070 ). So this would render first (set up camera priority to 0 perhaps).

Then next (and final) camera would be Camera-World. It wold render Backgrond Layer first. Then it would use texture from your Camera-Bloom with full screen quad to add your bloomed effect composed on top. Perhaps just additive blend, but sky is the limit on the composition type. And next layer in this camera would we World.

Bu note that meshes in the World might overwrite some bloom effects? It’s likely you would want to swap last two steps. Render World first, and then compose the bloom texture over the top.

3 Likes