Shader Txt_Lm_Lc_Rfr (Legacy)
- Last UpdatedApr 02, 2025
- 3 minute read
The Txt_Lm_Lc_Rfr shader has the following characteristics.
|
Txt |
Textured |
|
Lm Lc |
Light Mapped with Lightmap Color Contribution |
|
Rfr |
ScreenRefraction |
Explanation
-
Makes a linear interpolation between Texture * Lightmap and 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
-
This value is then mixed with the refraction texture. It is calculated in real time and "out of phase" following the normals of the NormalMap multiplied by fBumpiness.
Code example
This is an example of Txt_Lm_Lc_Rfr shader.
$Shader
{
szName = Txt_Lm_Lc_Rfr
fAlphaMul = 0.7
fHeightMapBumpiness = 10.5
fRefractivity = 0.75
fBumpiness = 0.2
}
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.
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]
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]
fRefractivity
-
Level of refraction of the material.
-
Using a value of zero (0) does not disable the effect; the shader works the same way, so there is no performance gain.
-
Default: 1.0
Range: [0..1] (1 = completely reflective)
fBumpiness
-
Value of "phase shift" of the reflection.
-
A value of 0.15 may be sufficient.
-
Default: 0.0
-
Range: [0..1]
fTextureSize
-
The texture size used for refraction. This value is relative to the size of the back buffer.
-
Default: 1.0 (1 = identical size to the back buffer)
-
Range: [0..1]