RenderStateBlock, how do I set a ColorMask?

I would like to set Stencil, Depth and ColorMask states during a custom pass render.

My old way involve using a replacement material, but we would like to do it different: using each object’s own material but somehow set Stencil, Depth and ColorMask states.

I have managed make RenderStateBlock work with custom Stencil & Depth, but ColorMask I have no clue.

Maybe there is another way? Like specify DepthOnly pass using existing material??

I forgot the good old SetRenderTarget :slight_smile: