Scale related lighting problem
by Prairie Games · in Torque Game Engine · 02/17/2005 (10:58 am) · 2 replies
Has anyone else run into this and know what's happening:
Static scale at 1.0:

Static scale at .1

When scaled the object no longer receives lighting, this can also cause black objects.
-Josh
Edit: problem with image links... one is a picture of a properly lit object the other is one that is fully lit, though shouldn't be... only difference is the scale.
Static scale at 1.0:

Static scale at .1

When scaled the object no longer receives lighting, this can also cause black objects.
-Josh
Edit: problem with image links... one is a picture of a properly lit object the other is one that is fully lit, though shouldn't be... only difference is the scale.
#2
If you are going to be scaling things in your world, you should use:
glEnable(GL_NORMALIZE)
Enabling this will tell opengl to resize all of your objects normals to unit length after they have been scaled.
Whatever object this is, you can add this call in the engine before it is rendered.
02/22/2005 (2:30 pm)
Yup, messed up normals is the problem.If you are going to be scaling things in your world, you should use:
glEnable(GL_NORMALIZE)
Enabling this will tell opengl to resize all of your objects normals to unit length after they have been scaled.
Whatever object this is, you can add this call in the engine before it is rendered.
Torque Owner Adios, Man!
I think it has to do with the fact that when you scale an object, you are also scaling the normals for each vertex, and those normals are not recalculated properly, which results in incorrect lighting.
I was trying to position the board in my 3D maze game by changing the scale, and I noticed that it immedialely got brighter as I scaled it down. If I simply moved the board further away from the camera, the "size" went down, but the lighting stayed the same.
The solution to your particular problem would be to scale down your object in whatever editor you were using, then re-export it.