This is dedicated to documentation of the Quake3_Quake1 mod which makes DarkPlaces/Zircon engine capabilities available for Quake 1 single player/coop mapping using the Quake 3 map format. Documentation will be here as an ongoing process.

Post tutorial Report RSS Switchable Lights In Quake3_Quake1

An examination of the switchable lights in Quake3_Quake1, how they work and how to get the best results.

Posted by on - Basic Mapping/Technical

Quake3_Quake1 has switchable lights available in the next version. This article will look at how they work and how to get best results.

red0


Quake3_Quake1 has some extra lighting options that are not available in 1996 vanilla Quake 1.

dlight

dlight is the entity type Quake3_Quake1 uses for dynamic light entities. This is for any light with an animated light style or that can be switched on or off. This entity is nearly identical to the Quake 1 "light" entity, except that the map compiler does nothing with it (it is ignored) and these lights are provided by the engine.

  • Switchable lights can use a flashing lightstyle when on.
  • Switchable lights can have a color.
  • Quake3_Quake1 func_button can multi-target (like "target" "lightz1,lightz2" will fire both of those triggers. This means a button can activate 2 or more different types of lights at once conveniently.)
  • All dlight entities can have a cubemap filter to limit their lighting effect. Or to produce a pattern.

Switchable Light + Flickering Light + Colored Light Example

This combines a few features together to allow simulatenous examination of multiple features to keep this article shorter and the information density high.

redred

Constructing The Flickering Red Switchable Light

Step 1 - Create a dlight. Set style to Flickering 10. Called it lightz1 -- "targetname" "lightz1"

red1 11

Step 2 - Give dlight color red which is "colormod" "1.0 0 0"

red2 2

Step 3 - Have it OFF. Set flag "[1] - Initially Dark"

red1 0

Step 4 - We are not doing this here, but it is possible to "make your own" light animation.

red42

Step 5 - Make a func_button, have it target the dlight created: "target" "lightz1"

red2 1

DLights Bleed Through Walls

Quake 1 switchable and flickering lights are part of the map compilation process.

Quake3_Quake1 dlight entities are all engine side. If the radius is large, it will go outside of a wall.

redredbleed

Limiting Radius or Cubemap Filtering

One method for limiting the visuals outside the "room" are limiting the radius or using a cubemap to limit the scope of the light.

red0limited

Here we have used a cubemap to control how the light is emitted. This white light has little or no influence outside the area.

The cubemap specified is "cubemap/03". "lite_cubemap" "cubemap/03"

It is composed of 6 sides.

  • 03up.tga (up)
  • 03rt.tga, 03lf.tga, 03bk.tga, 03ft.tga (right, left, back, front)
  • 03dn.tga (down)

This cubemap is "quake/quake3_quake1/cubemaps/03up.tga".

03up.tga - 50% gray - light emiited is limited to 50% output upwards
03up

All the sides (rt, lf, etc.) - gradient from 50% to 100% - the more downward the angle, more light out

03ft


03dn.tga - 100% white - light emiited is limited to 100% output downwards (no limit)

03dn2


red0limited

Walking around outside the room with the light on, it does not seem to have much or any effect outside the room using the cubemap.

Notes:

  • If a func_button targets "lightz1", all entities with the targetname "lightz1" will fire whether they a dlight entities or doors or such. If you want 2 or 6 lights to trigger, give them all the same targetname and the same lighting parameters and have the "[1] Initially dark" flag the same.
  • Only 1 lighting animation (lightstyle) per unique targetname is possible. That is the rule for Quake 1, for consistency that is how Quake3_Quake1 dlight entities work. For instance, if you want 3 lights to trigger and 2 lights are non-flickering (style 0) but the 3rd light flickers (style 10). So have the 3rd light with the flickering (style 10) use a different targetname like "targetname" "lightz2" and have the func_button multi-target with "target" "lightz1,lightz2".
  • Quake3_Quake1 dlight entities should be used in moderation -- for example 20 different light animations in a scene on modest hardware had low framerates. Quake3_Quake1 dlight entities are engine dynamic lights and less efficient than precomputed lightmaps during map compilation. Perhaps in the future more ideas for achieving lighting-like effects will come to mind, there is at least 1 experimental idea that deserves some testing.
Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: