Lightmap Diffuse
Manual     Reference     Scripting   
Reference Manual > Built-in Shader Guide > Lightmapped Shader Family > Lightmap Diffuse

This document is unofficially translated by users.Please see the original document here.

Please send e-mail to here, when you have any question about the translation.

Lightmap Diffuse

Lightmapped Properties

This shader is a complex version of a Self-Illuminated shader. It uses a secondary Lightmap texture that defines light "emitted" from the object onto itself (and nothing else). The Lightmap's RGB values define the color of light, and its alpha channel can be used to control glow. The Lightmap texture also uses the secondary UV map of the mesh for controlling the placement of light, which can differ from the primary UV map. This shader allows you to use baked colored light, radiosity with color bleeding and other funky effects.

This shader is handy when your Base texture and/or Bumpmap are tiled across your object multiple times and its Self-Illumination can't be tiled along with them. Most 3D modeling applications have tools to "bake" lighting into a texture and/or automatically compute a suitable lighting UV map. However, not all 3D modeling applications can export a secondary UV map properly.

Any scene lights will add illumination on top of the object's illumination. So if you have a Lightmapped level with baked lighting, and a rocket with point light flying, it will just add lighting - i.e. it just works.

Diffuse Properties

This shader is a Pixel-Lit shader, which is more expensive than Vertex-Lit. Pixel lighting is expensive mostly because each object has to be drawn multiple times for each pixel light that shines on it. Vertex lights don't affect the shader in this way. Pixel lights support cookies, bumpmapping, and shadows while vertex lights do not. Pixel lights are also much less sensitive to tesselation of the models - if you have a cube using this shader, you can put point light very close to its surface and it will have nice round highlight. This effect cannot be achieved with Vertex lighting.

Diffuse computes a simple (Lambertian) lighting model. The lighting on the surface decreases as the angle between it and the light decreases. The lighting depends only on the this angle, and does not change as the camera moves or rotates around.


Generally, this shader is pretty cheap to render. For more details, please view the Shader Peformance page.