Darkplaces lighting Light sources - isgallagher/DpOmnicide GitHub Wiki

{{navigation title|Special effects}} {{unfinished}} ==Static lightsources==

==Dynamic lightsources==

==World lights== Worlds lights are loaded from external .rtlights file supplied with a map (foo.bsp will try to load foo.rtlights). If there are not .rtlights file, engine tries to load lights from a map "light" entities, which often is grude and terrible slow (as "lights" are maked for map compiler LIGHT stage raytracer, not for reatime rendering). So producing a good .rtlights folr is very first step in a process of map creation.

World lights are static, meaning they canot be moved, rotated, altered during a game.

{{tip|Blood Omnicide is using world lights to place lights for a Q3map2 LIGHT phase. So unlike Quake, which should have both "light" entities and .rtlights, Blood Omnicide .rtlights containins all map static lights}}

Each world light can have this parameters:

  • origin : position
  • angles : rotation
  • color : RGB light color
  • radius : radius of light in game units
  • corona : corona intensity (0 to disable)
  • coronasize : size of corona (this is multiplier to light radius)
  • style : lights style number (see lightstyles above)
  • shadows: whether to cast shadows from light
  • cubemap : a path to cubemap filter texture
  • ambient : ambient light intensity (ignores shading, makes lighting to be more 'flat')
  • diffuse : shading light intensity (default is 1)
  • specular : specular intensity (default is 1)
  • normalmode : if this flag is set, light will be draws if cvar r_shadow_realtime_world is 0
  • realtimemode : if this flag is set, light will be draws if cvar r_shadow_realtime_world is 1

{{tip|A combination of normalmode = 0, realtimemode = 0 to mark lights which are only appear on lightmap}} {{tip|Light style 1 will make a dynamic lights that will not appear on lightmap}} {{tip|Cubemap-filtered lights dont appear on lightmap}}

Console variables: {{cvar|r_shadow_realtime_world|Enables rendering of full world lighting (whether loaded from the map, or a .rtlights file, or a .ent file, or a .lights file produced by hlight)}} {{cvar|r_shadow_realtime_world_lightmaps|Brightness to render lightmaps when using full world lighting}} {{cvar|r_shadow_realtime_world_shadows|Enables rendering of shadows from world lights}} {{cvar|r_shadow_realtime_world_compile|Enables compilation of world lights for higher performance rendering (shadow volumes only)}} {{cvar|r_shadow_realtime_world_compileportalculling|Enables portal-based culling optimization during compilation (overrides compilesvbsp)}} {{cvar|r_shadow_realtime_world_compileshadow|Enables compilation of shadows from world lights for higher performance rendering (shadow volumes only)}} {{cvar|r_shadow_realtime_world_compilesvbsp|Enables svbsp optimization during compilation (slower than compileportalculling but more exact)}} {{tip|In Blood Omnicide, this console varisables are hardcoded since its using a combination of full realtime lightning and lightmaps. Tweak this settings only for debugging purposes or if you want to break something.}}

== Dynamic lights == Dynamic lights are cast from entities. This could be both server-side entities such as rockets or client-side entities such as explosions.

{{cvar|r_shadow_realtime_dlight|Enables rendering of dynamic lights such as explosions and rocket light}} {{cvar|r_shadow_realtime_dlight_portalculling|Enables portal optimization on dynamic lights}} {{cvar|r_shadow_realtime_dlight_shadows|Enables rendering of shadows from dynamic lights}} {{cvar|r_shadow_realtime_dlight_svbspculling|Enables svbsp optimization on dynamic lights}}

{{navigation footer|Tweaking}}

⚠️ **GitHub.com Fallback** ⚠️