scaling model makes it brighter or darker

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
rikyoh
Posts: 14
Joined: Fri Sep 08, 2006 1:02 pm

scaling model makes it brighter or darker

Post 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
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post 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.
rikyoh
Posts: 14
Joined: Fri Sep 08, 2006 1:02 pm

Post by rikyoh »

Thanks :lol: Works perfect now. I wonder why someone shouldn't set this flag?

Bye riky
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

It's expensive, so avoid it for unscaled and unlit meshes!
Post Reply