View Full Version : Depth offset shader (or something like that) ...?

03-18-2005, 08:56 AM
Maybe someone of you folks has an idea how to handle the following:

I am currently trying to transfer a cartoony character designed in 2D to 3D, where the eyes are like them from, say, Mr. Rossi. That is, most of the time you see the character from the side, but always both eyes are visible. My theoretical approach to do that in 3D was to place the two eyeballs actually inside the head and then apply some kind of depth offset fake to make them appear in front of the head in the render. In game engines such depth offsets are common properties one can give certain level parts to fight depth sorting errors (especially for engines without pixel based z-buffers like the original Playstation etc.). I looked for a shader which does this or something similar on Flay, but without success. The only plugin which comes a bit close to it is Celshader's Visible Ink, although then actually it's completely different since this one only gives the otherwise occluding part of the object a special kind of transparency. That is, defining a special object relation like "object A is 100% transparent only to object B, otherwise not" (or the same based on surfaces instead of objects), would be another possibility to do the trick, actually even better. (Opportunity to advertise Nodal here, Tess...? :) )

I guess it should be possible to write a custom shader which does this stuff, in LScript however it seems it isn't. Of course I could just render seperate passes to apply the effect in post, but it just would be nicer coming directly out of LW, for quickly checking the outcome with a simple F9 stroke and so on.

Any suggestions...?

03-18-2005, 10:47 AM
You could flip the polys of the head, and use an opposite light setup to light it separately -

03-18-2005, 11:36 AM
Sounds like a cool idea at first, but when flipping polys, parts of the head will look wrong (the mouth for example)... :(