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;

auto mesh = vglx::Mesh::Create(geometry, material);
scene->Add(mesh);

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
colorBase color of the material.

Factories preferred


UnlitMaterial::Create() auto

Creates a shared instance of UnlitMaterial.

cpp
static auto UnlitMaterial::Create(const Color& color=0xFFFFFF);
ParameterDescription
colorBase color of the material.

Properties

alpha_map std::shared_ptr<Texture2D>

Alpha-only texture providing per-pixel opacity.

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

color Color

Base color applied to the surface.

cpp
Color color {0xFFFFFF};

texture_map std::shared_ptr<Texture2D>

Color texture sampled for rendering; alpha channel controls transparency.

cpp
std::shared_ptr<Texture2D> 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.