we’ve bloom script enabled on our camera. Everything is working fine, except element entities are visible from all sides and any entities on top of the element component are getting transparent.
With Bloom (Transparency case):
The numbers image on the bottom is an Image element entity and the top coins are render entities.
@Leonidas, Thanks for you reply. The transparency issue and side visibility issue is resolved.
We’ve created a new layer called disablePostEffects and added it’s id to the camera disablePostEffectsLayer property. Now bloom is applied to elements in the UI layer. Even if we added disablePostEffects layer to those elements, the bloom effect is still there.
The side buttons are blooming. How can we stop this?
try setting app.scene.layers.logRenderActions to true at start up (using a script), use the debug engine … and see what it prints out … post it here for us to see please. Notice when the post effects gets triggered, and also the order of rendering.
@mvaligursky, @Leonidas we forgot to add the disablePostEffects layer to the camera. After adding them to the camera the bloom effect for UI elements is gone. But now the transparency issue and side visibility were not resolved.
Here’s the render log after adding disablePostEffects layer to the camera.
This how it works. All layers before postprocessing are rendered to a texture (render target), which has a depth buffer. All works well here, if object is behind another object, it’s not visible due to depth buffer.
Then post processing is applied - this basically renders image from the mentioned render target, into a framebuffer (this is what is displayed on the screen). But the depth data is not (cannot easily be) copied. And so whatever renders after postprocessing has no data in the depth buffer, so it renders over everything. Which usually works well for 2D UI, but not anything in 3D world if it needs to be behind other things.
Typically handling of this usually involves masking what is postprocessed, as it does not have a simple solution. See more here. There were more threads discussing this as well I think.