Light (DED)

From Doomsday Wiki
Jump to: navigation, search

Cleanup Note: This article should be cleaned up to be more readable and/or to more closely follow the Wiki article guidelines.

Light
Attributes: Copy
Type ReferenceDED Syntax

A Light definition is used to attach a light and/or halo to a Sprite's State. As most objects are made up of more than one state this enables us to have "animated" lights that pulse in colour, change size etc etc.

Note: If you want to attach a light to a texture or flat please check the section on texture Decorations as the method used for that is slightly different.

Details

Doomsday is also able to use lightmaps in place of the standard light texture, this makes it possible to limit the directions an object casts light in, or to do fancy effects like flickering fire.

To attach a light to State it must have been set up as fullbright. To do this the value 32768 must be added to Sprite frame number in the State definition other wise no light will be rendered. The State definitions can be found in Objects.ded so if you want to add a light to a State that is not fullbright you will need to copy the State definition from Objects.ded, add it to your own ded and add 32768 to the frame number.

Note: The engine usually calculates the properties of dynamic lights based on the sprite frame of the light source. Any zero values in the Light definition will be replaced by these automatic calculations (zero is the default for all keys).

Syntax

<Copy> Light
{
	 # If "Copy" is found all the data of the previous definition is
	 # copied to this one as defaults. For the first definition in a
	 # file "Copy" has no effect.

	 Red = 0.0
		  # Red color component (0-1).

	 Green = 0.0
		  # Green color component (0-1).

	 Blue = 0.0
		  # Blue color component (0-1).

	 Color { 0.0 0.0 0.0 }
		  # Sets all three color components at the same time.

	 # Dynamic Light only:
	 # The following settings are only available with dynamic lights

	 State = ""
		  # The State with which the light properties defined here will
		  # be used.

	 Flags = flaga | flagb | flagc etc...
		  # nohalo: No lens flare (halo) is rendered.
		  # dontturnhalo: The lens flare (halo) will not be rotated
		  #	relatively to the viewer. New as of 1.9.0-beta6.

	 X Offset = 0.0
		  # In pixels, offset from the center of the source. The offset
		  # is parallel with the view plane. Negative values shift the
                                             # source leftward, while positive values move the source to the right.

	 Y Offset = 0.0
		  # In pixels, offset from the top of the source object.
                                            # A negative value will move the source upward and
                                            # and a positive value moves the source downward.

	 Size = 0.0
		  # Size (strength) of the light. Should be between 0 and 1.

	 Halo radius = 0.0
		  # New as of 1.9.0-beta6.
		  # Radius of the halo. Zero means no halo is rendered. Note
		  # that halo radius 1.0 produces quite a large flare.

	 Flare map = ""
		  # New as of 1.9.0-beta6.
		  # Name of the flare map to use OR a built-in flare texture id to use for the primary flare (i.e. the halo itself).
		  # Eg:
		  # Flare map = "myflaremap.png" (loaded from the data/<game>/flaremaps folder by default). 
		  # Flare map = "1"

		  # Built-in flare texture ids:
		  # 0 = Texture chosen automatically.
		  # 1 = Default dynamic light texture.
		  # 2 = FLARE.
		  # 3 = BRFLARE.
		  # 4 = BIGFLARE.

	 Top map = ""
	 Bottom map = ""
	 Side map = ""
		  # Name of the light map to use. The top map is used for ceiling
		  # planes, the bottom map for floors and the side map for walls.
		  # If left blank (the default), the standard round dynlight texture
		  # is used. Use "-" to disable a map entirely. No light will then be
		  # cast in the direction.

	 # BIAS source only:
	 # The following settings are only available with BIAS sources

	 Map = mapid|game|pwad/iwad|gamemode
		  eg = "e1m1|doom|iwad|doom1-ultimate"
		  # Indicates that this is a bias light source and not a dynamic
		  # light. This tells doomsday which map the bias source is for

	 Origin { 0.0 0.0 0.0 }
		  # The location of the bias source in the map (X Y Z)

	 Intensity = 200
		  # How bright the bias light source is.

	 Sector levels { 0 0 }
		  # The light levels at which the source is fully "on"
		  # eg if { 80 200 } would mean the light is off if the sector
		  # light is lower than 80 and gradualy increases to full brightness
		  # untill the sector light is 200 at which point it is fully "on"
		  # Values can also be inversed so that the light is fully on when
		  # the sector light is eg 40 and fully off at 255
}