RenderTexture transparency artifacts

Hi!
I am making a RenderTexture with my camera set to Depth Only but i get some weird artifacts for the transparent zones…

2305582--155328--Capture d’écran 2015-09-22 à 04.21.42.png

Anyone know how can i get rid of these artifacts???
Sometimes these artifacts appear as a texture i have in my texture collection, like a lightmap or something…
Is that an Unit bug?

Best regards!

Can you clear the target texture to black first? Or perhaps to hot magenta so you can notice it… there are probably a few different ways to do this (full screen quad, a clear or fill command, replace the pixels directly, etc.)

Hi Kurt!
Thanks for taking time to reply.

Ok, i tried to clear the background with magenta, so the first renderTexture i take is my model with the magenta background.

Then i remove the background quad and take that renderTexture again, my model will still appear with the magenta background.

I also have this message when i take the render for a second time.

Tiled GPU perf. warning: RenderTexture color surface  (1024x1024) was not cleared/discarded,

I was able to find the solution!!!

For anyone struggling with this, Setting the Clear Flags to Color and setting the Color Alpha to 0 did the trick!
Thanks Kurt for your time!

Best regards.

1 Like

Unfortunately this fix no longer works in Unity 2019 with LWRP. :frowning: