lightmap
LightMap
Lightmap of an entity, generated through the map compiler, accessible through the LightMap variable in shader code.
Type:
BMAP* (lite-c)
texture (shader code)
Remarks:
- Currently only terrain entities receive individual lightmaps when Terrain Lighting is checked on map compiling. The lightmaps of level blocks are not accessible through this variable, but through the second skin texture
(entSkin2)
of the block.
-
If this pointer is not used for a lightmap, a BMAP* can be assigned for an additional, individual shader texture.
Edition:
A7.76 C
LC
Example:
//////////////////////////////////////////////////////////////////////
// terraintex.fx
// Terrain material for an unlimited number of terrain textures
// Tiled texture on RGB, mask on alpha
Texture entSkin1; // basic tiled terrain texture, plus alpha mask
Texture LightMap; // lightmap created by the map compiler
bool PASS_SOLID; // enforce rendering on the solid pass
technique terraintex
{
pass multi_repeat11
{
ZWriteEnable = True;
AlphaBlendEnable = True;
SrcBlend = SrcAlpha;
DestBlend = InvSrcAlpha;
Texture[0] = <entSkin1>; // stage 0 - alpha mask
TexCoordIndex[0] = 0;
AlphaArg1[0] = Texture;
AlphaOp[0] = SelectArg1;
Texture[1] = <LightMap>; // stage 1 - lightmap + diffuse
TexCoordIndex[1] = 0;
ColorArg1[1] = Texture;
ColorArg2[1]= Diffuse;
ColorOp[1] = AddSigned;
AlphaArg1[1] = Current;
AlphaOp[1] = SelectArg1;
Texture[2] = <entSkin1>; // stage 2 - tiled texture
TexCoordIndex[2] = 1;
ColorArg1[2] = Texture;
ColorArg2[2]= Current;
ColorOp[2] = Modulate2x;
AlphaArg1[2] = Current;
AlphaOp[2] = SelectArg1;
ColorOp[3] = Disable;
AlphaOp[3] = Disable;
}
}
See also:
BMAP, render_target,
entSkin1
► latest
version online