Page 1 of 1

scaling model makes it brighter or darker

Posted: Wed Sep 20, 2006 9:20 pm
by rikyoh
Hi,

I have a scene with one light and a sphere with an texture. With the keys I can increase/decrease the scale (ISceneNode->setScale()). It works fine but when I let the sphere grow, it gets darker and when I let it shrink, it gets brighter. The effect is cleary noticable, if I scale from 0.5 to 1.5 for example the sphere changes its brightness from white to dark grey.

What could cause this?

Bye Riky

Posted: Wed Sep 20, 2006 9:32 pm
by hybrid
The normals are also scaled, this is ( :lol: ) normal behavior. But you can (and should for every dynamically lit and scaled mesh) set the material flag EMF_NORMALIZE_NORMALS to true and normals are automatically normalized again.

Posted: Wed Sep 20, 2006 10:20 pm
by rikyoh
Thanks :lol: Works perfect now. I wonder why someone shouldn't set this flag?

Bye riky

Posted: Wed Sep 20, 2006 10:23 pm
by hybrid
It's expensive, so avoid it for unscaled and unlit meshes!