Hey. I noticed that when I enable “Post processing” in my scene’s main camera then the transparent background I have becomes opaque again. My project uses the Universal render pipeline.
Camera background set to (0, 0, 0, 0) (Fully transparent)
I’m using OBS to display the transparency effect. I have an image in the background and then the Unity game on top of it, like an overlay
Here’s what it looks like WITHOUT post processing enabled. It works as expected.
And here’s what it looks like when I enable Post processing. The background is no longer transparent.
Any ideas why it doesn’t work with Post processing enabled?
You are clearing the camera’s colour buffer to a solid colour
“At the start of its render loop, a Base Camera can clear its color buffer to a Skybox, clear its color buffer to a solid color, or use an uninitialized color buffer. You can choose this behavior using the Background Type property in the Base Camera Inspector.”
I think your issue is that whilst you might think you are setting it transparent with the RGBA, this is overridden when the camera’s color buffer is cleared to a solid colour (again, as stated in the docs regarding Background Type: Solid Color)
As such it appears you only have the following options:
a Base Camera can:
- clear its color buffer to a Skybox
- clear its color buffer to a solid color
- or use an uninitialized color buffer
"Note that the contents of the uninitialized color buffer vary by platform. On some platforms, the unitialized color buffer will contain data from the previous frame. On other platforms, the unitialized color buffer will contain unintialized memory. You should choose to use an unitialized color buffer only if your Camera draws to every pixel in the color buffer, and you do not wish to incur the cost of an unnecessary clear operation.
Hi I solved this by changing the secondary camera type to Overlay and adding it to overlay stack on the primary camera.
Any solutions to this on-going problem? There’s several posts about this and no one has had a solution, just dead threads. It seems Post-processing removes alpha from camera in URP.