DLE - Light Tool
(image not found)

With the light tool, the brightness and the effect of variable lights in the mine can be set.


Light tool controls

  1. Set the render depth for static lights here. Render depth means how many cubes away from a light source brightness for that light source is computed.
  2. Set the render depth for variable lights here.
  3. Chose which kind of textures should be affected by variable lights, and which shouldn't. (Realistically, lights should not be darkened by nearby variable lights, but if light positions aren't chosen very carefully, this setting will usually make variable lights effectless).
  4. Turn the real time variable light renderer on or off.
  5. Set the speed of real time variable light rendering.
  6. Let DLE display the effect of variable lights on all affected sides, or only change brightness of the variable lights themselves. The further setting gives a good impression of the overall effect of variable lights, the latter setting allows to precisely check e.g. the sequence of a group of variable lights belonging together.
  7. DLE needs a light color value for each face (segment side) bearing a light. That means you have to manually assign a light color to each such face, which can be a very time consuming process if there are a lot of lights in your level, or if you want to change the color of a certain type of light.
    To make this process easier, you can check 'use texture colors' from the preferences tool and assign colors to textures. DLE will then use that light color for each face bearing that texture. The backdraw of this method is that all faces with that texture will have the exact same light color, taking control over the lighting process from the user's hands.
    To give you the best of both worlds, you can first have DLE assign light colors to faces by checking 'use texture colors', and then uncheck 'use texture colors', check 'create side lights from textures' and make a lighting run, which will now copy the texture light colors to the faces. Now you can modify those faces that you want to cast a different light color. Make sure to uncheck 'create side lights from textures' before you make another lighting computation.
  8. Dynamic segment light is the light that is cast on objects inside that segment. It is derived from the average segment brightness (averaged over the segment's corners), and makes a level look more realistic, as objects will be brighter or darker depending on whether they are in a brightly lit or a dark area of a level.


Remarks

Default light rendering depth is up to 6 child cubes away from the light source. Usually, the light is already very dim or off in 2 - 3 child cubes distance from the light source. Child segment btw. means a segment that can be reached by walking through adjacent cubes, starting at the source segment.

The static illumination in DMB2 was flawed: When DMB2 would walk through the list of lights, calculation light values for each light's child cubes, it would affect the child cubes of previous lights in the list too due to a bug. If there were a lot of variable lights in a this could lead to reaching internal buffer limits prematurely, preventing variable lights at the end of the list to show. DLE fixes this bug.

If there should be indeed too many variable lights in a DLE will automatically reduce rendering depth until it can calculate the effects for all variable lights.


How the lighting works

Illumination sets the corner light values of each (marked, if any marked) sides depending on their distance to the lights to those lights' brightness in the level. The scaling and light render depth functions only affect how bright each light is to be considered, and how far it will reach (how slow or fast its light decays over the distance).

A 'light' is a texture with a brightness value greater than zero - you can have arbitrary textures have a brightness value greater than zero using the brightness slider in the texture tool.

So illumination sets the corner brightness values. To keep manually set values, you need to mark those areas of the level that should have them automatically set (computed), and leave the manually adjusted ones untagged.


Details

  • Brightness values are calculated per vertex (vertices basically are the segments corners).
  • If a face (segment side) has a light texture, the entire face is considered being the light; hence all vertices of that face will receive that lights brightness value.
  • Illumination will proceed to all faces in the vicinity of a light face up to a certain distance that can be reached by travelling through connected segments, and will compute the brightness of each vertex of these faces. Brightness will decay depending on geometrical (Euclidean) distance from the light source.
  • The light tools render depth sliders affects how many segments from the source face away brightness is computed; it does not affect the geometrical distance based decay function. So if the max. decay distance is smaller than the render depth, increasing render depth will not affect a level's lightning. If it is bigger than the distance that is covered by walking <render depth> segments away from the light source, increasing the light render depth will increase the distance up to where a light shines. This particularly means that light will go around corners.
  • If a vertex is in range of several light sources, their brightness from several light sources add.
  • To auto illuminate only parts of a level, mark the desired segments.

I hope this was understandable.


Colored Lights

Colored lights are only available in levels of type D2X-XL. You can assign a light color to every segment side bearing a light texture individually, or assign a color to every light texture. This is done in the texture tool. While the further allows more customization, the latter is easier, as DLE will automatically use a light texture's color wherever that texture is used. To enable this, check 'use texture colors' in the preferences dialog.


Tips and Tricks

You can manually edit the corner lights. You must not use the illumination function on these lights and nearby textures though. Tag the cubes to be automatically lit before employing the illumination function. The backdraw is that DLE will not be able to properly mix the lights of adjacent marked and untagged level regions.

To have a light somewhere w/o a light texture, use the 'empty light' texture as secondary (overlay) texture. That way you can achieve neat lighting effects. To get more control over illumination without using light textures, you can use some otherwise unused texture as primary texture and give it an appropriate brightness value to have its surroundings lit the way you want it, and place the desired wall texture over it as an overlay.


For Level Designers

Read some in-depth information about level lighting the lighting how-to