Skip to main content
gamedev.net
🔒 Locked

mesh normal

Started by derek7 Jun 5, 2006 at 1:54 AM 1 replies 750+ views
Original Post
derek7
derek7
a mesh consist of some submeshs. some submesh has reverse normal. if D3DCULL_NONE do not be set, you will not see it . if D3DCULL_NONE is set. all is ok. but if you set a direct light, and enable light. what happen?? you guess. you will see a darker mesh. but why ?
Evil Steve
Evil Steve
Because the normal is pointing away from the light, so the face isn't lit. Remember that lighting is done as L dot N (Light vector dot Normal vector), so if the normal is facing away from the light, you'll get a darker triangle.

The best way to fix it would be to fix the normals so they're not backwards. Also, not culling back-facing triangles could cause some performance issues and is best avoided for this purpose.
jollyjeffers
jollyjeffers
You might want to try googling/searching for "two sided lighting" - I know Nvidia put out some samples a few years back (it was one of the cool new things that vertex shaders made easier). That should allow you to have a single triangle that can be lit from both sides - although typically its used so you can have different textures/colours without doubling the geometry.

hth
Jack
<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ |

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.