I've used to draw sprites with CommandBuffer to a render texture and everything worked fine, but now I need to support SpriteMask and can't figure how to do that correctly. Below is an approximation on how I'm drawing the sprites (I've omitted the details on creation of ortho matrix and other stuff for clarity; it's working fine, so I guess the details are irrelevant to the case): Code (CSharp): commandBuffer.Clear(); commandBuffer.SetRenderTarget(renderTexture); commandBuffer.ClearRenderTarget(true, true, Color.clear); commandBuffer.SetProjectionMatrix(orthoMatrix); spriteRenderer.GetPropertyBlock(propertyBlock); commandBuffer.DrawMesh(spriteMesh, meshTRSMatrix, spriteMaterial, 0, -1, propertyBlock); Graphics.ExecuteCommandBuffer(commandBuffer); Now, to support the masks, I'm retrieving an additional render texture: depthTexture = RenderTexture.GetTemporary(width, height, 24, RenderTextureFormat.Depth) Setting it as depth render target: commandBuffer.SetRenderTarget(renderTexture, depthTexture) And drawing the mask before sprites: commandBuffer.DrawMesh(maskMesh, meshTRSMatrix, maskMaterial, 0, -1, propertyBlock) But the sprites just ignore the mask. I'm sure the mask and renderers are configured correctly, as the mask is rendering properly when the prefab is placed on scene. I've been experimenting for several days now, googling and trying to find something related in the Unity source code on GitHub, but it seems the rendering is on C++ side and not exposed to the open source repo. Would be really grateful for any hints or advice.