Editing Darkplaces lighting/Introduction
Warning: You are not logged in.
Your IP address will be recorded in this page's edit history.The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 3: | Line 3: | ||
==What is a light== | ==What is a light== | ||
− | In Darkplaces engine, light is entity that engine or compiler use to illuminate objects around. Light's entity keys are options. There is three type of light sources: '''static''', '''dynamic''' and '''fake'''. | + | In Darkplaces engine, light is entity that engine or compiler use to illuminate objects around it. Light's entity keys are options. There is three type of light sources: '''static''', '''dynamic''' and '''fake'''. |
===Static lightsources=== | ===Static lightsources=== | ||
Line 27: | Line 27: | ||
Darkplaces lighting is not unified. It combines several techniques in order to get best performance and visual quality. There is no need to light up whole level with hi-quality realtime lighting, as it will take too much CPU and GPU time. Small objects should receive a grude and fast lighting, while important objects should have best quality. To reach this goal, Darkplaces lighting have two parts - static lighting and dynamic lighting. | Darkplaces lighting is not unified. It combines several techniques in order to get best performance and visual quality. There is no need to light up whole level with hi-quality realtime lighting, as it will take too much CPU and GPU time. Small objects should receive a grude and fast lighting, while important objects should have best quality. To reach this goal, Darkplaces lighting have two parts - static lighting and dynamic lighting. | ||
− | For static lighting illumination data is generated when map is being compiled. All objects that is not moving, rotating, animating, transforming in any way, by default, should be illuminated with static lighting. Also any light that is not moving, switching, animating, should be static | + | For static lighting illumination data is generated when map is being compiled. All objects that is not moving, rotating, animating, transforming in any way, by default, should be illuminated with static lighting. Also any light that is not moving, switching, animating, should be static to. The trick is that both of previous rules should be used synchronously. If there is some dynamic object with many static objects, and it cannot be lit well with static lighting, should make all scene illuminated with dynamic light. |
Map compiler (for Blood Omnicide it is [[Q3Map2]]) is a tool that generates static lighting data. It is a full featured raytracer able to render non-point sources, area sources, spot lights, alpha shadows, can store light vectors in deluxemaps (in order to get normalmapping and specular working for lightmapped surfaces) etc. All this features makes static lighting to look same as dynamic, but render alot faster. There is 3 techniques available: | Map compiler (for Blood Omnicide it is [[Q3Map2]]) is a tool that generates static lighting data. It is a full featured raytracer able to render non-point sources, area sources, spot lights, alpha shadows, can store light vectors in deluxemaps (in order to get normalmapping and specular working for lightmapped surfaces) etc. All this features makes static lighting to look same as dynamic, but render alot faster. There is 3 techniques available: | ||
Line 36: | Line 36: | ||
Dynamic lighting comes from dynamic lightsources and can illuminate objects that is moving, rotating, animating, transforming in any way. It is very flexible and time consuming as it get computed in realtime, each frame. At other features like simulation of non-point sources, spotlights is less efficient with dynamic lighting because of limited computation time (it should be less than several milliseconds). | Dynamic lighting comes from dynamic lightsources and can illuminate objects that is moving, rotating, animating, transforming in any way. It is very flexible and time consuming as it get computed in realtime, each frame. At other features like simulation of non-point sources, spotlights is less efficient with dynamic lighting because of limited computation time (it should be less than several milliseconds). | ||
− | Here is the table showing features | + | Here is the table showing features if different techniques: |
{| width=500 cellspacing=0 cellpadding=2 border=1 style="border-collapse:collapse" | {| width=500 cellspacing=0 cellpadding=2 border=1 style="border-collapse:collapse" | ||
! width=40% rowspan=2 | Task | ! width=40% rowspan=2 | Task | ||
Line 46: | Line 46: | ||
! width=15% | Lightgrid | ! width=15% | Lightgrid | ||
|- | |- | ||
− | | colspan=5 align=center | Features (1 - bad, 2 - average, 3 - good, 4 - very good | + | | colspan=5 align=center | ''Features (1 - bad, 2 - average, 3 - good, 4 - very good''' |
|- | |- | ||
| Details | | Details | ||
Line 84: | Line 84: | ||
| align=center | <font color=red>'''1'''</font> | | align=center | <font color=red>'''1'''</font> | ||
|- | |- | ||
− | | colspan=5 align=center | Surface-based effects (+ : Supported, - : Not supported) | + | | colspan=5 align=center | '''Surface-based effects (+ : Supported, - : Not supported)''' |
|- | |- | ||
| Bumpmapping | | Bumpmapping | ||
Line 122: | Line 122: | ||
| align=center | <font color=green>'''+'''</font> | | align=center | <font color=green>'''+'''</font> | ||
|- | |- | ||
− | | colspan=5 align=center | Used to illuminate | + | | colspan=5 align=center | '''Used to illuminate''' |
|- | |- | ||
| Map surfaces | | Map surfaces | ||
Line 134: | Line 134: | ||
| align=center | <font color=green>'''+'''</font> | | align=center | <font color=green>'''+'''</font> | ||
| align=center | <font color=green>'''+'''</font> | | align=center | <font color=green>'''+'''</font> | ||
− | | align=center | <font color=green>''' | + | | align=center | <font color=green>'''-'''</font> |
|- | |- | ||
| Moving/rotating BModels | | Moving/rotating BModels |