SpriteMaterial
[SpriteMaterial](/reference/materials/sprite_material)
is a lightweight material optimized for rendering camera-facing quads such as UI elements, particles, or font glyphs. It supports a solid color, an optional albedo map, and an optional alpha map for per-pixel transparency.
Unlike physically-based or Phong materials, [SpriteMaterial](/reference/materials/sprite_material)
is rendered without lighting by default, making it efficient for 2D overlays and screen-space elements.
auto material = vglx::SpriteMaterial::Create(0xFFFFFF);
material->albedo_map = texture;
auto sprite = vglx::Sprite::Create(material);
scene->Add(sprite);
INFO
Derives from Material and inherits all public properties and methods.
Construction
Constructors
SpriteMaterial()
vglx::SpriteMaterial::SpriteMaterial(const Color &color)
Parameter | Description |
---|---|
color | Color of the material. |
Constructs a SpriteMaterial object.
Factories preferred
SpriteMaterial::Create() auto
static auto vglx::SpriteMaterial::Create(const Color &color=0xFFFFFF)
Parameter | Description |
---|---|
color | Color of the material. |
Creates a shared pointer to a SpriteMaterial object.
Properties
Albedo (base color) map, optionally containing an alpha channel.
Alpha map that controls the opacity across the surface.
Functions
GetType() MaterialType virtual
MaterialType vglx::SpriteMaterial::GetType() const override
Returns material type.