AgeLighting
From Alcugs
Note: Anything extracted from any Plasma Resource Files is property of Cyan Worlds, Inc. You may not use these assets without recieving written permission from Cyan Worlds, Inc.
Please read this Notice from Cyan about Age Creation before continuing.
|
Contents |
A Word About Materials
The color of your object's material will be the color that a polygon has when it is not affected by any light, i.e. its normal is pointing away from the light source. Consider this color the "ambient" color of the object.
An object's polygons that point toward the light will become the color of the light, depending on the proximity of the light (in the case of an omni or spot light) and the angle of the polygon's normal to the direction of the light. So, a polygon that is directly facing the light and is right next to the light will be the color of the light. Caveat: textures of course will affect the color.
So, don't make the mistake of setting your object's material color to white and placing a white light near it. The object will still be white all over. Better to use a shade of gray.
Note: the specular color does not seem to have any affect in URU. Typically, this is set to black.
Start
Open your age in Blender.
Let's add an object to the age that will be affected by the three lights that we'll add in this tutorial. I like to use the "Suzanne" monkey head as a test object for this, since it has lots of polygons that face all different ways.
Create a material for the object and give it a color that is not white.
Optionally, you can make the object movable. This will allow you to move the object into the different lit areas. However, this is not necessary to have the object be affected by lights.
- Add a string property named "col_type"; set its value to 4
- Add a float property named "mass"; set its value to 5
- Add a float property named "el"; set its value to 2
(Make sure to add these properties *only* on objects that you want to be movable.)
Adding An Omni-directional Light
Position the cursor where you will put the first light, e.g. 10 units along the positive Y axis from the object.
We'll first add an omni-directional light, so choose Add->Lamp->Lamp. When the lamp appears, select it. Adjust the height of it so that it isn't resting on the ground.
Bring up the new lamp's Editing properties (F9). In the Link and Materials section, set the name by clicking in the OB: field and typing in a new name (e.g. OmniLight01). Repeat this with the LA: field. Check that the new name has been transferred - select another object, then select the lamp; the name should be displayed in the lower-left corner of the view.
Figure 1: Renaming your light.
Bring up the lamp's Shading properties (F5). Set its Quad2 value to 0 or close to 0. By default, this is 1 - which causes your light not to affect anything at all. Set the Dist value to the maximum distance from the light that you want objects to be affected by it. Set the color by adjusting the R, G, B sliders, or by clicking on the color field below the sliders to pick a color from the palette.
Figure 2: Omni-directional (Lamp) Properties.
Adding A Directional Light
Now let's add a directional light. You can place the cursor wherever you want; it does not matter for a directional light.
Choose Add->Lamp->Sun. Select the light, then orient it to point it in the direction you want to illuminate your scene. Blender draws a dashed line out from the light to indicate the direction.
Bring up the new lamp's Editing properties and rename it (e.g. DirLight01).
Bring up the lamp's Shading properties. Set the desired color. Note: the distance does not affect anything.
Figure 3: Directional (Sun) Properties.
Adding A Spot Light
Place the cursor where you want the spotlight to be. Then choose Add->Lamp->Spot. Adjust the height of the spotlight. Also, adjust the orientation. Blender renders a cone stretching out from the light in the direction of the illuminated area.
Bring up the new lamp's Editing properties and rename it (e.g. SpotLight01).
Bring up the lamp's Shading properties. Set its Quad2 value to 0 or close to 0. By default, this is 1 - which causes your light not to affect anything at all. Set the Dist value to the maximum distance from the light that you want objects to be affected by it. Set the color by adjusting the R, G, B sliders, or by clicking on the color field below the sliders to pick a color from the palette.
To adjust the size of the spot light cone, go to the Spotlight section of the shading properties. There are two sliders that control this. "SpotSi" is the spot size, or the outer cone angle. "SpotBl" is the spot blend, or the percentage of the spot size at which the light begins to fade. This affects the inner cone angle. Setting SpotBl to 0 means that the inner and outer cones are identical.
Figure 4: Spot Properties.
Lighting Your Object
Select the object you want to light (e.g. the monkey head). Bring up its Logic properties (F4). Click on the ADD Property button. Set the property type to String, set the name to "lights000", and set the value to the name of your light (e.g. OmniLight01). Repeat this for the other two lights, using property names "lights001" and "lights002".
Figure 5: Object lights properties.
You may want to do the same thing for your ground object. That way, it is more obvious which areas the lights are affecting. Make sure your ground object is broken up into smaller polygons. The finer the resolution of the ground mesh, the better the lighting affect looks.
Save your modified age to the .blend file.
Export your age. If Blender reports an error, look at the console. Most likely, you had entered the incorrect name of the light in the object's lights00X property.
Exit Blender. Register your age with URUAgeManager, then start UruExplorer.exe.
Have fun exploring your lit age!
Figure 6: Exploring a lit age.
Note: the lights affect only the objects in the same page as the light. By default, the lights (and objects) will be on page 0.
If you want to look at a completed age with lights added and properties added, then download the file below:
Using Soft Volumes
You can have finer control over the places where the lights affect your avatar and other objects by using soft volumes. For more information, see the Soft Volume Tutorial.
|

