- Home /
3DText is rendered in front of rendertexture. (SOLVED)
Hi!
I am using a orthographic camera to render a 3D gui on top of my game camera. In one of my Windows there is a rendertexture. There are also 3DTexts on the Screen (overlays for objects in the Scene) which are rendered in front of this rendertexture, despite the fact that these 3dTexts are located behind the texture (z-coordinate). I have added a screenshot for you to better understand my problem.
"WEB2", "STARBASE" and "AS002" should not be visible. This is only happening with Rendertextures. Any ideas?
Thanks in advance!
Basti
Answer by CHPedersen · Aug 06, 2013 at 08:33 AM
This occurs because the shader used for the default 3DText objects is a standard alpha blended shader which neither write to the Z-buffer nor undergo depth testing themselves.
Eric5h5 wrote a substitute shader that obeys depths and put it on the wiki some time ago, you can find it here:
I'm happy it helped. :) Please consider marking the answer correct, and welcome to Unity Answers!
Your answer
Follow this Question
Related Questions
My Render Texture is not rendering World Space Canvas UI objects 0 Answers
glReadPixels from a RenderTexture 3 Answers
Blend RenderTextures of different size 0 Answers
Fake crystal using render textures 1 Answer
Procedurally generate icon textures 1 Answer