Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

My world matrix scales an item, and the normals are scaled as well. How can I prevent this from affecting my lighting?

0
Posted

My world matrix scales an item, and the normals are scaled as well. How can I prevent this from affecting my lighting?

0

This can be achieved in one of two ways: 1. Scale the length of your normals by the reciprocal of the scaling factor. For example, if an object is scaled to 5 times it’s size, then multiply the normals by 1/5, or 0.2. 2. Set the D3DRENDERSTATE_NORMALIZENORMALS to TRUE. This will cause normals to be normalized (set to a length of 1.0) after transformation into camera space. Note that this can be computationally expensive.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123