- Home /
Question by
LW · Aug 17, 2018 at 06:43 PM ·
renderingbufferdepth buffer
CommandBuffer Sample _CameraDepthNormalsTexture
Hi All,
I'm trying to draw the Depth normals after the Depth Normals texture is created CameraEvent.AfterDepthNormalsTexture
in a CommandBuffer
.
onAfterDepthNormalsTexture = new CommandBuffer();
onAfterDepthNormalsTexture.name = name + ".onAfterDepthNormalsTexture";
onAfterDepthNormalsTexture.Blit(BuiltinRenderTextureType.None,
BuiltinRenderTextureType.CameraTarget, afterDepthNormalsMaterial);
camera.AddCommandBuffer(CameraEvent.AfterDepthNormalsTexture, onAfterDepthNormalsTexture);
The event isn't getting called or I'm doing something batty. My shader just uses the automatic code that gets created when you create an image effect. If I use the shader with a Graphics.Blit()
in the MonoBehaviour::OnRenderImage()
method it correctly inverts the pixel color.
My camera's depth texture mode is set to:
camera.depthTextureMode = DepthTextureMode.DepthNormals;
Any help is appreciated.
Thanks!
Comment
Your answer

Follow this Question
Related Questions
Double Camera alternative in my case 0 Answers
How to clear the stencil buffer? 1 Answer
ViewModel Z depth buffer fix floating point 0 Answers
Problem with camera target texture and replacement shader 0 Answers
How and why: Command buffers? 0 Answers