Placing Lights
From FleshWorks
Contents |
Intro
You must place lights in your level in order to see anything in game. There are two types of light that can be placed in a level.
- Actor-based lights, based on static meshes and emitters. These include lanterns, candles, fireplaces, magic lights and so on. These are all available in the Actor Browser, under WorldObj -> _Light.
- Basic lights, which are not visible in game. These are placed by right-clicking on a viewport and choosing Add Light Here. This type of light is ideal for ambient lighting, where you want to illuminate an area or object without having any actual physical light objects.
Hint: Activate the Flesh renderer to receive instant feedback of lighting changes in the 3D window.
Basic Lights
Lights are very easy to place - you simply right-click on a surface in the 3D viewport and select "Add Light Here" from the context menu. By default you get an white, fully bright, omnidirectional light at the place where you clicked.
Light Actors
There are various light-related actors in the gamesys that combine meshes and light sources, rather like the torches in the Dark engine. If you add a torch actor, you get a torchholder mesh, a light, and a particle emitter.
Actor > WorldObj > Light_ > leads to a large selection of lighting actors.
Lighting properties can be added to these objects, as with normal lights, so you still retain full flexibility with the convenience of having meshes and lights linked together.
Lighting properties
Like other game objects, you add properties to lights in order to alter parameters and get certain effects. For example:
- Select a new light, right click on it and select Light Properties
- Expand the last properties node under Light (1 selected)
- A bunch of property groups will appear, including Lighting
- Right-click on Lighting and select Add Property
- Under Property Categories, Lighting should already be highlighted, such that relevant properties appear opposite.
- Select FleshLightType and click the Add Property button at the bottom of the window.
- Now you should have FleshLightType available under Lighting, where you have a dropdown to select from various types (FL_Omni, FL_Spot etc.)
Other lighting properties may have more complex parameters, but they are added in the same way.
Available Properties
FleshLightType
- FL_Omni - Omnidirectional light
- FL_OmniNoShadow - as expected, and OmniLight that casts no shadows
- FL_Ambient
- FL_AmbientVertex - seems to apply ambient light to nearby meshes
- FL_Spot - spotlight
- FL_SpotNoShadow - spotlight casting no shadows
Lights that don't cast shadows are useful for performance reasons.
LightColor
A fairly self-explanatory property that allows you to set the Hue, Saturation and Brightness of the light's color.
LightShape
Parameters:
- DotBias
- LightCone - only really relevant to spotlights, increasing this increases the spread of the light, like increasing the size of the base of the light cone.
- LightInnerRadius
- LightPeriod
- LightPhase - these two properties are probably related to animated lights.
- LightRadius - for omnilights, the radius of the light's sphere - for spotlights, this is the light's reach (height of the light cone).
LightDamping
This is a single property, and its value is a float between 0 and 1. What it tends to do is soften the light for a more subtle effect. It could just be lowering the brightness, but it's a simple way of reducing the light level.
Property comment in editor: "Damps out the light by specified factor. 0 means original light value, 1 is completely dark."
This property can be used for dimming down multiple lights at once, even if they all have different brightness values - in this way it works as a scale factor.
FLLightTexture
This allows you to specify a texture that the light will project. This property makes most sense with a spotlight - you get strange results with an omnilight. It appears to have replaced another property, ProjectedLightShape, given the associated comment: "Use the FLLightTexture now. (This one will be removed)".
All you have to do is enter a suitable texture in the Name parameter. It's often used to simulate light shining through windows. For example, a window in the museum level uses the GENwindowint_P texture here to project a pattern on an opposite wall.
The Length and Radius parameters don't seem to have much effect.
LightLevelWeight
The value of this property controls how the light gem responds to lights. It is a decimal value, 1.0 = fully effects your lightgem based on its light value, 0 = has no effect on your lightgem despite the light value.
Lighting hints
- Consider Null's Performance Tips while placing lights and shadowcasting objects.
- Any static mesh or actor can be turned into a light by setting Lighting properties on it. Similarly, the object lights available in the Actor Browser have default lighting settings that can be changed.
- OmniNoShadow lights will bleed through BSP walls, as they do not cast any shadows. You will probably want to keep their radius small to prevent this from happening (if you want to illuminate a large area, use lots of these lights with small radii).
- Changing the cone radius of a spotlight requires a Rebuild before the changes are visible in the Flesh renderer.
- If you encounter problems with parts of static meshes missing shadows, try increasing the Radius of the light that is casting the shadow. This problem is caused when the missing shadow falls outside the radius of the light. You can also increase the ShadowExtrusionDistance, but bear in mind that this uses a completely different scale to the Radius property. ShadowExtrusionDistance can also be used to stop light from "bleeding through walls," as around a doorway, for instance. The problem is that the light radius reaches beyond the shadow radius. Slowly increase the value for ShadowExtrusionDistance until the bleed-through stops.
- If you plan to use Distance fog in the map, you can get away with using a lower level of ambient lighting, since fog tends to brighten distant areas.
- Static meshes at the edge of light's range tend to have their shadows disappear and reappear periodically. Increasing light's radius a bit seems to solve the problem.
Back to Getting Started With The Editor
