We mentioned that there are three main light types in UDK: an Emissive component, static and dynamic light actors , and a Light Environment. Light Environments apply to InterpActors, RigidBody actors, and SkeletalMeshes. Every InterpActor (aka Mover) and KActor (aka RigidBody) has a dynamic light environment by default. Light environments provide level designers with an automated way of controlling dynamic lighting by approximating the effect of relevant static lights. With that in mind, this recipe gives a guided tour of light environment staging in a scene so a SkeletalMesh can be lit dynamically in a way that reduces harsh shadows.
Load the provided map Packt_08_LightEnvironment_Start.UDK. This scene shows a small enclosure with a DominantDirectionalLight (Sun), a Skydome, and some weak fill lights. The next screenshot shows the scene, and the XYZ axis is the location of the DominantDirectionalLight as it shines along its X axis, tilted down over the walls. In the light properties, Light Shafts are enabled. This scene is fairly empty, and we're just going to add some SkeletalMeshes to examine the Light Environment settings.
The next screenshot shows comparisons in the editor of these properties in different combinations. The first uses the defaults Use Boolean Environment Shadowing on, and Synthesize SHLight off. The second uses Boolean Environment Shadowing off, and Synthesize SHLight off. This causes a shadow to fall across the body from the scene that isn't shown in the quick computation of the Boolean setting. Notice the darkness of the dynamic shadow. The third: Use Boolean Environment Shadowing off, and Synthesize SHLight on. Notice the fill light that now appears, and the internal shadow on the character is lighter. The cast shadow is still very dark.
The previous screenshot shows a dark, unpleasantly heavy shadow on the left. That is the default for a dynamic object. On the right, the effect of adding a light environment for the actor is clearly more subtle. A Light Environment pertains to a specific actor. From the static and dynamic lights that affect it, the lighting is reproduced for the object with a fixed rendering cost. This approximation is done using a spherical harmonic light and a directional light . A quick explanation is that spherical harmonics are part of a solution to Laplace's equation. Spherical harmonics help game developers code lighting complexity. For those with a coding bent, it may open your eyes to some CG math. An explanation of this can be found at http://www.research.scea.com/gdc2003/spherical-harmonic-lighting.pdf. Epic Games provides documentation about Light Environments and some common troubleshooting: http://udn.epicgames.com/Three/LightEnvironments.html.
An important thing to consider is that this method discards lights from the scene that don't affect the model, does a kind of fuzzing of light from those that do, to simulate light bounces, and then creates a direct light in favor of the strongest incident light affecting the model to produce a key light effect.
Light Environments can be told to cast a shadow (from the direct light only) which is based on the scene lights the spherical harmonics are derived from, if they happen to be casting a shadow already. A limitation of this is that if you enable shadows for it, and there are no shadows in the derivation source lights, then the resulting shadow will go straight down.
18.222.25.112