GLDEFS
From ZDoom Wiki
| | Warning: This feature does not work in ZDoom but in its OpenGL children ports. |
GLDEFS is used mainly for defining Dynamic Lights in hardware-accelerated ports. It also manages OpenGL skyboxes.
Contents |
If you want to make WADs targeted at multiple games use the following lumps:
DOOMDEFS (for Doom) HTICDEFS (for Heretic) HEXNDEFS (for Hexen) STRFDEFS (for Strife)
Since GZDoom 1.0.29, you can use #include statements in any of these lumps. For example, you could find this in a pk3 file:
#include actors/monsters.gl #include actors/missiles.gl #include actors/decorations.gl
Or, the same organization but in a wad file:
#include MONSLITE #include MISLLITE #include DECOLITE
Dynamic light definitions
Firstly you must define the lights themselves:
[lighttype] [LIGHTNAME]
{
...
}
[lighttype]: They type of light. This can be "pointlight", "flickerlight", "flickerlight2", "pulselight" or "sectorlight" LIGHTNAME: The name of the light (to be used later when binding it to objects/frames)
Inside the brackets you define the light properties. These differ for the different types of lights. Here are examples of each type (* means the property is optional):
pointlight POINT
{
color [RED] [GREEN] [BLUE]
size [SIZE]
*offset [X] [Y] [Z]
*subtractive [SUB]
}
RED, GREEN and BLUE: Colour components (each between 0.0 and 1.0) SIZE: Size of the light, in map units (I think) X, Y and Z: The offset for the light in map units, with Y being the 'up' axis. Defaults to 0,0,0 SUB: Either 1 or 0. Subtractive lights 'darken' the area around them rather than light them.
pulselight PULSE
{
color [RED] [GREEN] [BLUE]
size [SIZE]
secondarySize [SECSIZE]
interval [INTERVAL]
*offset [X] [Y] [Z]
*subtractive [SUB]
}
SECSIZE: The size to 'pulse' to. In the same units as 'size' INTERVAL: The time it takes to complete a full pulse (from 0.0 to * (I guess), not sure on the units/scale)
flickerlight FLICKER
{
color [RED] [GREEN] [BLUE]
size [SIZE]
secondarySize [SECSIZE]
chance [CHANCE]
*offset [X] [Y] [Z]
*subtractive [SUB]
}
SECSIZE: The second size to flicker (will alternate between SIZE and SECSIZE) CHANCE: The chance it will flicker to the second size (same as INTERVAL from pulselight)
flickerlight2 FLICKER2
{
color [RED] [GREEN] [BLUE]
size [SIZE]
secondarySize [SECSIZE]
interval [INTERVAL]
*offset [X] [Y] [Z]
*subtractive [SUB]
}
SIZE and SECSIZE: Lower and upper bounds for the size (the light will pick a random value between the two) INTERVAL: The time between 'flickering' to a new random size. (same units/scale as INTERVAL for pulselight)
The sectorlight takes it's intensity from the light level of the sector it's in
sectorlight SECLIGHT
{
color [RED] [GREEN] [BLUE]
size [SIZE]
scale [SCALE]
*offset [X] [Y] [Z]
*subtractive [SUB]
}
SCALE: How much of the containing sector's intensity to use (between 0.0 and 1.0)
Now you bind the lights to specific objects and sprite frames
object [CLASSNAME]
{
frame [SPRITENAME]
{
light [LIGHTNAME]
...
}
...
}
CLASSNAME: An actor class. A full list of these can be found at the ZDoom wiki. SPRITENAME: The first few letters of the sprite name. For example, "MISL" will bind the light to all frames (used by that object) beginning with "MISL". LIGHTNAME: The name of a previously defined light (see above). It is possible to bind multiple lights to a single object/frame.
Example
pointlight BLURSPHERE1
{
color 1.0 0.0 0.0
size 40
offset 0 16 0
}
pointlight BLURSPHERE2
{
color 0.0 0.0 1.0
size 32
offset 0 16 0
}
pointlight BLURSPHERE3
{
color 0.0 0.0 1.0
size 24
offset 0 16 0
}
pointlight BLURSPHERE4
{
color 0.0 0.0 1.0
size 16
offset 0 16 0
}
pointlight BLURSPHERE5
{
color 0.0 0.0 1.0
size 8
offset 0 16 0
}
object BlurSphere
{
frame PINS { light BLURSPHERE1 }
frame PINSA { light BLURSPHERE2 }
frame PINSB { light BLURSPHERE3 }
frame PINSC { light BLURSPHERE4 }
frame PINSD { light BLURSPHERE5 }
}
That binds the light BLURSPHERE1 to all of the BlurSphere's frames (PINS*) for the red sphere, and extra lights on top of it (BLURSPHERE2-5 to PINSA-D) for the animated blue blob in the middle.
Skybox definitions
The GLDEFS lump can also be used to define skyboxes similar to those used in Quake II, made from a textured cube. The textures must be specially polarized so that the skybox will not appear to be a cube when seen in the game. A skybox is defined with the skybox <name> line, and followed by a list of textures within bracket. The given name can then be used as a texture name for the sky in MAPINFO.
There are two options, a six-texture skybox and a three-texture skybox.
If the skybox has six square graphics, one for each face of the cube, you must specify all six of them in order: North, East, South, West, Top, Bottom.
Skybox MYSKY6
{
MYSKY6_N
MYSKY6_E
MYSKY6_S
MYSKY6_W
MYSKY6_T
MYSKY6_B
}
If the skybox has only three square graphics, they must be one for the four walls and one each for the top and the bottom. The order is similar: Wall, Top, Bottom.
Skybox MYSKY3
{
MYSKY3_W
MYSKY3_T
MYSKY3_B
}
Note that you may have to rotate and/or mirror the top and bottom graphics before they display seamlessly in the game. The bottom picture must be aligned with the north picture so that it fits right just under it. The top picture must likewise be aligned so that it fits right just above the north picture, but after that it must be mirrored horizontally and rotated 180°. Skyboxes made for other games may not fit these specifications.

