double sided illumination

Problems building or running the engine, queries about how to use features etc.
Post Reply
User avatar
okki
Halfling
Posts: 90
Joined: Mon Jan 03, 2005 3:14 pm
Contact:

double sided illumination

Post 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
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 67
Contact:

Post 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).
User avatar
okki
Halfling
Posts: 90
Joined: Mon Jan 03, 2005 3:14 pm
Contact:

Post 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]
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 67
Contact:

Post by sinbad »

It's still wrong, sorry. You have to fix it - normals must point outwards. There is no way around this.
Post Reply