Shader Txt_Lm_Lc_Bm_Sp (Legacy)
- Last UpdatedApr 02, 2025
- 3 minute read
The Txt_Lm_Lc_Bm_Sp shader has the following characteristics.
|
Txt |
Textured |
|
Lm Lc |
Light Mapped with Lightmap Color Contribution |
|
Bm |
Bump Mapped |
|
Sp |
Specular |
Explanation
-
This shader makes a linear interpolation between [Texture * Lightmap, Lightmap].
-
The value of the interpolation is given by the product of the alpha channel value of the lightmap for the fAlphaMul parameter: interp = Lightmap.a * fAlphaMul
-
It multiplies the whole for the fBaseLitVal + N.L lighting according to the normal on the bump map, then adds the specular value.
-
In the case of reflection, it is "out of phase" following the normals of the NormalMap multiplied by fBumpiness.
-
The reflection value is multiplied by the value of the GlossMap.
-
It supports only one light, which is managed as omnidirectional without range.
Code example
This is an example of Txt_Lm_Lc_Bm_Sp shader.
$Shader
{
szName = Txt_Lm_Lc_Bm_Sp
fAlphaMul = 0.7
fBaseLitVal = 0.3
szLight = Omni001
}
Input Data
Texture
-
Material ® DiffuseMap
-
UV Channel 1
-
Alpha Channel. If the bAlphaTransparency or bSolidAlphaTransparency parameter is True, it impacts the pixel opacity.
-
Must contain the Gloss Map values in the Alpha channel. The Gloss value scales the intensity of the specular. If the Gloss Map value is zero, the pixel will not have specular.
-
The Gloss value is also used for reflectivity. A value of 1 indicates total reflection. This value is multiplied by fReflectivity.
Lightmap
-
Material ® AmbientMap
-
UV Channel 3
-
Alpha channel used to indicate the contribution of each pixel on the final pixel.
NormalMap / HeightMap
-
By default the texture is intended as NormalMap
-
Material ® BumpMap
-
UV Channel 1
-
To use a HeightMap, name the texture xxx_hm.xxx. This will be converted inside the engine into a NormalMap.
-
Dark colors indicate minimum height; clear colors indicate greater height.
-
The Alpha channel must contain Gloss Map values. The Gloss value enhances, or scales, specular intensity for pixels. If the gloss value is zero, the pixel will not have specular quality.
The Gloss value is also used for reflectivity. A value of 1 indicates total reflection. This value is multiplied by fReflectivity.
Specular Color
-
Material ® SpecularColor
Specular Intensity
-
Material ® SpecularHilights ® SpecularLevel
-
Increases the intensity and the size of the highlight.
Specular Glossiness
-
Material ® SpecularHilights ® Glossiness
-
Increasing this value increases the "shininess" of the object, so there will be a narrower highlight.
Parameters
bObjectSpace
-
Explicitly indicates whether this mesh will be exported to Object Space or World Space, regardless of export parameters.
-
If this parameter is not present, the export parameters will be used, otherwise they will be overridden by this value.
-
Default: The export parameters are used.
-
Range: True / False.
fTransparency
-
Transparency level of the mesh.
-
Default: 0.0
-
Range: [0..1] (1 = completely transparent)
bDoubleFace
-
Duplicate the faces by flipping the verse.
-
Default: False.
-
Range: True / False.
szAnimatedTexture
-
Indicates that the texture will be animated using the specified Animated Texture ID.
-
Default: Null.
szAnimatedLightmap
-
Indicates that the Lightmap will be animated using the specified Animated Texture ID.
-
Default: Null.
fAlphaMul
-
Lightmap alpha channel multiplier.
-
Default: 0.0
-
Range: [0..1]
fBaseLitVal
-
This value is the basic illumination that the pixel will have, before the real lighting is added.
This is necessary since a pixel could be hidden from the light and thus become black, and this is wrong since the pixel has already been illuminated previously and therefore should not be darkened.
-
Default: 0.4
Range: [0..1]
szLight
-
Name of the light that will illuminate the object. If not specified, the result will be unpredictable.
fHeightMapBumpiness
-
Bumpiness when the bump texture is a HeightMap.
-
If multiple objects share the same HeightMap, the value of fHeightMapBumpiness will be the value of the first object that will load the texture.
-
Default: 10.0
-
Range: [0..inf]
fReflectivity
Level of reflectance of the material.
-
Default: -1.0 (reflectance off)
-
Range: -1, [0..1] (1 = completely reflective)
szReflectionTexture
-
ID of the ReflectionTexture to use if the fReflectivity parameter is active.
-
Default: Null.
fBumpiness
-
Value of "phase shift" of the reflection.
-
A value of 0.15 may be sufficient.
-
Default: 0.0
-
Range: [0..1]