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({
  .color = 0xFFFFFF,
  .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 with default parameters.

cpp
UnlitMaterial::UnlitMaterial();

UnlitMaterial()

Constructs an unlit material from the given parameters.

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

Factories preferred


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

Creates a shared instance of UnlitMaterial with default parameters.

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

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

Creates a shared instance of UnlitMaterial.

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

Types

UnlitMaterial::Parameters struct

Parameters for constructing an UnlitMaterial object.

ParameterDescription
color ColorBase surface color.
texture_map std::shared_ptr<Texture>Surface color texture.
alpha_map std::shared_ptr<Texture>Per-pixel opacity map.

Properties

alpha_map std::shared_ptr<Texture>

Alpha-only texture providing per-pixel opacity.

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

color Color

Base color applied to the surface.

cpp
Color color {};

texture_map std::shared_ptr<Texture>

Color texture sampled for rendering; alpha channel controls transparency.

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

Functions

GetType() Type virtual

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

cpp
Type UnlitMaterial::GetType() const override;

Released under the MIT License.