Skip to content

Engine → Renderer

material_asset.h

The one PBR material model: glTF metallic-roughness with glTF defaults. Texture presence, double-sidedness, unlit and the UV set are uniform-driven; the alpha mode is pipeline state. The cooked form (.cmat) is JSON with texture uuids.

Structs

File Description
material_desc

Classes

File Description
material_asset
material_importer The .cmat importer: validates the JSON and cooks it canonically; texture uuids become dependencies.
material_loader The conjure.renderer.material loader; the fallback is the magenta material.

Enumerations

alpha_mode

enum class alpha_mode : u8 {
    SOLID = 0,
    MASK,
    BLEND
};

glTF alpha modes. SOLID is glTF's OPAQUE (a Windows macro name).

material_texture

enum class material_texture : u8 {
    BASE_COLOUR = 0,
    METALLIC_ROUGHNESS,
    NORMAL,
    OCCLUSION,
    EMISSIVE
};

Texture slots of a material, in binding order (t0..t4 of register space 1).

Constants

Name Type Value Description
MATERIAL_ASSET_TYPE_NAME inline constexpr std::string_view "conjure.renderer.material"
MATERIAL_EXTENSIONS inline constexpr std::array<std::string_view, 1> {".cmat"}
MATERIAL_IMPORTER_ID inline constexpr std::string_view "conjure.renderer.material"
MATERIAL_IMPORTER_VERSION inline constexpr u32 1

Macros

CONJURE_DECLARE_ASSET_TYPE

CONJURE_DECLARE_ASSET_TYPE(conjure::renderer::material_asset, "conjure.renderer.material")

Functions

Public

to_string

[[nodiscard]] CONJURE_API std::string_view to_string(
    alpha_mode value) noexcept;
[[nodiscard]] CONJURE_API std::string_view to_string(
    material_texture slot) noexcept;