Jump to content
  • Advertisement
Sign in to follow this  

Ugly Lighting

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

Hello, I am currently experiencing some very ugly lighting using Direct3D 9. I am using a D3DTS_WORLD transform to both transform and SCALE a mesh. I capitalize the world scale because that is where my ugly lighting is showing up.

Here is the mesh as it is lit when it is scaled (notice the sort of jagged lighting on the character's back):

Here is the mesh not scaled:

The lighting is much more smooth when the world transform does not scale the mesh.

Here is what I'm doing to set up the world transform:

D3DMATRIX matScale, matTrans;
D3DXMatrixMultiply(&matTrans, &matScale, &m_matOrient);
m_pDevice->SetTransform(D3DTS_WORLD, &matTrans);

Any help as to what my options are to get the lighting to look more uniform when the mesh is scaled would be appreciated.

Peace Out.

Share this post

Link to post
Share on other sites
Your normals are getting scaled along with the model, causing them to no longer be normalized.

You'll need to tell DX to renormalize them (at a small performance cost) using:
device->SetRenderState(D3DRS_NORMALIZENORMALS, true);

Hope this helps.

[EDIT] Too slow. :(

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!