Odd waterblock behavior - lighting bug?
by Syllus · in Torque Game Engine Advanced · 05/08/2008 (10:48 pm) · 4 replies
I am getting some very odd behavior in waterblocks in tgea 1.0.7. Sometimes when entering a wateblock, or merely jumping over it too, entering the space at all, will cause the lighting on the player to go all crazy and he gets extremely bright as if I had just walked directly under a light. This effects all dts in the water... aiplayers and even items such as trees. It does not always happen, but when it does it is consistant throughout a play session. ie. I start it up once and it does not do it, it will act correctly for the entire game session... however once I shut it down, the next time I start the game up it may start getting all whacked out and if it does it will do it everytime i enter the water during the game session.
Here is a picture to illustrate what is happening.

Anyone have any ideas on this? I can't find anything in the log files that would hint to what is causing this.
Here is a picture to illustrate what is happening.

Anyone have any ideas on this? I can't find anything in the log files that would hint to what is causing this.
About the author
#2
05/09/2008 (6:23 am)
Thanks I will check that, although I am not sure what could be the "other problem" that would be throwing it off as it does this int he shipped stronghold demo that gets installed with the engine as well. And again it does not do it all of the time but rather it seems random. I will try it on other computers too just to be sure its not something on my hardware.
#3
05/09/2008 (6:44 am)
I didn't see it in stronghold demo. How hard is it to reproduce there?
#4
05/09/2008 (7:16 am)
Its not as apparent as the lighting change is not near as drastic but basically you just start the demo and run into the water... every now and then you will start it up and run into the water and the lighting on the orc will go bright... though not near as bright as the picture of mine above... but the behavior is the same... works sometimes and goes bright sometimes.
Associate Jeff Faust
Faust Logic, Inc.
The code of interest is in lightingSystem/synapseGaming/sgLightManager.cpp in the sgLightManager::getLightingAmbientColor() method. Near the end of this method you'll find where the default color is assigned.
lightPlugin->mLightingInfo.mHasLastColor = true; lightPlugin->mLightingInfo.mDefaultColor = ColorF(1.0, 1.0, 1.0); [i]// <-- DEFAULT COLOR[/i] lightPlugin->mLightingInfo.mLastColor = lightPlugin->mLightingInfo.mDefaultColor; *col = lightPlugin->mLightingInfo.mDefaultColor;To verify, try changing that to something obvious like a bright red and see what happens.It's probably just a symptom of another problem that's throwing off your lightmap sampling, but for a quick fix you can tune that default value to something less noticeable in your missions.