Hi there,
Im working on my own ScriptableRenderPass trying to blit the depth of the camera into the depth of a rendertexture. In the Execute function I have the following line:
cmd.Blit(depthTarget, renderTexture.depthBuffer)
It copies the depthBuffer of the camera onto the colorBuffer of the RenderTexture. I can see the depth being rendered on the color buffer, however the depthbuffer itsself stays empty.
Grateful for any ideas!
Regards
Markus
Instead of using blit, try replacing the blit method with the something like the following.
cmd.SetRenderTarget(colorTexId, renderloadaction, renderstoreaction, depthTexId, renderloadaction, renderstoreaction);
cmd.DrawMesh(fullscreenquad,identity, identity);
If unsure, use the FinalBlitPass/PostProcessPass as a reference.
2 Likes
Hey, thanks to you I got it working!
I got DrawMesh rendering the depth now, though I dont seem to get it rendering the Color at all. Is there any specific setup needed to use DrawMesh to render to the colorBuffer?
Thanks!
Markus
Not exactly, you might want to experiment with the material(for the draw mesh) and the render target properties to achieve what you need.
1 Like