- Home /
How to - Cut off GUI Texture with Objects with depth mask shader
Here is my setup
CameraBase renders the GUI texture.
CameraMatte(with GUIlayer off) renders on top of CameraBase and a obj with depthmask shader.
what I hoped is that the cameraMatte going to cut off the GUI texture using the depthmasked Obj.
However, problem already appear when turning guiLayer off on the cameraMatte, even though cameraMatte renders nothing and depth is set correctly , it would block the guitexlture which is rendered below.
Is this issue unavoidable or there are other ways to do this?
Thanks.
Answer by Jessy · Mar 07, 2011 at 03:16 PM
A screenshot/video would help, but from what I can gather, you're not understanding what a "depthmask" does. You have to render the depth first, and then you render other objects, whose pixels only get rendered if they are in front of the fragments in the depth buffer.
GUI Textures won't work, because they don't perform a ZTest. Instead, render a quad that renderers after the depthmask, behind the depthmask.
Your answer
Follow this Question
Related Questions
Game Works on Computer, but not on iPhone 0 Answers
Multiple Holes with Depth Shader 0 Answers
Can you specify what the DepthShader masks? 0 Answers
Playing a Depth Mask video track over another 2D video track? 1 Answer
Merge what 2 cameras render 0 Answers