Skip to content

02. Billboards

Oleksandr Zakusylo edited this page Jun 29, 2024 · 1 revision

Billboards are quads which normals are always facing the camera.

In order to render a billboard, add Billboard functional declaration into your Frame context, which applies a built-in billboard shader:

Billboard (
    standardUniforms {
        xscale = 2.0f
        yscale = 2.0f
        colorTexture = texture("/sprite.png")
    },
    position = Vec3(1.0f, 1.0f, 0.0f),
    transparent = true
)

Billboard shader supports the following uniforms (in addition to standart shader uniforms):

Uniform name Type Default value Description
xscale Float 1.0f Horizontal scale
yscale Float 1.0f Vertical scale
rotation Float 0.0f Rotation (in radians)
Clone this wiki locally