Why light not affect huge scale objects?

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
Auradrummer
Posts: 260
Joined: Thu Apr 17, 2008 1:38 pm
Location: Brasopolis - Brazil

Why light not affect huge scale objects?

Post by Auradrummer »

Hello Guys,

I'm making a scenary and I have a mesh for the land. I modeled the whole terrain in a 10 x 10 object and then scaled it in 3000. The light not affect it.
After this, I scaled the model and removed the Irrlicht scale. The lights worked fine.

Why?

Thanks
Professional Software Developer and Amateur Game Designer ;-)
haffax
Posts: 13
Joined: Wed Jul 29, 2009 1:40 pm

Post by haffax »

When scaling a node in Irrlicht, the normals are scaled too, which messes up lighting, which is what you experience here.
To prevent this from happening, set the material flag EMF_NORMALIZE_NORMALS to true for the material of the scaled mesh.
Lonesome Ducky
Competition winner
Posts: 1123
Joined: Sun Jun 10, 2007 11:14 pm

Post by Lonesome Ducky »

Try:

Code: Select all

node->setMaterialFlag(EMF_NORMALIZE_NORMALS)
Auradrummer
Posts: 260
Joined: Thu Apr 17, 2008 1:38 pm
Location: Brasopolis - Brazil

Post by Auradrummer »

Thanks guys! Direct hit!
Professional Software Developer and Amateur Game Designer ;-)
Post Reply