Skip to content

BillboardMaterial ​

Lightweight material for textured camera-facing billboards.

Designed for camera-facing quads such as UI elements, particles, and glyphs. Renders without lighting (unlit) and uses an RGBA texture with an optional tint color. Transparency is enabled by default and driven by the texture's alpha channel.

cpp
auto material = vglx::BillboardMaterial::Create({
  .color = 0xFFFFFFu,
  .texture_map = texture
});

my_scene->Add(vglx::Billboard::Create(material));

INFO

Derives from Material and inherits all public properties and methods.

Construction ​

Constructors ​


BillboardMaterial() ​

Constructs a billboard material from the given parameters.

Transparency is enabled by default and uses the alpha channel of the provided texture.

cpp
BillboardMaterial::BillboardMaterial(const Parameters& params);
ParameterDescription
paramsInitialization parameters.

Factories preferred ​


BillboardMaterial::Create() std::shared_ptr<BillboardMaterial> ​

Creates a shared instance of BillboardMaterial with default parameters.

cpp
static std::shared_ptr<BillboardMaterial> BillboardMaterial::Create();

BillboardMaterial::Create() std::shared_ptr<BillboardMaterial> ​

Creates a shared instance of BillboardMaterial.

cpp
static std::shared_ptr<BillboardMaterial> BillboardMaterial::Create(const Parameters& params);
ParameterDescription
paramsInitialization parameters.

Types ​

BillboardMaterial::Parameters struct ​

Parameters for constructing a BillboardMaterial object.

ParameterDescription
color ColorBase tint color applied to the texture.
texture_map std::shared_ptr<Texture>Billboard texture sampled for color and alpha.
size_attenuation boolAttenuate billboard size by distance in perspective.

Properties ​

color Color ​

Base tint color applied multiplicatively to the billboard texture.

cpp
Color color {};

size_attenuation bool ​

Controls whether billboard size is attenuated by distance in perspective.

cpp
bool size_attenuation {true};

texture_map std::shared_ptr<Texture> ​

Billboard texture sampled in RGBA; alpha controls transparency.

cpp
std::shared_ptr<Texture> texture_map {};

Functions ​

GetType() Type virtual ​

Identifies this material as Material::Type::BillboardMaterial.

cpp
Type BillboardMaterial::GetType() const override;

Released under the MIT License.