Archived

This topic is now archived and is closed to further replies.

DanJames

Small objects brighter

Recommended Posts

DanJames    122
When I render two identical objects at different sizes, the smaller one is a lot brighter. The only way I can get them to look the same is to change the light settings. (If I draw the object at half size, and scale the light intensity by half, it looks right.) Is there any reason for this, or am I missing something?

Share this post


Link to post
Share on other sites
TerranFury    142
Make sure you''re normalizing your surface normals. To do that, divide your axial components by the vector''s magnitude.

  
float reciprocalDistance = 1.0f / sqrtf(square(vector.x)+square(vector.y)+square(vector.z))

vector.x *= reciprocalDistance;
vector.y *= reciprocalDistance;
vector.z *= reciprocalDistance;

Share this post


Link to post
Share on other sites