Game Development Community

how to make it dark inside buildings

by Steve · in Torque 3D Professional · 10/02/2009 (10:56 am) · 7 replies

I think this might be a simple question, but I don't know how to do it. What I want is a way to make the inside of some of my TSStatic houses, inns, etc dark so I can place torches, point lights, etc and get them lit just the way I want. I am using a ScatterSky. When I set the sun and ambient lighting such that I like the way the outside world looks, all my buildings are very bright inside as well. If I lower ambient lighting, it lowers it everywhere, outside as well as inside my buildings, which is not what I want. I see that TSStatics have a checkbox marked "receive sunlight" but it had no effect that I could see. Can anyone please tell me how to do this?

#1
10/02/2009 (11:25 am)
That's an interesting issue. I don't think T3D can do what you want without some modifications. The best approach would be using a lightmap or baked vertex colors to store ambient occlusion, and have the material's shaders multiply that by the current ambient value. However, I'm not sure how lightmaps/vertcolors are handled by the lighting system, as on how they interact with ambient lighting.
#2
10/02/2009 (11:45 am)
this is a good question, i know that if i use zoning, it makes the inside of a building pitch black, but i would like to see a real light option maybe.. that would allow for realistic light ray casting.. i know alot of games fake this, but right now i have 2 options, ambient lighting of the entire mission, or using my zoning to black out the building and lighting it inside.. which doesnt work too bad..
#3
10/02/2009 (1:55 pm)
What I did is to create the interior lights in my 3D editor (Max), and export the lightmaps from there. If you don't assign any lightmaps to the exterior materials, they will still be lit by the sun/sky. Only issue is that you can't do any dynamic (flickering, moving) lights inside.
#4
10/02/2009 (2:06 pm)
@Dave: if you bake only ambient occlusion or only indirect lighting caused by ambient light in the lightmaps, you can then use dynamic lights to provide direct lighting.

Anyway, your solution shows that it works (aka: using a lightmap overrides scene ambient lighting).
#5
10/02/2009 (2:59 pm)
Well, thank you all for the answers. At the moment, I must admit I haven't studied lighting much yet. I do understand Edward's solution with the zones so I will try to implement that.

@Manoel, is what you are suggesting something that Purelight would be good at? Right now, I have no idea how to bake vertex colors or make lightmaps. Any suggestions as to how to begin to educate myself?
#6
10/02/2009 (4:14 pm)
The right fix may be in 1.1... it depends on the time i get.

I want to add per-zone ambient lighting so that you can have different ambient values for different areas of your game.
#7
10/02/2009 (4:56 pm)
now that would be awesome, per zone lighting? idea.. how about per terrain lighting? i know some folks can do with just 1 light source, but some areas might need several light option in 1 zone. just as a option.