How to light a lantern. (Interior Lighting)
by Infinitum3D · 12/08/2006 (10:30 am) · 6 comments
12-05-2006 Torque 101: Interior Lights
Let's try something else. I've placed a tower (a default .dif that comes with the Starter.FPS) in my world. The tower looks great, all stone, iron, and wood, and it's massive.
The only problem is that it's pitch black inside (meaning its been "portalized" for efficiency). That's pretty neat if you want it that way, but I'd like to see some shadows. Also, I'm sure the artist put alot of work into details inside, so we need to see those too.
Let's look in the front door into the total darkness.
Open the World Editor Creator and click on Mission Objects>Environment. Near the bottom I see Volume Light. Let's click it.
A pop-up opens. Name it innerLight and select the datablock for sgTempleWindowStaticPSDatablock and click OK. It doesn't do much.
Open the Inspector and let's change the datablock. Whoa! There's like, what, two dozen datablocks to choose from?
Let's try sgDefaultLightDataBlock. Nice! We see a little. Move it over into a corner and let's add a couple more. OK, so I now have 4 lights. Try to keep the Z position the same for each. Now I can see, but it's not very realistic. Where does the light come from? We need a flickering torchlight. In Shapes there is a lantern .DTS file that we can place. (I also have a torch.DTS that I use).
That adds a little more realism, but we need to place the lights inside the lanterns. Let's try that.
Open the Inspector and find the position of the lantern. Copy that location and apply it to the innerLight . Actually, let's change the name of innerLight to lanternLight while we're at it. You may need to tweak the location just a bit to get it perfect.
OK, so the light comes from the lantern, but it's not flickering like a true fire. Let's place a particle emitter. Go into the Creator again, Mission Objects>Environment>ParticleEmitter
Name it LanternFlames, datablock is TorchFireEmitterNode, and particleData is TorchFireEmitter. Set it's location to the same as the lanternLight. Adjust it a little if needed.
That's all there is to it.
Save the mission, run it and enter the tower. You now have a flickering lantern.
Remember to place similar objects into simGroup folders for better organizing.
Tony
Let's try something else. I've placed a tower (a default .dif that comes with the Starter.FPS) in my world. The tower looks great, all stone, iron, and wood, and it's massive.
The only problem is that it's pitch black inside (meaning its been "portalized" for efficiency). That's pretty neat if you want it that way, but I'd like to see some shadows. Also, I'm sure the artist put alot of work into details inside, so we need to see those too.
Let's look in the front door into the total darkness.
Open the World Editor Creator and click on Mission Objects>Environment. Near the bottom I see Volume Light. Let's click it.
A pop-up opens. Name it innerLight and select the datablock for sgTempleWindowStaticPSDatablock and click OK. It doesn't do much.
Open the Inspector and let's change the datablock. Whoa! There's like, what, two dozen datablocks to choose from?
Let's try sgDefaultLightDataBlock. Nice! We see a little. Move it over into a corner and let's add a couple more. OK, so I now have 4 lights. Try to keep the Z position the same for each. Now I can see, but it's not very realistic. Where does the light come from? We need a flickering torchlight. In Shapes there is a lantern .DTS file that we can place. (I also have a torch.DTS that I use).
That adds a little more realism, but we need to place the lights inside the lanterns. Let's try that.
Open the Inspector and find the position of the lantern. Copy that location and apply it to the innerLight . Actually, let's change the name of innerLight to lanternLight while we're at it. You may need to tweak the location just a bit to get it perfect.
OK, so the light comes from the lantern, but it's not flickering like a true fire. Let's place a particle emitter. Go into the Creator again, Mission Objects>Environment>ParticleEmitter
Name it LanternFlames, datablock is TorchFireEmitterNode, and particleData is TorchFireEmitter. Set it's location to the same as the lanternLight. Adjust it a little if needed.
That's all there is to it.
Save the mission, run it and enter the tower. You now have a flickering lantern.
Remember to place similar objects into simGroup folders for better organizing.
Tony
About the author
#2
My learning curve IS improving, but it takes a lot of mistakes before something goes right :)
Thanks for the rating!
Tony
12/09/2006 (2:07 pm)
Stephan,My learning curve IS improving, but it takes a lot of mistakes before something goes right :)
Thanks for the rating!
Tony
#3
Though I have significant more TGE editor experience than you ;-), it never came to my mind I could copy and paste x y z coordinates in the GUI... I was certainly expecting too much from the editor...
You saved my time. 8-)
STef
12/10/2006 (3:53 am)
Tony,Though I have significant more TGE editor experience than you ;-), it never came to my mind I could copy and paste x y z coordinates in the GUI... I was certainly expecting too much from the editor...
You saved my time. 8-)
STef
#4
Here and example from one Darkwind: War on Wheels track (Nothern Foothills Racetrack) in its night version:
Note: this is TLK 1.3 code, so it may be slightly different in TLK 1.5, but you got the point.
STef
edit: added final comment.
01/18/2007 (6:27 am)
I would recommend creating a SimGroup for each paired objects: lightdatablock and shape object. it will be easier to move them around the scene without messing up alignement of the light.Here and example from one Darkwind: War on Wheels track (Nothern Foothills Racetrack) in its night version:
new SimGroup(LightingPoles) {
new SimGroup(light001) {
new InteriorInstance() {
position = "215.978 209.293 123.172";
rotation = "0 0 -1 40.107";
scale = "1 1 1";
interiorFile = "~/data/interiors/racing/light.dif";
showTerrainInside = "0";
locked = "0";
};
new sgUniversalStaticLight() {
position = "206.78 201.416 144.172";
rotation = "1 0 0 0";
scale = "1 1 1";
dataBlock = "LightingPole";
Enable = "1";
IconSize = "1";
ParticleColorAttenuation = "1";
};
};
new SimGroup(light002) {
{
blah, blah, blah
};
};
};Note: this is TLK 1.3 code, so it may be slightly different in TLK 1.5, but you got the point.
STef
edit: added final comment.
#5
09/17/2007 (3:10 am)
where is Mission Objects?
#6
09/17/2007 (4:15 am)
it's ok i get it now! 
Torque Owner Stephan - viKKing - Bondier
It seems your Torque learning curve is going in the right way.
STef