Game Development Community

Advanced Lighting Inconsistent lights

by Martin Banks · in Torque 3D Professional · 10/15/2009 (7:04 pm) · 12 replies

I'm having a problem with every model that I have imported as a collada file. Advanced lighting will light the objects, characters, etc. inconsistently. I have 2 spotlights set up in an interior, along with two point lights. The lights are static. When I look at an object, it appears lit. I then rotate the object in place, and it becomes lit differently, as if I rotated the light around it instead.

See these pictures. The first is of a character facing forward where you can see the light on his pants and shirt etc. The next is of the same character rotated in the same place, now facing backward. The character is black.

Light on:
i620.photobucket.com/albums/tt287/softydevel/lightononeside.jpg
Light not on:
i620.photobucket.com/albums/tt287/softydevel/darkononeside.jpg
The shadows fall as expected, which in this case is behind the character. It is only the lights that are whacky.

I don't get this problem with the stock models, like Gideon. These models are all exported to collada from Maya.

Anyone else have this problem?

Thanks in advance.

#1
10/15/2009 (7:14 pm)
Your model's materials is probably using a blending mode other than "none" which would flag it as translucent, which will make it be lit using BL-like lighting, not AL.
#2
10/15/2009 (7:16 pm)
1 Have you checked your models normals?
2 What is your GPU?
3 Try enable/disable AdvancedLightMappingSupport in LevelInfo.
4 Does the same sort of thing happen in Basic Lighting?
5 Did you sort out smoothing groups correctly (I don't know Maya)

#3
10/15/2009 (7:41 pm)
It almost looks like a problem with the smoothing groups - Try exporting without smoothing at all and see if it still happens?
#4
10/16/2009 (12:30 pm)
@Manoel - the blending mode is none. there is nothing translucent.

@Steve - 1. Yes, and they are aimed out as expected. 2. nvidia 9600 3.No difference
4.same in basic
5. no smoothing groups

@Sven - there were no smoothing groups exported.

What seems to have worked was to do a combine pass on the character models.

Does this mean that the models need to be created as a continuous geometry, rather than separate pieces?


#5
10/21/2009 (2:55 am)
That looks like bad normals to me.

Do toggleNormalsViz in the console and take a screenshot of that.
#6
10/21/2009 (12:16 pm)
@Tom - The normals could be bad, but they could have only gotten that way on export since the face and vertex normals both are consistent in Maya. Anyhow, here are the screenshots.


maya collada file normals
i620.photobucket.com/albums/tt287/softydevel/normals_of_character.jpgtorque normal viz toggle
i620.photobucket.com/albums/tt287/softydevel/normalsbadlighting.jpgfront view
i620.photobucket.com/albums/tt287/softydevel/normalsbadlighting2b.jpg
I'm don't know what values or directions the colors correspond to, but depending on the character's orientation, they change. That seems wrong to me since the normals don't change relative to the character's orientation.


#7
10/21/2009 (12:31 pm)
The normals are stored in view-space. This is what accounts for the normals changing as you turn. The normals on that mesh do not look right at all, is there a normal map on the mesh?

Edit: Actually the normals on most of that geometry do not look correct.
#8
10/21/2009 (10:31 pm)
@Martain - Export your collada from Maya then reimport the Collada into Maya... are the normals still correct?
#9
10/22/2009 (11:17 am)

Quote:@Martin - Export your collada from Maya then reimport the Collada into Maya... are the normals still correct?

@Tom - that is what the picture from maya above demonstrates. As you can see, the normals in Maya look fine.
#10
10/22/2009 (9:24 pm)
@Martin - If you can post your Collada file somewhere maybe Chris can jump in and look at it. It sounds like Torque is then not reading the normals from a Maya collada file correctly.
#11
10/23/2009 (11:46 am)
@Tom - that is exactly what is happening. I have described it more as a bug here:

http://www.garagegames.com/community/forums/viewthread/104415



#12
10/26/2009 (9:08 pm)
Fix is here.