FX Lights - new attenuation
Attenuation Definition
Light attenuation is the gradual decrease of a light source's intensity with distance, simulating real-world physics for realism and often tweaked with terms for artistic control, performance, and gameplay clarity, defining its radius and falloff to manage how brightly things illuminate or how quickly they fade into darkness.
For the previous versions of Dawn of War I, the old attenuation system was complicated. There were 2 parameters involved, Attenuation and Radius. Attenuation would be a factor on how the lighting would linearly drop off over distance. Radius was the point where lighting was cut off. This means that you have to tune both of them to get it right to make it feel more natural. It has been found by the team revisiting the game that the old attenuation was really blown out once terrain lighting was enabled. So the team decided to put in a "New" Attenuation.
This "New" Attenuation uses radius and has it drop off by the inverse square of the distance (as does light in reality) to 10% intensity at that distance. The lights will often project out further than this due to technical limitations but we have a hard limit of 8 lights per object rendered (D3D9 limit). If you are planning to debug lighting in the FXTool, you can load a model in it to see how the lighting looks and then adjust the emitter position.
An example of the [Old] Attenuation on the left (overbright and blown out) and [New] Attenuation on the right (what the artist intended). These are 3 of the placeable lights in the Mission Editor.
Setting the "New Attenuation” on your content.
- Open up your FX in the FX Editor
- For any light in your scene [L] you can choose “New Attenuation” and then tick the check box
- ✓ and click Apply
4. Additionally, if you want to create a more intense light… “Intensity” is a new feature
5. Save your FX and test in game.
Viewing and Testing Light Volumes you can view the “volume” of FX lights now in game, in the Mission Editor and most tools.
IN GAME: press Ctrl Shift "~" (debug console) and type in light_toggledebug() to turn on (and off) to see a blue “light volume”
IN MISSION EDITOR: press F5 to execute a LUA command and type in light_toggledebug()
note: this (above) may be replaced with a button sooner than later.
IN the FX EDITOR: press View > Light Volumes
In the FX Editor… to see your edits to the light you've edited, you can add a model to the scene (to light) by selecting Choose Model… (bottom of the list in the image above) and find any SGM file.
You can also use Edit > Emitter Position (you can set a value, or choose a marker if you have a model selected) to move the light around to better visualize your FX. These values are only for viewing purpose in the tool and are not saved in any way.