Lighting crash course
by James Spellman · in · 01/23/2006 (1:58 pm) · 12 replies
I've been tasked with solving our lighting problem and having no experience with the subject, I'd thought I'd poll for suggestions.
What I have is a large single-level floorplan (think cubicle city) in an office building. I require the whole interior and its contents to be near their original texture intensity. I've tried using a single static, 2-sided ambient light, color 1,1,1, intensity .5, ambient 1, 150 radius, near linear and it gets me pretty close. The ceiling and floors are bright and there are shadows in the corners.
But when I add DTS objects or Characters, they're too dark on one side and too light on the other. I can't figure out how to raise the ambient and diminish the directional light. Is there something fundamental that I'm doing wrong here?
What I have is a large single-level floorplan (think cubicle city) in an office building. I require the whole interior and its contents to be near their original texture intensity. I've tried using a single static, 2-sided ambient light, color 1,1,1, intensity .5, ambient 1, 150 radius, near linear and it gets me pretty close. The ceiling and floors are bright and there are shadows in the corners.
But when I add DTS objects or Characters, they're too dark on one side and too light on the other. I can't figure out how to raise the ambient and diminish the directional light. Is there something fundamental that I'm doing wrong here?
#2
I should also mention that this is TGE 1.3 and LP 1.3.5.
01/23/2006 (4:44 pm)
When I reduce the direct light, by lowering Color or Intensity values, it does prevent oversaturation at the expense of darkening everything else in the scene. It appears to me that no matter what I do, Direct Light and Ambient Light will be directly linked unlike the Sun properties.I should also mention that this is TGE 1.3 and LP 1.3.5.
#3
The ambient value is tied to the direct lighting value, which allows TLK to perform the ambient lighting "for-free" (no added overhead). The color and intensity sliders choose the tone and relative brightness, and the ambient slider then splits the result into the ambient and direct components.
If the ambient slider is all the way up, the light only emits ambient lighting. If the slider is all the way down, the light only emits direct lighting. Anywhere in between is a mix of both lighting.
If you need the direct and ambient lighting to use different colors use two different lights, one direct and one ambient.
Don't forget that TLK ambient lighting is localized, and it won't illuminate everything with flat lighting (use the sun for this). This keeps the depth in your scene, and adds a radiosity effect - very cool. :)
Definitely check out the Modeler's Guide for details, in fact you might want to download TLK 1.4, if only for the new Modeler's Guide, which covers the lighting models and what to expect from them.
-John
01/24/2006 (5:15 am)
Hi guys,The ambient value is tied to the direct lighting value, which allows TLK to perform the ambient lighting "for-free" (no added overhead). The color and intensity sliders choose the tone and relative brightness, and the ambient slider then splits the result into the ambient and direct components.
If the ambient slider is all the way up, the light only emits ambient lighting. If the slider is all the way down, the light only emits direct lighting. Anywhere in between is a mix of both lighting.
If you need the direct and ambient lighting to use different colors use two different lights, one direct and one ambient.
Don't forget that TLK ambient lighting is localized, and it won't illuminate everything with flat lighting (use the sun for this). This keeps the depth in your scene, and adds a radiosity effect - very cool. :)
Definitely check out the Modeler's Guide for details, in fact you might want to download TLK 1.4, if only for the new Modeler's Guide, which covers the lighting models and what to expect from them.
-John
#4
It makes sense that ambient of 1 should only emit ambient, but that is not what I observe. I'm attempting to use the near linear model for ambient lighting, as you suggest in the guide, to set a baseline. It would be easier in my mind to set a flat ambient level and then add to it with a second source that includes a falloff. For instance, trying to evenly light a hallway is difficult when you don't know exaclty how much light to expect over any given distance.
Again, using an ambient plus a direct was my gameplan all along, but was abandoned when I saw that I was receiving direct light from my ambient source.
I wish I could use the sun, or at least the ambient component. The radiosity effect is important, not to mention cool. I need to trace into the code some more and see if I can add to my understanding. I think I have the 1.4 guide on my lap, but I'll have to double-check the version.
Just a quick side question. Is it me or does changing the sliders not affect scene relighting? It seems I always have to touch an edit control before the values are stored.
01/24/2006 (9:12 am)
Thanks for the info, John. It does help to understand the theoy behind the sliders.Quote:If the ambient slider is all the way up, the light only emits ambient lighting. If the slider is all the way down, the light only emits direct lighting. Anywhere in between is a mix of both lighting.
It makes sense that ambient of 1 should only emit ambient, but that is not what I observe. I'm attempting to use the near linear model for ambient lighting, as you suggest in the guide, to set a baseline. It would be easier in my mind to set a flat ambient level and then add to it with a second source that includes a falloff. For instance, trying to evenly light a hallway is difficult when you don't know exaclty how much light to expect over any given distance.
Quote:If you need the direct and ambient lighting to use different colors use two different lights, one direct and one ambient.
Again, using an ambient plus a direct was my gameplan all along, but was abandoned when I saw that I was receiving direct light from my ambient source.
Quote:Don't forget that TLK ambient lighting is localized, and it won't illuminate everything with flat lighting (use the sun for this). This keeps the depth in your scene, and adds a radiosity effect - very cool. :)
I wish I could use the sun, or at least the ambient component. The radiosity effect is important, not to mention cool. I need to trace into the code some more and see if I can add to my understanding. I think I have the 1.4 guide on my lap, but I'll have to double-check the version.
Just a quick side question. Is it me or does changing the sliders not affect scene relighting? It seems I always have to touch an edit control before the values are stored.
#5
If the lights don't seem to illuminate far enough the radius is too low, try increasing it to extend the lighting.
Also keep in mind that for a really good radiosity effect you'll probably need to layer your lighting, not just add a single light to the room.
The Light Editor works fantastic here, just double checked it. In fact if your scenes contain dts objects you'll see changes to things like color, intensity, radius and spotlight angle immediately as you make them (very cool :).
01/24/2006 (9:45 am)
If you need to have a flat ambient lighting level and then add in a falloff, then use the sun for the flat level (as mentioned above) and TLK ambient lights to add depth.If the lights don't seem to illuminate far enough the radius is too low, try increasing it to extend the lighting.
Also keep in mind that for a really good radiosity effect you'll probably need to layer your lighting, not just add a single light to the room.
The Light Editor works fantastic here, just double checked it. In fact if your scenes contain dts objects you'll see changes to things like color, intensity, radius and spotlight angle immediately as you make them (very cool :).
#6
Ok. I 'm going to refine my observations a bit. This I'd say the room lighting is exactly as you describe it. The ambient slider at full is strictly an ambient light. I'm setting my AreaAmbient light to color 1,1,1 intensity .5 ambient 1. Any more and the walls overexpose.
Now the problem is the TSStatics. First of all, they still react to it as a direct light. So I'm guessing the reason they do this is that even though it is an ambient light, the DTS Object flag forces them to observe it. (You can almost hear it click in my brain.) Now as a directional light on the DTS objects, it isn't bad.
Tthe other problem is the TSStatic ambient. The DTS objects pull their base ambient from the floor which is usually about a value of .45, even directly under the ambient light. I'd really like my characters to be brighter, so giving them a custom ambient value works as long as the DTS Object flags is off, but they have no shading. If it is on they overexpose. My props are probably fine with the DTS Object flag on, but I can't have it both ways unless this is what the light groups is about?
01/24/2006 (10:06 am)
This is me thinking out loud...Ok. I 'm going to refine my observations a bit. This I'd say the room lighting is exactly as you describe it. The ambient slider at full is strictly an ambient light. I'm setting my AreaAmbient light to color 1,1,1 intensity .5 ambient 1. Any more and the walls overexpose.
Now the problem is the TSStatics. First of all, they still react to it as a direct light. So I'm guessing the reason they do this is that even though it is an ambient light, the DTS Object flag forces them to observe it. (You can almost hear it click in my brain.) Now as a directional light on the DTS objects, it isn't bad.
Tthe other problem is the TSStatic ambient. The DTS objects pull their base ambient from the floor which is usually about a value of .45, even directly under the ambient light. I'd really like my characters to be brighter, so giving them a custom ambient value works as long as the DTS Object flags is off, but they have no shading. If it is on they overexpose. My props are probably fine with the DTS Object flag on, but I can't have it both ways unless this is what the light groups is about?
#7
You need to balance your lights a little differently to get the effect you're going for. Here's what I recommend; setup an ambient only light that does not affect dts objects (the dts objects will automatically receive lighting from the env, you can also override this if you like), setup a direct light that affects dts objects (to receive some shading).
If you are trying to do this and the direct lighting is too intense, then you can split the direct light into two direct lights; one that affects dts objects and one that doesn't, balancing the amount of the dts lighting between them.
Also make sure the color and intensity balance on your textures is good. If an object is too bright it is sometimes caused by overly bright textures on it (relative to its env).
01/24/2006 (12:30 pm)
Yes the light grouping will help here, it lets you assign lights directly to objects, so other objects are unaffected.You need to balance your lights a little differently to get the effect you're going for. Here's what I recommend; setup an ambient only light that does not affect dts objects (the dts objects will automatically receive lighting from the env, you can also override this if you like), setup a direct light that affects dts objects (to receive some shading).
If you are trying to do this and the direct lighting is too intense, then you can split the direct light into two direct lights; one that affects dts objects and one that doesn't, balancing the amount of the dts lighting between them.
Also make sure the color and intensity balance on your textures is good. If an object is too bright it is sometimes caused by overly bright textures on it (relative to its env).
#8
Is it true that if I create Direct Lights they will also bake into my interior? Is there something like an Ignore DIF flag for Direct lights?
Are there any guidelines as for color settings? Is Color 1,1,1 generally novice?
I've already deduced that dts texture shadows are groovy but highlights are dangerous.
Off to experiment...
01/24/2006 (12:42 pm)
Now I have to admit that how you group lights is a complete mystery to me. The documentation doesn't spell it out for me, so I'm going to have to try some things.Is it true that if I create Direct Lights they will also bake into my interior? Is there something like an Ignore DIF flag for Direct lights?
Are there any guidelines as for color settings? Is Color 1,1,1 generally novice?
I've already deduced that dts texture shadows are groovy but highlights are dangerous.
Off to experiment...
#9
Ok. So I determined that I have a light datablock with DTS Objects off, I can specifiy a light's object name that uses that datablock. Very cool. :)
I've not observed any noticable effect with two lights, although they are subtle and share the same datablock so that might have something to do with it. I've not tried using a SimGroup's object name that contains multiple lights, but I think that it is an option. Nor have I tried using multiple lights of different datablocks. I did try using the light datablock's name, but to be honest, I don't remember what happened.
The hardest part seems to be creating lights that will accentuate the DTS Objects without overexposing the floor. If I were to make a couple feature requests, the first would be for a light that didn't affect the DIF. The second would be for a more visual falloff indicator like the fxShapeReplicator.
In any case, I think I have a workable solution for my situation, although I'll need to modify my Actor (Player) class to have more control over the lighting.
Thanks for the help, John!
01/25/2006 (12:55 pm)
As a great philosopher once said, "Knowing is half the battle. G.I. Joe is there!"Ok. So I determined that I have a light datablock with DTS Objects off, I can specifiy a light's object name that uses that datablock. Very cool. :)
I've not observed any noticable effect with two lights, although they are subtle and share the same datablock so that might have something to do with it. I've not tried using a SimGroup's object name that contains multiple lights, but I think that it is an option. Nor have I tried using multiple lights of different datablocks. I did try using the light datablock's name, but to be honest, I don't remember what happened.
The hardest part seems to be creating lights that will accentuate the DTS Objects without overexposing the floor. If I were to make a couple feature requests, the first would be for a light that didn't affect the DIF. The second would be for a more visual falloff indicator like the fxShapeReplicator.
In any case, I think I have a workable solution for my situation, although I'll need to modify my Actor (Player) class to have more control over the lighting.
Thanks for the help, John!
#10
I realized that the multiple light groups wasn't working because I had a space after the semi-colon. So don't do that.
Also It appears that using a datablock's name in the light groups has no effect, not that it should as it obviously contains no transform information.
Animated lights don't appear to work as linked lights either, which is unfortunate as it is handy to see dramatically what a light touches.
01/25/2006 (3:28 pm)
More observations...I realized that the multiple light groups wasn't working because I had a space after the semi-colon. So don't do that.
Also It appears that using a datablock's name in the light groups has no effect, not that it should as it obviously contains no transform information.
Animated lights don't appear to work as linked lights either, which is unfortunate as it is handy to see dramatically what a light touches.
#11
You need to look into the color and intensity balance of your textures. If you keep seeing problems with some surfaces overexposing while others are still dark, it's because the textures vary far too much in intensity.
If you look at the textures that come with TLK you'll notice that those are the TGE textures, but with baked in bump effects and with a much more balanced intensity (the TGE texture range from overly bright to overly dark). That is how your textures should look (though the bump effect is optional).
To give a different perspective; when working with some 3D engines, as an example the Quake 1-3 engines, a lot of intensity needs to be added to textures because of the relatively poor lighting that the engines provide.
In contrast the Torque Lighting Kit is an extremely powerful lighting system that works more like the Unreal engine, and has tools similar to 3D Studio Max or Maya. This allows you to add and change the lighting in the game engine itself. But just like Max or Maya, the lighting is provided by the lighting system, so the textures should be as flat and balanced in intensity as possible (the exception being the optional bump info).
Let me know if this makes sense,
-John
01/25/2006 (11:55 pm)
Yes when linking lights you need to use the object's name or the name of the SimGroup it's contained in.You need to look into the color and intensity balance of your textures. If you keep seeing problems with some surfaces overexposing while others are still dark, it's because the textures vary far too much in intensity.
If you look at the textures that come with TLK you'll notice that those are the TGE textures, but with baked in bump effects and with a much more balanced intensity (the TGE texture range from overly bright to overly dark). That is how your textures should look (though the bump effect is optional).
To give a different perspective; when working with some 3D engines, as an example the Quake 1-3 engines, a lot of intensity needs to be added to textures because of the relatively poor lighting that the engines provide.
In contrast the Torque Lighting Kit is an extremely powerful lighting system that works more like the Unreal engine, and has tools similar to 3D Studio Max or Maya. This allows you to add and change the lighting in the game engine itself. But just like Max or Maya, the lighting is provided by the lighting system, so the textures should be as flat and balanced in intensity as possible (the exception being the optional bump info).
Let me know if this makes sense,
-John
#12
01/26/2006 (8:36 am)
Makes perfect sense. I'm not an artist, but I think I see what you're saying by looking at a Histogram of the concrete_bm.png in PhotoShop. The graph has a nice bell curve in the middle third of the color range. Now while most of my textures are more colorful than say concrete, I'd assume the 5% of colors in the top third are candidates for overexposure while the opposite could be said for the bottom third.
Torque 3D Owner Jesse Liles