Hi,
I am trying to do a controlled rendering by script of a URP camera that is set with a rendertexture in depth mode and it fails. This worked fine in previous unity versions.
Is there any known bug about this behavior ?
If i enable the opaque mode in the camera it renders the depth, but spams me about some rendertextures that have no declared both depth and color mode, while in fact i never create such textures, so seems like a huge bug of render camera function of URP pipeline.
Please if possible stop releasing new Unity versions before are tested and ready, it is really crazy trying to keep up with all those bugs
I post also a photo of the issue, every time i issue a UniversarRenderPipeline.RenderSingleCamera command, i get this spam of errors about some random numbered rendertextures that are not the camera assigned one.
To make the depth render i had to enable the “Opaque texture” on the camera, if i dont then depth is black and i dont get any errors (but does not work)
EDIT: I added two photos showing the random rendertextures and camera one
Note that the main issue is that the depth is not rendered when the camera is set only to depth mode (which is automatic i assume by rendertexture type), only when i force the Opaque works but spams the error, the same code and setup worked in previous Unity versions.
And this is the code where the camera and rendertetxure are setup for depth
if (m_ReflectionTextureDEPTH == null)
{
m_ReflectionTextureDEPTH = RenderTexture.GetTemporary(depthResolution, depthResolution, 24, RenderTextureFormat.Depth); //URP
}
m_ReflectionCamera.targetTexture = m_ReflectionTextureDEPTH;// m_ReflectionTexture;
m_ReflectionCamera.depthTextureMode = DepthTextureMode.Depth;
Note that all these worked fine in a previous version of 2021.2. Also i have enable the depth and opaque options in the URP pipeline settings (though not sure if this is related)
I have the same problem, did you find a solution?
Thanks