Hello, I’ve just recently started learned how to use command buffers so I apologize if this sounds obvious, but I am using CommandBuffer.DrawMesh to draw a cube after the ImageEffect Camera Event, as I don’t want it affected by bloom. So far I’ve been able to successfully get the cube to render and it appears to not be affected by bloom, but the problem I am running into is the cube is always rendered on top, as if it is ignoring the depth texture. Is there something specific I have to do to set the depth texture of the command buffer before drawing the mesh? Below is the code I am using.
Thanks in advance,
~ Ceraph
// Get our stored command buffer if we have one, if not make a new one
if (_commandBuffer == null)
{
_commandBuffer = new CommandBuffer();
_commandBuffer.name = "Post Image Effects";
// set this command buffer to be executed just after image effects
// in the camera
_mainCam.AddCommandBuffer (CameraEvent.AfterImageEffects, _commandBuffer);
}
_commandBuffer.Clear();
_commandBuffer.DrawMesh (meshToRender.mesh, _transform.localToWorldMatrix, rendererToRender.material);