Hello all !
I’m having and issue with my render texture and post processing asset from Unity (and also with the camera).
So, I have 2 Cameras in my game, and one is only rendering my characters. And I want this camera to have post process effect on it. I set up like this:
My camera’s Clear flag is Solid color and is (0,0,0,0)
It renders into a Render texture
I apply this render texture to a raw image on my canvas
it works perfectly, with only my character showing until I had post process behavior and select things like Bloom, Anti-Alliasing and Color Grading. If I activate one of these, it’s like there is no more transparency in my solid color, it’s always there !
How can I have Solid Color transparency AND post process at the same time ?
I think i had kind of the same issue, here’s a link to my thread:
After building the app 100 times, i discovered it was the post processing that was messing with my rendered textures hope someone will find a way to fix all of this.
Hiya, i know its an old thread but there is a fix for this in the Post Processing Stack V1.
At the end of the PostFX Uber shader it simply returns 1 for alpha, we can sample the original alpha and return that instead. This is the original:
Just replace it with:
return half4(color, tex2D(_MainTex, uv).a);
However Anti Aliassing wont work, for FXAA it will clear the alpha again and for TAA it wont render at all. Perhaps you can simply upscale the rendertexture.
I believe the v2 stack has a fix for this, there are some defines regarding AA and alpha.
It seems there are some configs which enable to get the alpha with PostProcess Stack 2 but I cannot find them.
I have got a project in which alpha is used (to apply the render texture with Bloom on it to a RawImage/canvas rendered by a non post process camera) and everything works well.
I did another project with the same configuration for player and quality settings (I hope, I checked and did not see differences but I may have forgotten something) with the elements imported from the previous project. This projects fails to render the texture with alpha on my UI. Have you got any idea to fix that (Uniyt 2019.2 + Post Process Stack 2.1.7) ?
Can’t believe this actually worked, thank you!
It is also important to set anti-aliasing on Post Process Layer to FXAA and toggle the “Keep Alpha” button.
Hello, I have a similar problem but with v2.
On v2, and if the platform is iOS or Android, my render texture’s alpha lost when post-process layer is enabled. However, if the platform is PC, the alpha just works well.
Is there any setting we can adjust to make alpha work also in iOS and Android platforms?
ShowMeMore’s answer also contained important next-steps. Note: Once you create your own PostProcessData, if you do not want to edit GUIDs directly in text files, you can use “Debug View” in the Inspector to access the Shaders through the Unity GUI.