Lighting Entites


By default all models are lit with level directional lighting. You change this lighting (for all models) at any time with SETAMBIENTCOLOR & SETAMBIENTCOLOR. This is a Primary light source. (In Film lighting it is called the KEY light)

You can add lighting to a specific model using the LIGHTING cmd. This is a Base Light source or a secondary Light source. (in Film this would probably be called the FILL light). A model gets its Base light value from the Shadow(or Light Map) under itís origin point.

Models are lit by these 2 light sources.The overall ambient(PRIMARY/KEY light) and the value underneath its origin point (Base/FILL Light). 2 Lights require more CPU than 1 light, so a lot of secondary Models, like cups & things didnít have the Primary light on it. The entity.dat has a flag for models that get affected by LIGHTING/both. Look in entity.dat for reference.

You can change the AMBIENT/KEY light (for 1 model) to a moving light source using the LIGHTSRC command.

OR

You can change the AMBIENT/KEY light (for 1 model) to a still light source using the DIFFUSE command.

Make a fresh new script with boots on a node
Newent=character_boots:floor=1
Make sure he is nicely centered and fills the screen.
Now most Anox maps have a light value associated with them AND a direction. This is set in the .APE file associated with the map. PLANET & APE use the same command:
SETAMBIENTCOLOR=[r,g,b]
SETAMBIENTDIR=[x,y,z]
These values are affecting boots right now. You can change these values yourself in a PLANET script (on the MASTER -command path). They are permanent, so I would rarely use them. This would affect EVERY MODEL IN THE LEVEL!!!! But you should definitely PLAY with them to see how they work.

Change their values and see how it affects the lighting on boots.

Make another node next to boots and give it this -cmd:
Newent=mys_whitesphere;floor=0
This is a whiteglobe, you may need to create a -scale node and scale the globe down. See how the light affects both.

Now for some individual lighting. change

Newent=mys_whitesphere;floor=0;lighting=0=0=0=0
Sets it back to the default model color

Newent=mys_whitesphere;floor=0;lighting=0=.01=.01=.01
Which is Black!

Newent=mys_whitesphere;floor=0;lighting=0=1=.01=.01
It should look red.

Newent=mys_whitesphere;floor=0;lighting=0=1=1=1
This is white!


Remember when you flew the automap around, did you notice how it changed its light values?
That is because it was picking up lightmap values in 3D space, NOT on the ground. Just lock down the lighting with the LIGHTING=0=R=G=B command.

LIGHT SOURCE
Instead of the ambient light you can give an entity a LIGHT SOURCE. You put that light Source on a path. Goto boots -cmd line. Add an extra node. Move it to 0.1 secs. THIS MUST BE PLACED AFTER THE FIRST NODE! Click on node & type:
Lightsrc=10
This will mean boots will take light from whatever is on track 10.

So lets something on track 10.
Place a node on track 10. on itís -cmd line put
Newent=ob_squib;floor=0;lighting=0=1=1=1

A squib is a super awesome MULTI purpose entity. It is invisible, but it exists with 6 surfaces that effect can be placed on. More on that later.

Play the script, is boots being lit by the squib?

If you canít tell, move the squib closer to boots OR increase the -SCALE of the squib, which is preferred! If he still doesnít look lit, he may need some NEGATIVE lighting (or Contrast, by adding BLACK/shadow). So change his cmd to read
Newent=character_boots:floor=1;lighting=0=.1=.1=.1
This will darken his overall lighting so that you can see the light source better!

Change the lighting on the squib and it will change the color affecting boots. By lighting=0=1=0=0, etc.


Default lighting from map, and or master -cmd line

White lighting from ob_squib

Red lighting from ob_squib

Green lighting from ob_squib

NOW add some nodes to the squib path and move it around boots. Play the script. Neato!

Put a node on the whitesphere cmd line at .1 and give it the: Lightsrc=10

Both models should be affected by that squib light. You may need to add some some NEGATIVE lighting for the whitesphere too. RememberÖ Only 1 light can effect a model at any given time.

DIFFUSE LIGHTING
DIFFUSE=[hexvalue(color),X,Y,Zdirection]

A neat lighting tool that can be changed many times on a models cmd path.

Move your POV(point of view) to somewhere near the whitesphere in 3d space. Select the -cmd node 2 for the whitesphere. Click on the NODE button,and delete the lightsrc=10.
See that DIFFUSE box next to the CANCEL box? Pick a color using the sliders at the bottom left of the screen. Now LOOK AT THE WHITESPHERE AND PRETEND THAT YOU ARE THE LIGHT. Hit the diffuse button. You just saved that light ANGLE relative to the origin point. Play the script.

Here boots receives his lighting from the ob_squib,
while the ob_whitesphere is getting it's lighting from the diffuse command

NOTE: if you have lighting=0=1=1=1 there is to much FILL light to even see the KEY light. They work in conjunction. Bring down the lighting to =0=.1=.1=.1

NOTE: You can only have ONE of these lights.

NOTE: if the model moves it will always keep that light direction. NOT like LIGHTSRC which is a fixed point on a path. (Unless you are removing that path of course)

Set all the diffuse parameters to 0 (zero) to restore it to the defaults.