Skip to content

UnlitMaterial

Represents a material for surfaces that are not affected by lights.

This material is used to render objects with uniform color or texture, without any lighting calculations. It is ideal for UI elements, 2D overlays, or wireframes where shading is not desired.

cpp
auto material = vglx::UnlitMaterial::Create(0x049EF4);
material->albedo_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()

cpp
vglx::UnlitMaterial::UnlitMaterial(const Color &color)
ParameterDescription
colorColor of the material.

Constructs a UnlitMaterial object.

Factories preferred


UnlitMaterial::Create() auto

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

Creates a shared pointer to a UnlitMaterial object.

Properties

albedo_map std::shared_ptr<Texture2D>

cpp
std::shared_ptr<Texture2D> albedo_map { nullptr }

Albedo (base color) map, optionally containing an alpha channel.

alpha_map std::shared_ptr<Texture2D>

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

Alpha map that controls the opacity across the surface.

color Color

cpp
Color color { 0xFFFFFF }

Color of the material.

Functions

GetType() MaterialType virtual

cpp
MaterialType vglx::UnlitMaterial::GetType() const override

Returns material type.

Released under the MIT License.