|
I'm using the 3D Text shader from the wiki. It solves the z-buffering problems that the standard 3d text shader had. But there are unwanted specular highlights in the transparent areas of the text that appear only when the camera is at certain angles to the 3D text objects. I'm using two directional lights in the scene. Adjusting their direction or settings or using other light types has no effect. Here is an example to illustrate:
...and at a slightly different camera angle:
Would like to know what's causing this. Could this be solved by a simple change in the shader (including here so its handy)? If not, is there a certain part of the shader to investigate as a starting point?
(comments are locked)
|
|
It's not specular, it's the background color. I assume the dark rectangle with the small triangle at the bottom also uses a transparent shader? The problem is the transparency sorting between these two objects - at certain viewing angles it will fail, rendering the text first, and the dark shape afterwards. However, since the 3D Text shader uses "ZWrite On", pixels that are actually behind the text are prevented from being rendered, because their z-test fails. There are some ways to get around this, but a perfect solution working in all cases is difficult, and depend on the geometric situation in your scene. Things you can try are:
Thanks for the reply, that's helpful as a start. Yes, the material behind the 3Dtext object is also transparent. And, pulling the text away from the backing polygons does mitigate the problem a little. Buy me some time to do this shader experimenting.
May 25 '11 at 07:38 PM
Barrett Fox
DUDE THANK YOU!!! i just put "Queue"="Transparent+1" and it worked fine, i know it will appears in front of transparent objects, but for my situation it's not a problem
Nov 29 '11 at 02:38 PM
leonardo_try
Note that since Unity 3.x (I think) you can access+modify the queue level directly from the material, so you no longer have to modify/write your own shader. So you could write a small script that simply increments the current material.renderQueue. http://unity3d.com/support/documentation/ScriptReference/Material-renderQueue.html
Dec 19 '11 at 12:46 PM
Wolfram
(comments are locked)
|
|
And, indeed, another answer to my own question is to render text to a texture off-camera and combine text and background into one shader. Have done that route before on another project. But I wanted to get a better understanding of these sorting issues.
(comments are locked)
|



Typo: "operaters" should be "operators".
Heh, thx Eagle-Eye-Eric. That would be a typo by a user. Must get spellchecking into the comment fields...