Objects get fully lit when at a certain height
by Stefan Lundmark · in Torque Game Engine Advanced · 02/09/2007 (11:02 am) · 3 replies
When objects reach a certain height, they get fully lit.
We are using GeoTerrain and our sun is set to solid dark (0,0,0). When we fly up higher then suddenly all our images and objects get very bright.
No changes to the engine, RC1.
We are using GeoTerrain and our sun is set to solid dark (0,0,0). When we fly up higher then suddenly all our images and objects get very bright.
No changes to the engine, RC1.
About the author
#2
I'll see about extending that ray or making it shorter to see what effects I get. It works until like 300 units up in the air.
Edit: Would it not be better to use the ambient/color from sky, instead of a hardcoded value? Just a thought.
Thanks John!
02/12/2007 (2:19 am)
The terrain is legacy, with modified square size (24). Perhaps that has an effect too.I'll see about extending that ray or making it shorter to see what effects I get. It works until like 300 units up in the air.
Edit: Would it not be better to use the ambient/color from sky, instead of a hardcoded value? Just a thought.
Thanks John!
#3
Thanks.
02/14/2007 (7:37 am)
John, increasing the rays length to 10000 obviously gets rid of the brightness well enough for most games. Are there any side effects that I am missing? Performance impact with a longer ray?Thanks.
Torque Owner John Kabus (BobTheCBuilder)
The method provides a default lighting value (0.5, 0.5, 0.5) if nothing is hit, you probably need to hand tune this value for your game.
However at that altitude you might not want the terrain shading the object - you could reduce the ray cast length so the terrain lighting is only used very close to it, or override getLightingAmbientColor in the flying vehicle class to always use a custom lighting amount.