Darkplaces lighting/Special effects

From Blood Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with "{{navigation title|Lighting methods}} This chapter contains reference of various special effects hardcoded in light renderer. This special effects, applied or combined will he...")

Revision as of 00:03, 6 August 2012

Darkplaces lighting | previous chapter: Lighting methods

Contents

This chapter contains reference of various special effects hardcoded in light renderer. This special effects, applied or combined will help to create wide range of things, such as:switchable lights, projective lights, sunlight simulation, flickering lights and more.

Light styles

Stub!

Coronas

Coronas aimed to simulate glow around dynamic lights, which looks good on small and medium size lights. Coronas are customised per-light (size and brightness) an also can be placed without lights.

 r_coronas : Brightness of corona effects. 0 disables coronas.
 r_coronas_occlusionquery : Fades coronas according to visibility. Bad perormance (synchoronus rendering), even worse on multi-GPU.
 r_coronas_occlusionquerysize : Size of lightsource for corona occlusion checksum. Usial value is 0.1

Cubemap filtering

A technique for modeling non-uniform light distribution according to direction, for example a lantern may use a cubemap to describe the light emission pattern of the cage around the lantern (as well as soot buildup discoloring the light in certain areas), often also used for softened grate shadows and light shining through a stained glass window (done crudely by texturing the lighting with a cubemap), another good example would be a discolight.

Any dynamic lightsource can have cubemap attached.

Planar shadows

Simplified global shadows which are cast from entities, not from lights (so planar shadows are just filters, they dont do any lighting math).

Planar shadows are either stencil or shadowmapped if shadowmapping is on.

Tip: Planar shadows could be used to simulate sunlight in outdoor locations.
 r_shadows : Enable planar shadows cast using lightgrid-stored light direction. When set to 2 always cast the shadows in the certain direction (see below). Shadowmapping only supports r_shadows 2.
 r_shadows_castfrombmodel : Enables shadows cast from bmodels.
 r_shadows_darken : How much shadowed areas will be darkened.
 r_shadows_drawafterrtlighting : Hack to draw fake shadows AFTER realtime lightning is drawn. May be useful for simulating sunlight on large outdoor maps with only one big noshadow rtlight. The price is less realistic appearance of dynamic light shadows.
 r_shadows_focus : Offset the shadowed area focus (used for shadowed area bounds).
 r_shadows_shadowmapscale : Increases shadowmap quality (multiply global shadowmap precision). Needs shadowmapping ON.
 r_shadows_throwdirection : r_shadows 2 throwing direction. Default is '0 0 -1' (down).
 r_shadows_throwdistance : How far to cast shadows from models. This sets shadowed area bounds for shadowmapping.

Customized ModelLight

Lightgrid sampling (diffuse, ambient and light vector components) can be overriden by Client-side QuakeC. Allows various lighting effects on models (strobing, using different positions for sampling etc.)

Fog

Fog are global. Optionally, height plane and height texture can be defined which will make fog to fade with height.

Fog have the following options:

  • density - how much fog to add per distance, this is virtual value. 1 means very strong fog.
  • red - red component of fog color
  • green - green component of fog color
  • blue - blue component of fog color
  • alpha - fog effect opacity (default is 1)
  • mindist - distance to start applying fog at
  • maxdist - maximal distance apply fog at
  • top - origin of height plane at worldspace (game units)
  • height - fog height fade in game units
  • fadetexture - horizontal texture that resembles fading, left pixel if top bright, right is top dark. Can be used for non-linear fading.

Fog are set by console commands:

 fog <density> <red> <green> <blue> [<alpha> <mindist> <maxdist> <top> <height>] : Sets the global fog
 fog_heighttexture <density> <red> <green> <blue> <alpha> <mindist> <maxdist> <top> <height> <fadetexture> : Sets the global fog with customized fade texture



Next chapter: Light sources
Back to index | Top of the page

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox