x


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.

more ▼

asked Mar 07 '11 at 01:37 PM

Xin gravatar image

Xin
304 17 21 27

(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

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.

more ▼

answered Mar 07 '11 at 03:16 PM

Jessy gravatar image

Jessy
15.6k 72 95 196

(comments are locked)
10|3000 characters needed characters left

If you're trying to do 3D GUI, see these answers.

more ▼

answered Apr 20 '11 at 10:14 PM

Waz gravatar image

Waz
6.4k 22 33 70

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x12

asked: Mar 07 '11 at 01:37 PM

Seen: 1947 times

Last Updated: Mar 07 '11 at 01:37 PM