Inconsistent Lighting

Started by
3 comments, last by Kincaid 15 years, 3 months ago
Hey again, I'll try and make this quick, but basically I'm getting unexpected lighting issues with my tessellated object in opengl. I have a small 3d scene consisting of an enclosed room, containing a sphere and a tessellated object. I also have a light orbiting my scene with ambient, diffuse and specular properties. For some reason the tessellated object doesn't seem to correctly reflect diffused light with respect to the direction of my light. I created a small sphere to check whether the problem was my light, however the sphere lights up as expected. I'm also using the same material properties for my tessellated object as my sphere, so I don't think it is a problem with my lighting code. I have checked many times that I am correctly specifying the normals for my tessellated object. The object is tessellated from some point cloud data, and at each glTessVertex and glTessCombine callback, I specify the normal as the value of the vertex (which as far as I know should give it spherical-like lighting, but it won't be very smooth). Here are some pictures of my problem: Free Image Hosting at www.ImageShack.us Free Image Hosting at www.ImageShack.us Free Image Hosting at www.ImageShack.us Notice how the whole thing lights up at a particular angle, then for the rest of the light's rotation it's pretty much completely unlit. If this isn't enough information I can include some code, but hopefully there could be a fundamental step I'm missing or common mistake I'm making. Thanks in advance for any help, areksu [Edited by - areksu on January 6, 2009 5:53:45 PM]
Advertisement
try lightpos.W = 1/0
Check your normals, the best thing would be to render them as lines.
Quote:Original post by lc_overlord
Check your normals, the best thing would be to render them as lines.


Thanks for the suggestion, but I have already tried it, and they appear exactly as one would expect: a large number of lines all pointing outwards to an imaginary spherical surface. :/

The opengl tessellator wouldn't be changing normals on it's own without telling me would it?
check also that they are normalized.
but my guess is that that isnt the problem though (would show different effect)

This topic is closed to new replies.

Advertisement