Bias lighting

From Doomsday Wiki
Jump to: navigation, search
Requires: —

Bias lighting is the new lighting model being developed in the Doomsday 1.9.x series. It replaces the old DOOM, sector-based uniform lighting with per-vertex level lighting.


The Bias lighting model is divided into two seperate subsystems:

Light grid

Used for converting sector lighting into a structure suitable for per-vertex lighting. Sector light values (and light effects such as blinking) are applied to the game world through the light grid which also smooths across sector boundries.

Point light system

The point light system handles Bias light sources. Bias point lights can be used to add additional lighting effects to a map and can be used by both map designers and end users. Bias point lights are created from Light definitions, spawned into the world when the map is first loaded.

These are similar to dynamic lights in that they are point lights but they are different in that they are designed for large scale lighting effects. Another key difference is that Bias light sources cast an infinite ray of light in all directions from their origin, these rays are obstructed by world geometry (meaning: dynamic shadows).

Remaining work

The implementation of bias lighting has not been completed yet.

  • Performance optimization for LG map setup and per-frame/update.
  • Lightning in Hexen causes massive slowdown due to having to change the light levels of all outdoor sectors (light grid update). Fix this by calculating another matrix of grid blocks affected by skylight. The skylights are added to the regular bias lighting during evaluation.
    • Ideally the mechanism used to address this would be generally applicable and not just tailored for the aforementioned outdoor sectors. It should be possible to derive an upper bound for the optimal number of grid blocks a sector/sector-tag can manipulate "in-place" before an additional matrix of blocks is constructed. --danij 05:11, 28 April 2013 (UTC)
  • The current implementation of R_IsPointInSector is fundamentally flawed in that it assumes: one sector == one n-sided polygon.
  • Lighting is not consistent between onesided seg middles and twosided seg uppers+lowers.
  • Surface colors are not intergrated with bias lighting (twosided seg middles are currently hidden to remind us of this).
  • Bias light sources don't affects mobjs yet. When drawing a mobj, the bias light level at the location should be evaluated to get a basic ambient light level.
  • Automatic conversion of huge dynamic lights to bias sources needs to be revised.

Open questions

  • The new world renderer will likely obsolete the entire bias lighting system. Should this be dropped?
    • No. The new renderer can still utilize the smoothed sector grid and point light sources in whatever lighting mechanism is chosen. So while the internal implementation may radically change, the user-facing features should be kept/further developed.

See also