Darkplaces lighting/Special effects

From Blood Wiki
(Difference between revisions)
Jump to: navigation, search
m
(Planar shadows)
 
Line 22: Line 22:
 
Planar shadows are either stencil or shadowmapped if shadowmapping is on.
 
Planar shadows are either stencil or shadowmapped if shadowmapping is on.
  
{{tip|Planar shadows could be used to simulate sunlight in outdoor locations.}}
+
{{tip|Planar shadows are used to simulate sunlight in outdoor locations.}}
  
 
{{cvar|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.}}
 
{{cvar|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.}}

Latest revision as of 14:14, 7 October 2012

Darkplaces lighting | previous chapter: Lighting model

Contents

This page is not finished
You can help by editing and extending it.

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.

[edit] Light styles

Stub!

[edit] 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

[edit] 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.

[edit] 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 are 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.

[edit] 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.)

[edit] 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