Page 1 of 1

double sided illumination

Posted: Fri Feb 11, 2005 5:31 pm
by okki
hi,

strange titel eh? :)
i've got a spot light and a mesh with some different ordered normals (counter, anticounterclock)and no possibility to reverse that effect because the mesh is too complicated and too large.

thats no problem normally because i just use culling none but in conjuction with a spot light it becomes a quite nasty problem. some triangles are black some are illuminated as expected.

can i tell my material to illuminate both sides of the mesh? is that what binormals stands for? am i a complete idiot?

thanks once again

Posted: Fri Feb 11, 2005 6:33 pm
by sinbad
You have no choice but to correct those normals if you want fixed function lighting to work. Unless you use a vertex shader which calculates based on an inverted normal which is kind of silly. Why does the mesh complexity matter? You should be able to write a simple C++ tool which inverts the normals and the vertex windings if you can't do it in the modeller for some reason (but most modellers have this option afaik).

Posted: Fri Feb 11, 2005 7:46 pm
by okki
the problem is that the mesh consists of multiple surfaces. these surfaces are all well normalized but the sum of the resulting mesh (multiple surfaces) isnt. imagin a exploded box: all sides have correct normals but the upper shell got them on the wrong side...

[/img]

Posted: Fri Feb 11, 2005 10:36 pm
by sinbad
It's still wrong, sorry. You have to fix it - normals must point outwards. There is no way around this.