I have a camera rendering to the render texture with PP off, background color set to black, no alpha (0,0,0,0) with culling mask to catch an object… it seems to work well - I got only that object in texture and image in preview looks as it should…
Now I add it to the canvas UI as a Raw Image and it starts to behave strange - my rendered image looks like it has about 50% opacity… I was expecting to show only object that camera is catching or maybe even that object with black background to investigate further, but well it looks like it’s the latter, but just with 50% transparent and I don’t even know why…
How can I just show result of camera with alpha as UI element? I know I can put it on main camera as stack (and then it works fine), but I’d like to do few things with it (eg. fade in/out).
It seems like your render texture might have some wrong settings? - color format r16 seems wrong
Otherwise maybe the shader you are using for rendering the object to the render texture has set a wrong alpha value
Well changing any other color format doesn’t change a thing, but yea - I should probably use here R8G8B8A8_UNORM.
Is that I need to create custom material to actually achieve that in URP?
I stumbled of videos like this one: https://www.youtube.com/watch?v=lN9mHYJtc5M (but it’s probably built-in) or that one: https://www.youtube.com/watch?v=vVQRk-LWSvM where you have clearly URP with transparent texture that uses default UI/Default material for it.
At last I figured it out. Partially.
So, basically the problem was asset called Better Fog and adding it to the URP Render Data asset causes such problems.
Just leaving info for future generations =p