x


Rendering a camera in front of a gui element

I am looking to have a camera with a "Depth Only" clear flag render on top of a gui element. It seems that by default gui.depth and camera.depth are unrelated and that gui elements always render over camera viewports. Has anyone managed to do this?

more ▼

asked Oct 14 '10 at 06:58 PM

Ryan Batten gravatar image

Ryan Batten
78 3 3 6

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

2 answers: sort voted first

OnGUI code always renders on top of everything. If you need to layer GUI elements under 3D objects you can use GUIText/GUITexture.

more ▼

answered Oct 14 '10 at 07:11 PM

Eric5h5 gravatar image

Eric5h5
80.1k 41 132 519

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

from http://forum.unity3d.com/threads/38372-GameObjects-in-front-of-GUI

"Not directly. You could have a separate camera in your scene, place your gameobjects relative to the second camera, render the camera to a render texture, then use that render texture as the source of a GUI.DrawTexture, then you could achieve it."

more ▼

answered Feb 23 '11 at 06:24 PM

roberto_sc gravatar image

roberto_sc
198 9 11 16

(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:

x3673
x2987
x150
x71

asked: Oct 14 '10 at 06:58 PM

Seen: 3895 times

Last Updated: Oct 14 '10 at 06:58 PM