Jump to content
  • Advertisement
Sign in to follow this  
areksu

OpenGL Inconsistent Lighting

This topic is 3543 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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]

Share this post


Link to post
Share on other sites
Advertisement
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?

Share this post


Link to post
Share on other sites
check also that they are normalized.
but my guess is that that isnt the problem though (would show different effect)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!