- Home /
Universal Render Pipeline Post processing breaks transparent camera background?
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?
Answer by viesturz · Dec 06, 2020 at 03:13 PM
Hi I solved this by changing the secondary camera type to Overlay and adding it to overlay stack on the primary camera.
Answer by Aviryx · Aug 12, 2020 at 09:22 AM
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.
"Solid color" just means applying the same color to every pixel. If that "color" is (0, 0, 0, 0) you get a transparent background. I have the same problem as OP and like for them using (0, 0, 0, 0) works as expected as long as post-processing is disabled.
Your answer
Follow this Question
Related Questions
2020.3 URP Post-Process effects don't apply to terrain on build 0 Answers
URP Post-Processing not working properly with Terrain on Build 0 Answers
Universal Render Pipeline grey screen on android 0 Answers
Hybrid Renderer Visual Bug (FPS Drop?) 0 Answers
Have seperate Post Processing Volumes for different cameras? 0 Answers