Skip to content

UnlitMaterial

Unlit material rendered without lighting.

Renders surfaces using a uniform color or texture without applying any illumination or shading. Useful for UI elements, overlays, debug geometry, or stylized effects where lighting is not desired. Transparency is supported through the alpha channel of the texture or a separate alpha map.

cpp
auto material = vglx::UnlitMaterial::Create(0xFFFFFF);
material->texture_map = texture;

my_scene->Add(vglx::Mesh::Create(geometry, material));

INFO

Derives from Material and inherits all public properties and methods.

Construction

Constructors


UnlitMaterial()

Constructs an unlit material.

cpp
UnlitMaterial::UnlitMaterial(const Color& color);
ParameterDescription
color

Factories preferred


UnlitMaterial::Create() std::shared_ptr<UnlitMaterial>

Creates a shared instance of UnlitMaterial.

cpp
static std::shared_ptr<UnlitMaterial> UnlitMaterial::Create(const Color& color=0xFFFFFF);
ParameterDescription
color

Properties

alpha_map std::shared_ptr<Texture>

Alpha-only texture providing per-pixel opacity.

cpp
std::shared_ptr<Texture> alpha_map {nullptr};

color Color

Base color applied to the surface.

cpp
Color color {0xFFFFFF};

texture_map std::shared_ptr<Texture>

Color texture sampled for rendering; alpha channel controls transparency.

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

Functions

GetType() Type virtual

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

cpp
Type UnlitMaterial::GetType() const override;

Released under the MIT License.