Shader Billboard (Legacy)
- Last UpdatedApr 02, 2025
- 3 minute read
The Billboard shader has the following characteristics.
-
Billboard
-
Vertex Colored
-
Textured
Explanation
-
Rotates the polygons so that they are always facing the camera.
-
Multiplies the texture for the vertex color.
Code example
This is a code example for Billboard shader.
$Shader
{
szName = Billboard
szBillboardType = YAxis
}
Notes
-
The geometry must point towards the Z axis. In 3DSMax, it is the Y-axis.
-
The rotation matrix of the mesh must be identified or not contain rotations.
-
The geometry is always exported automatically by the engine in Object Space. This involves different limits on how these meshes can be linked to other objects.
-
To link these meshes to other objects such as mesh, dummy, lights (but not groups), you must do two exports:
-
World Space Export: Parent objects are in (0,0,0) (rotations and translations).
-
Object Space Export: Objects can be moved anywhere, but do not contain rotations.
-
-
If you want to link these meshes to groups you have to export everything to World Space.
-
However, it is not possible to link a billboard mesh to more than one object.
Input Data
Vertex Color
-
If there is a valid Radiosity solution on this object, the vertex color is taken from the solution.
-
If a Radiosity solution is not present or invalid, or if the bWireframe parameter is active, the vertex color is taken from the properties of the mesh. Therefore, the vertex color will be the color of the mesh.
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.
Parameters
szBillboardType
-
Billboard type, must be one of these values:
-
Screen: Screen aligned, always remains aligned to the screen.
-
YAxis: Y Axis aligned, always remains aligned with the camera except on the Y axis.
-
YAxisViewpoint: Y Axis viewpoint aligned. Similar to YAxis; however, when looking at "bias" the polygon remains slightly rotated instead of always remaining flat with respect to the camera.
-
fViewpointOffset
-
Moves the viewpoint position during the calculation of the YAxisViewpoint Billboard matrix.
-
The offset is calculated on the camera's direction, so a positive value will move it in front of the camera.
-
Valid only for YAxisViewpoint type billboards.
-
Default: 0.0
-
Range: [-inf..inf]
fTransparency
-
Transparency level of the mesh.
-
Default: 0.0
-
Range: [0..1] (1 = completely transparent)
szAnimatedTexture
-
Indicates that the texture will be animated using the specified Animated Texture ID.
-
Default: Null.
iClipMap
-
The pixel is drawn only when the value of the texture alpha channel is greater than iClipMap.
-
If (alpha> iClipMap) ® render_pixel
-
iClipMap, bAlphaTransparency, bSolidAlphaTransparency can not exist at the same time.
-
The clipmap is not active in the case of reflective material
-
Default: -1
-
Valid values: -1, [0..255] (-1 = clipmap disabled)
bAlphaTransparency
-
Activates alpha transparency by pixel. The value of the alpha channel of the texture indicates the opacity of the pixel.
-
A pixel value of 0 indicates total transparency; a value of 1 indicates total opacity.
-
bAlphaTransparency and bSolidAlphaTransparency can not exist simultaneously.
-
Default: False.
-
Range: True / False.