How to get a mesh rendered with CommandBuffer.DrawMesh to use depth texture

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);

From my intuition Image Effects are applied as a post-process effect, meaning that all passes of the rendering pipeline have already been executed and it’s possible that the depth buffer is not re-evaluated when you draw your mesh at that stage.

Not sure you can actually draw something without being affected by post-process effects while being rendered correctly into the scene; I think that the AfterImageEffects is meant mostly for UI.