Darkplaces lighting
From Blood Wiki
(Difference between revisions)
(→Comparison of different lighting methods) |
(→Comparison of different lighting methods) |
||
Line 54: | Line 54: | ||
|- | |- | ||
| Precomputation time | | Precomputation time | ||
− | | <font color=green> | + | | <font color=green>Short</font> |
| <font color=red>Long</font> | | <font color=red>Long</font> | ||
| <font color=orange>Medium</font> | | <font color=orange>Medium</font> |
Revision as of 16:51, 29 July 2012
Darkplaces engine uses combined lighting model. Several lighting methods are implemented to give best results at cases they are aimed for.
Contents |
Light models
Darkplaces using several lighting models, most of them are set globally:
- Phong lighting model - generic and default lighting model
- Fake light - a developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
- Cel shading - a phong lighting model with altered shading.
- Fullbright - no lighting applied
Light methods and effects
There is 4 lighting methods used in Darkplaces:
- Vertex lighting - static lighting, aimed at big counts of simple surfaces
- Lightmaps - static lighting, aimed at surfaces that receives shadows from static objects
- Lightgrid - static lighting, aimed at moving entities
- Realtime lighting - full dynamic lighting (each light is a separate pass), aimed at switchable and moving lightsources that lights moving entities
Additionaly, Darkplaces supports a number of lighting effects:
- Coronas - aimed to simulate glow around lights, which looks good on small and medium size lights
- Planar shadows - each entity cast one shadow on the floor (or by global vector)
- Customized modellight - lightgrid-sampled model lighting could be replaced with QuakeC
- Fog - global fog and global volumeric fog (with height set) are suppored
Shadow mapping vs Stencil shadows
Stencil shadow volumes is a shadow rendering method Darkplaces used in pre-2010. Since 2010 shadow mapping was implemented by Eihrul.
Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
- It is faster to render (especially on complex area maps)
- Takes less CPU time (as construction of shadow volumes is not required)
- Distance-based LOD (far lights rendered with lower shadowmap resolution)
- Shadow edges are not sharp
Comparison of different lighting methods
Task | Vertex lighting |
Lightmap | Lightgrid | Realtime lighting |
---|---|---|---|---|
Details | Low | Medium | Low | High |
Render speed | Fastest | Fast | Fastest | Slow |
Precomputation time | Short | Long | Medium | N/A |
RAM usage | Low | High | Low | Low |
Shadows | No | Yes | No | Yes |
Penumbra | N/A | Yes | N/A | Partial |
Number of lights | Large | Large | Large | Small |
Surface-based effects | ||||
Bumpmapping | Yes | Yes | Yes | Yes |
Specular | Yes | Yes | Yes | Yes |
Cubemap filters | No | Partial | No | Yes |
Per-light diffuse/ambient/specular scale | No | No | No | Yes |
Non-point 'area' lights | Yes | Yes | Yes | No |
Light styles | No | No | No | Yes |
Moving lights | No | No | No | Yes |
Global illumination | ||||
Precompulation time | Long | Very long | Long | N/A |
Rendering speed | N/A | N/A | N/A | Slow |
Quality | High | High | High | Low |
Used to light | ||||
Map surfaces | Yes | Yes | No | Yes |
Static BModels | Yes | Yes | Optional | Yes |
Moving/rotating BModels | No | No | Optional | Yes |
Animated models | No | No | Yes | Yes |
Console variables







