TGEA 1.7.0 Bug - Interior normal maps using incorrect sun vector
by Matt Fairfax · in Torque Game Engine Advanced · 06/20/2008 (5:18 pm) · 5 replies
Unfortunately I did not get this one into TGEA 1.7.1:
The Interior rendering code was never setting the "light" for its RenderInst so it was using the default light which has the direction of (0, 0, 1) (straight up).
For normal mapped surfaces this means that it would display the normal map correctly on the bottom of the Interior but not on the top.
The best way to fix this is to go into source/interior/interiorRender.cpp in Interior::renderZoneNode() and change:
to:
This will hand the the proper sun vector to any shaders that make use of it (and fallback to the default light if need be).
* I've seen a couple of other bugs that could be related to this but I'm not sure exactly where they are in the forums...
The Interior rendering code was never setting the "light" for its RenderInst so it was using the default light which has the direction of (0, 0, 1) (straight up).
For normal mapped surfaces this means that it would display the normal map correctly on the bottom of the Interior but not on the top.
The best way to fix this is to go into source/interior/interiorRender.cpp in Interior::renderZoneNode() and change:
RenderInst *ri = gRenderInstManager.allocInst(); *ri = *coreRi;
to:
RenderInst *ri = gRenderInstManager.allocInst();
*ri = *coreRi;
[b]LightManager* lm = gClientSceneGraph->getLightManager();
if (lm)
ri->light = lm->getSpecialLight(LightManager::slTranslatedSunlightType);[/b]This will hand the the proper sun vector to any shaders that make use of it (and fallback to the default light if need be).
* I've seen a couple of other bugs that could be related to this but I'm not sure exactly where they are in the forums...
About the author
I am a Game Designer at PopCap who has worked on PvZ Adventures, PvZ2, Peggle Blast, and Bejeweled Skies. I am an ex-GarageGames employee who helped ship TGE, TGEA, Torque 3D, and Constructor.
#3
07/09/2008 (5:49 am)
Without the materials.cs entry for the material the normals show up just fine; i have only the diffuse texture in the directory, so I guess torque is making something under the hood coming up with a normal map from the diffuse texture.
#4
08/22/2008 (8:56 am)
Any update with TGEA 1.7.1? i put the spec, normal and the diffuse and its all black because that :(
#5
02/14/2009 (8:20 am)
Nevermind.. sorry for bump...
Associate Fyodor -bank- Osokin
Dedicated Logic
Yes, this fix is related to this bug
edit: url