TGEA and TGE Lighting -- Comparable?
by Jeff Faust · in Torque Game Engine Advanced · 04/22/2007 (11:32 am) · 13 replies
The basic question here...
Should I expect a light designed in TGE to look similar in TGEA when the light is using identical parameters?
The image below compares an identical light used in a nearly identical context in both TGE and TGEA. The end result is quite different:

To be fair, these are done with TGE 1.5 plus stock AFX 1.0 on the left and TGEA 1.0.1 plus alpha AFX on the right, however, I have a high confidence that AFX is not a factor here. The light itself is a stock sgLightObject, not an AFX light variation.
The Datablock:
In the Mission (light is about 1 unit above the ground):
Also, this is not an isolated lighting case, just the first one I've decided to focus in on for comparison.
Edit:
I forgot to mention that the TGEA case is using legacy terrain and DRL is off.
Should I expect a light designed in TGE to look similar in TGEA when the light is using identical parameters?
The image below compares an identical light used in a nearly identical context in both TGE and TGEA. The end result is quite different:

To be fair, these are done with TGE 1.5 plus stock AFX 1.0 on the left and TGEA 1.0.1 plus alpha AFX on the right, however, I have a high confidence that AFX is not a factor here. The light itself is a stock sgLightObject, not an AFX light variation.
The Datablock:
datablock sgLightObjectData(LightTest_DB)
{
radius = 2;
colour = "0.48 0.085 0.5";
CastsShadows = false;
LightingModelName = "SG - Near Linear (Lighting Pack)";
};In the Mission (light is about 1 unit above the ground):
new sgLightObject(LightTest) {
canSaveDynamicFields = "1";
position = "428 310 219.6";
rotation = "0 0 -1 87.6625";
scale = "1 1 1";
dataBlock = "LightTest_DB";
Enable = "1";
IconSize = "1";
locked = "false";
};Also, this is not an isolated lighting case, just the first one I've decided to focus in on for comparison.
Edit:
I forgot to mention that the TGEA case is using legacy terrain and DRL is off.
About the author
Jeff Faust creates special effects indie middleware and games for Faust Logic. --- Blog: Effectronica.com --- Twitter: @FaustLogic
#2
04/22/2007 (1:11 pm)
Here's another pic which may or may not be helpful. It compares the same light using stock TGE 1.5.1 and stock TGEA 1.0.1. In this case missions are identical. There are obviously more differences here than the light, (the tge version is much brighter) but hopefully it demonstrates the light is still different even in unmodified releases.
#3
04/22/2007 (1:15 pm)
@ Jerane -- The differences in detail certainly figure in to the overall result, but I think the light differences run deeper than that. The TGE light produces much crisper lighting on the orc body, while the TGEA light spreads out over the terrain as if its radius is much larger. I'll see if I can create an image w/o the detail texture to get a better comparison.
#4
04/22/2007 (1:50 pm)
One last picture... This one attempts to improve the comparison by neutralizing the textures and the detail map.
#5
garagegames.com/mg/forums/result.thread.php?qt=60700
04/22/2007 (4:46 pm)
Looks identical to what was mentioned in the thread below.garagegames.com/mg/forums/result.thread.php?qt=60700
#6
04/22/2007 (5:15 pm)
^ Sure does, and the images above also depict how the Legacy terrain's detail texture is quite powerful... and ugly, now, as mentioned in this thread: www.garagegames.com/mg/forums/result.thread.php?qt=60768
#7
04/23/2007 (7:19 am)
I suspect the thread Jacobin refers may be a different view of the same problem. That thread shows that some lights are getting cut off at the edges of nearby terrain pieces. This thread shows that some lights are showing a much larger radius of influence than their TGE equivalents. I think if these lights were rendering with a more appropriate radius, they would fall off to zero before reaching the terrain seams. Therefore the problem in the other thread might also be fixed.
#8
Replace this:
with this:
That's untested but I think that would halve the intensity of the detail color and make it a bit less drastic. Adjust to your needs.
04/23/2007 (8:18 am)
@C2: With regards to the detail texture, that's an easy thing to change. Without having actually tested this, but I'd guess that if you modify the TerrainP shader for your legacy terrain to look like this it would make it a bit less intense.Replace this:
OUT.col = lerp( diffuseColor * detailColor, fogColor, fogColor.a );
with this:
OUT.col = lerp( diffuseColor * (detailColor * 0.5), fogColor, fogColor.a );
That's untested but I think that would halve the intensity of the detail color and make it a bit less drastic. Adjust to your needs.
#9
TGE's dynamic interior and terrain lighting uses a single light texture and doesn't support varying lighting models. It most closely resembles the Advanced model, and it's recommended to use that model, so lighting on other objects like DTS objects is consistent with interior and terrain lighting.
TGE-A's dynamic lighting supports all lighting models, and is consistent between all objects.
You're seeing a drastic difference because TGE cannot accurately reproduce models other than Advanced (or rather TGE always uses an Advanced equivalent) on the terrain and interiors. The DTS objects probably look very close (there will be some variation), and the terrain and interiors should look similar using the Advance model.
04/23/2007 (11:04 am)
Hey guys,TGE's dynamic interior and terrain lighting uses a single light texture and doesn't support varying lighting models. It most closely resembles the Advanced model, and it's recommended to use that model, so lighting on other objects like DTS objects is consistent with interior and terrain lighting.
TGE-A's dynamic lighting supports all lighting models, and is consistent between all objects.
You're seeing a drastic difference because TGE cannot accurately reproduce models other than Advanced (or rather TGE always uses an Advanced equivalent) on the terrain and interiors. The DTS objects probably look very close (there will be some variation), and the terrain and interiors should look similar using the Advance model.
#10
Ack... no. Its a multiply (doing that will darken the texture as well as the detail). So to dull the details of detail texture you need to ADD to it (it sounds strange but remember details textures work like a reverse alpha map.. the values of 1.0 are no detail while the values of 0 are full detail). If you want an inexpensive (shader processing wise) way to dull the detail simply add a few points to it...
But speaking of shaders perhaps the mystery of the lighting differences in the orginal query lies in the shaders. Does 1.5 use shaders at all (I don't have 1.5 just TGEA)??
Ves
04/25/2007 (10:57 am)
Quote:
Replace this:
OUT.col = lerp( diffuseColor * detailColor, fogColor, fogColor.a );
with this:
OUT.col = lerp( diffuseColor * (detailColor * 0.5), fogColor, fogColor.a );
Ack... no. Its a multiply (doing that will darken the texture as well as the detail). So to dull the details of detail texture you need to ADD to it (it sounds strange but remember details textures work like a reverse alpha map.. the values of 1.0 are no detail while the values of 0 are full detail). If you want an inexpensive (shader processing wise) way to dull the detail simply add a few points to it...
detailColor += 0.1;
But speaking of shaders perhaps the mystery of the lighting differences in the orginal query lies in the shaders. Does 1.5 use shaders at all (I don't have 1.5 just TGEA)??
Ves
#11
If I wanted to learn about HLSL and how to program Shaders, can anyone recommend some good resources?
04/25/2007 (3:20 pm)
Slightly off topic but:If I wanted to learn about HLSL and how to program Shaders, can anyone recommend some good resources?
#12
04/26/2007 (7:28 pm)
Yeah was untested code, just brainstorming. With regards to 1.5, there is no shader support in TGE. You can hack it in, but there is no implementation like TGEA's.
#13
Which is an idea of mine to beable to use Both lighting effects and let the user submit the change on rendering and lighting in TGEA in "Block Areas use this light effect" Is this even possible ? or am I missing the whole aspect of TGEA's lighting as I am not the artist or level designer on my company but yet the programmer. Though yes I do know that one of the lighting does use shaders, but im just thinking that there is a way or should be a way to implement both lighting systems in a sence. oh well, that probably didnt make much sence as though im tired and its 4 am lol.
04/28/2007 (5:23 pm)
The question I have, is How much better is the lighting in TGEA in some aspects that TGE lighting is also more profciant in some ways. Its such as 2 different types of lighting, both have cons and pros. So how are we to say that TGEA lighting is any better when it lacks in some aspect from what TGE basic lighting offers...Which is an idea of mine to beable to use Both lighting effects and let the user submit the change on rendering and lighting in TGEA in "Block Areas use this light effect" Is this even possible ? or am I missing the whole aspect of TGEA's lighting as I am not the artist or level designer on my company but yet the programmer. Though yes I do know that one of the lighting does use shaders, but im just thinking that there is a way or should be a way to implement both lighting systems in a sence. oh well, that probably didnt make much sence as though im tired and its 4 am lol.
Torque Owner Jerane Alleyne
Default Studio Name