Jump to content
  • Advertisement
Sign in to follow this  
BlueEyedFox

Lighting and Scaling issue

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

So, been reading the forums and you guys seem to know more than I do for sure and I can't find this problem listed anywhere: For reference I am using Direct3D. I have been using scaling for particular objects in what is essentially a 3D map. I have been using scaling on particular spheres that are meant to be clickable by the user and I would like them to appear the same size to the user no matter where he camera is. Right now it is simply a top down view so this was very simple. Scale down or up as the camera Zooms In/Out. The issue is that the lighting affects the spheres differently depending on their size. I am only using Directional lighting and this behavior does not make sense to me given how directional lighting is described. So I am assuming I am misunderstanding how lighting works in D3D which sucks for me. so A) how can I make an object appear the same size and relative location to the camera no matter where the camera is/looksat? B)How does Directional light really work? I thought that if I had two spheres, one twice the size as the other but otherwise identical(same polygons rotation,etc) would look that same under directional lighting. I would like to focus on A since this is for work, but if I can get a solid explanation on B that would terrific. I've gotten my current understanding from reading various tutorials and MSDN's description.

Share this post


Link to post
Share on other sites
Advertisement
So figured it out.

The issue is that lighting relies on unit length normals on the objects it lights.

Scaling changes the normals as well.

Fixed with one line:

device.renderstate.normalizenormals = true

Share this post


Link to post
Share on other sites
So figured it out.

The issue is that lighting relies on unit length normals on the objects it lights.

Scaling changes the normals as well.

Fixed with one line:

device.renderstate.normalizenormals = true

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!