Jump to content
  • Advertisement
Sign in to follow this  
MARS_999

Problems with .3ds loader and polygons lighting

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

I have for the last week beat my head into the wall, with trying to figure out what I am doing wrong, or maybe I am not doing anything wrong... Some models do look correct from what I can see, and some models some of the polygons are not lit correctly. The polygons are dark. I am using Milkshape3D 1.8.2 if that matters... If I make a simple cube box and save that load it in the app and look at the results they look correct. I look at the TBN values and they look correct for that model. Now we are talking a simple mesh here. 20 vertices. With a more complex model like a car this is where things fall apart. Some of the polygons are dark and some look correct. I have looked over and over and can't find anything wrong with the code. Anyone have any ideas on where to start looking? Or what may be the problem. BTW I am using VC++ 2008 express and from what I can tell THERE IS NO debug build with it only release and run in debug mode.... Thanks BTW if someone has a model of a vehicle that they know works and they are willing to give away I would love to try and load it and see if it works.

Share this post


Link to post
Share on other sites
Advertisement
here you can find free car models, but they are in lightwave (lwo) format, if you can convert it they might be useful.

And as about the code, I can only suggest you to try to load the models with a different loader, or at least get a 3ds viewer and try to load them...
By the way, are the poligons black as they were not lit at all, or are they only darker than they should? A picture would be useful, I suppose.
What if you render the model using a flat color instead than the lighting equation? What if you put the light behind the polygons? Is the normal pointing outside the model? I don't know how you use the TBN (I only used it for normal mapping), are you using only the normal for the lighting? If not (i.e by transforming the light vector in texture space) what if you calculate everything in world space using only the normal?

[Edited by - cignox1 on January 28, 2008 3:03:54 AM]

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!