PDA

View Full Version : Basic Terrain Engine Lighting Problem


dirk102
08-15-2007, 05:49 AM
Hello there.
I'm working on a terrain rendering engine but my lighting isn't working right.

I've posted two screen shots, one with texture, one without, and one without any specular lighting.
My Light position is set to -50, -30, -50 which is around where the camera is positioned.
The light effects sort of look like they're coming from the correct position but they're all over the place.
Does this look like a problem with my calculation of normals or what?


http://img236.imageshack.us/img236/4121/img1jr1.jpg
http://img90.imageshack.us/img90/4324/img2iy9.jpg

Thanks!

\0

Reedbeta
08-15-2007, 09:22 AM
Looks like the normals aren't smoothed. You should set the normal at each vertex to the normalized sum of the normals of the faces it touches.