Shader LiquidLevelFoam_Em_Bm_Rfr_Ci +Animated UV (Legacy)
- Last UpdatedApr 02, 2025
- 3 minute read
The LiquidLevel_Em_Bm_Rfr_Ci shader has the following characteristics.
|
LiquidLevelFoam |
LiquidLevel FoamTexture |
|
Em |
Environment Mapped |
|
Bm |
BumpMapped |
|
Rfr |
Refracted |
|
Ci |
Color Interpolated + Animated UV (Bump texture channel, Foam texture channel) |
Explanation
-
RefrCol is the result of interpolation between the refraction and the c3Color color parameter.
-
During interpolation, if the value fInterpolator is close to 0, the refraction is used; if it is close to 1, the color parameter c3Color is used.
-
Color1 = Mixes RefrCol and the env map based on the Fresnel value.
-
ColorFinal = Mixes Color1 and the env map based on the brightness of the pixel taken from szWhitesCubeMap.
-
Output = Mixes ColorFinal and Foam Texture based on its value of alpha.
-
-
The reflection vector used to access the env map is disturbed by the BumpMap.
-
The UV used to access the refraction are disturbed by the BumpMap.
Code example
This is a code example for LiquidLevelFoam_Em_Bm_Rfr_Ci _Animated UV shader.
$Shader
{
szName = LiquidLevelFoam_Em_Bm_Rfr_Ci
szCubeMap = EnvCube.dds
szWhitesCubeMap = CubeMapWhites.dds
fRefractionBumpiness = 0.05
fReflectionBumpiness = 0.4
fFresnelExponent = 4
fRefractionIndex = 1.333
fInterpolator = 0.3
c3Color = 0.4 0.4 0.0
v2AnimatedUVDir = 1 0
fAnimatedUVTimeScale = 0.5
fFoamAnimatedUVMul = 0.2
fFoamBumpiness = 0.18
fEmissiveMul = 1
}
Input Data
Texture
-
Material ® DiffuseMap
-
UV Channel 1
-
Used as Foam Texture.
-
Alpha Channel used to blend the Foam Texture.
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.
szRealTimeCubeMap / szCubeMap
-
szRealTimeCubeMap: ID of the CubeMap that will be created in real time using a $CubeMap Dummy Object.
-
szCubeMap: The name of the texture that will be loaded and used as CubeMap.
-
szRealTimeCubeMap and szCubeMap can not exist at the same time.
szWhitesCubeMap
-
szWhitesCubeMap: The name of the texture that will be loaded and used as CubeMap to detect the brightness of the pixel.
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]
fRefractionBumpiness
-
The displacement value of the refraction. This is used when taking the pixel of refraction. Even a small value can be enough.
-
Default: 0.2
-
Range: [0..1] (1 = fully bumped)
fReflectionBumpiness
-
Amount of disturbance that the BumpMap will give to the normals of the object. This is used when taking the pixel of reflection.
-
Default: 0.5
-
Range: [0..1] (1 = fully bumped)
fFresnelExponent
-
Exponent used in the calculation of the fresnel value. It is used for power upgrading.
-
Default: 5
-
Range: [0..inf]
fInterpolator
-
Interpolation value.
-
Default: 0.5
-
Range: [0..1]
c3Color
-
Color that will be multiplied.
-
Default: 1 1 1
-
RGB: [0..1]
fRefractionIndex
-
Index of refraction of the material.
-
Default: 1.5
-
Range: [0..inf]
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]
v2AnimatedUVDir
-
The direction of the Animate UV.
-
This value can be normalized or not. If normalized, it scales the speed of the animation.
-
Default = 0 0 (disabled animation).
-
Range [-inf..inf].
fAnimatedUVTimeScale
-
Manages the speed of movement of the UV.
-
Default: 0 (1 = same application speed, 0 = disable animation)
-
Range: [-inf..inf]
fFoamAnimatedUVMul
-
Manages the speed of movement of the UV Foam Texture (related to the global movement of AnimatedUV).
-
This value is multiplied by the base UV movement defined by v2AnimatedUVDir and fAnimatedUVTimeScale.
-
Default: 1 (1 = same speed as AnimatedUV, 0 = disable animation).
-
Range: [-inf..inf].
fFoamBumpiness
-
"Phasing" value of Foam Texture. Even a very small value can be enough.
-
Default: 0
-
Range: [-inf..inf]