Lighting Architecture

There are several lighting methods in Awakening:


Light map is pre-compute lighting info that store in images. Light has
Baked style will take part in computing.


Dynamic lightmap    (r_dynamiclightmap , r_dynamiclightmap_range)

If light has
Dynamic Lightmap style, and the console variable r_dynamiclightmap is not zero,  light will dynamic illuminate ( or darker for  reverse style ) lightmap ( only affect surface & terrain that without bump style, and only supports A8R8G8B8 lightmap format currently ).


Static Pixel Lighting

Light without dynamic style will take part in Static Pixel Lighting. Every 3d object at most supports two lights for Static Pixel Lighting. For example, in above picture, only red & green spot light illuminate the right wall, the left red spot light is invalid for it. Static Pixel Lighting is more efficient than Dynamic Pixel Lighting.


Dynamic Pixel Lighting (r_dynamiclighting, r_terrain_dynamic_lights)

Light has dynamic style will take part in Dynamic Pixel Lighting. When rendering, first draw Static Pixel Lighting by one pass, then blend Dynamic Pixel Lighting by multi-pass, and at most draw 8 dynamic lights near camera. Dynamic light can use  Dynamic Shadow style, at most supports 4 lights dynamic shadow.
 The console variable
r_dynamiclighting control Dynamic Pixel Lighting on/off. And r_terrain_dynamic_lights control terrain's Dynamic Pixel Lighting on/off. Terrain's Dynamic Pixel Lighting is a bit inefficient, so turn off it when no need.


You need check object's bump style for Static Pixel Lighting & Dynamic Pixel Lighting.