• Advertisement
Sign in to follow this  

lighting/normals problem

This topic is 4836 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

http://users.skynet.be/cyber-lord/Debug.zip Is the VC++ project with a compiled program (windows) too (just press the left mouse button in the window that appears and play around a bit, you'll see). The problem is: I'm using lighting, and I can see through my model (or the faces aren't drawn in the correct order). I don't really know what could be wrong as it is the first time I do lighting. (the lights code is in api_functions.cpp >> init function) [Edited by - the_cyberlord on October 24, 2004 2:54:11 PM]

Share this post


Link to post
Share on other sites
Advertisement
Most likely you are either drawing the polygons in the wrong order or your normals aren't calculated correclty and maybe you didn't upload your normals correclty? Not sure how you are rendering your model? VBO,VAR, CVA, immediate mode? A screenshot would be nice if possible.

Share this post


Link to post
Share on other sites
you could just download that zip file and run the program yourself, but here's a screenshot:
http://users.skynet.be/cyber-lord/man1_problem.JPG
You see, the piece under the feet (pad?) is drawn on the head of the man... could be normals calculation, because it's quite a complicated structure there (although it's totally low-poly)...

Share this post


Link to post
Share on other sites
Try to find what part of your code is more likely to cause the problem and post just that. It's just too much to ask people to download,build and debug your code.

Share this post


Link to post
Share on other sites
Does this only happen with lighting on? Try turning off lighting and see. Was this model ever drawn correctly in your app? If so what have you changed?

If you can see through the model, then possibly the winding order is wrong for some of your faces. You can try using glFrontFace to swap the winding order or glCullFace to turn culling on or off. See if those affect the missing faces.

Another possibility is that it is a problem with your depth buffer. Is it enabled? Do you have a pixel format that supports the depth buffer? Are you clearing it? Are the settings correct?

How are you drawing your geometry? Is it possible those faces aren't even being drawn?

There are probably many other possibilities. Start by turning off everything you don't absolutely need in the scene. This includes lighting. Maybe even try drawing the model in immediate mode. If this works then start adding stuff back in till it breaks.

If you can narrow down the problem a little, post here again and we'll probably be able to help more.

Share this post


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

  • Advertisement