Skip to content

ludus::graphics::renderer::LitMaterialDescription

Ludus Wiki · API overview · Browse API

Struct

Immutable unlit base schema plus the L4 metallic/roughness lighting terms.

Declared in modules/graphics/renderer/include/ludus/graphics/renderer/lighting.hpp

#include <ludus/graphics/renderer/lighting.hpp>
struct ludus::graphics::renderer::LitMaterialDescription final

Fields

Surface

MaterialDescription ludus::graphics::renderer::LitMaterialDescription::Surface {}
Base texture, tint, alpha and sampler retain the L3 contracts.

Related types: MaterialDescription

Declared in modules/graphics/renderer/include/ludus/graphics/renderer/lighting.hpp

Metallic

ludus::foundation::float32 ludus::graphics::renderer::LitMaterialDescription::Metallic = 0
Legacy metallic fraction in [0,1]; ignored by typed diffuse/conductor reference evaluation.

Related types: ludus::foundation::float32

Declared in modules/graphics/renderer/include/ludus/graphics/renderer/lighting.hpp

Roughness

ludus::foundation::float32 ludus::graphics::renderer::LitMaterialDescription::Roughness = 0.5F
Legacy/raster perceptual roughness in [0.045,1]; typed conductor/coating reference uses Scattering alpha.

Related types: ludus::foundation::float32

Declared in modules/graphics/renderer/include/ludus/graphics/renderer/lighting.hpp

SurfaceMap

rhi::TextureHandle ludus::graphics::renderer::LitMaterialDescription::SurfaceMap {}
Optional ready sampled Rgba8Unorm surface map: RG encodes tangent normal XY as 2*channel-1; positive Z is reconstructed. B multiplies perceptual roughness (floored at 0.045), A multiplies metallic. Typed conductor/coating reference keeps its constant Scattering alpha and ignores these two multipliers; normal mapping still applies. It shares Surface UV/sampler/LOD. Requires renderer_surface.slang or renderer_clustered_surface.slang; other programs return Unsupported. Null preserves the constant surface model. Creation retains the exact view; the caller may destroy its texture owner. Reference captures require retained CPU bytes for the selected capture mip.

Related types: rhi::TextureHandle

Declared in modules/graphics/renderer/include/ludus/graphics/renderer/lighting.hpp

NormalScale

ludus::foundation::float32 ludus::graphics::renderer::LitMaterialDescription::NormalScale = 1
Tangent normal XY strength [0,8]; zero disables perturbation, preserving roughness/metallic sampling. Degenerate UV frames preserve the mesh normal.

Related types: ludus::foundation::float32

Declared in modules/graphics/renderer/include/ludus/graphics/renderer/lighting.hpp

AreAuthoredInputsEnabled

bool ludus::graphics::renderer::LitMaterialDescription::AreAuthoredInputsEnabled = false
Opt-in authored tangent/color/UV profile; requires an authored shader recipe. False preserves legacy geometry semantics. Authored normals are not regenerated.

Declared in modules/graphics/renderer/include/ludus/graphics/renderer/lighting.hpp

MaterialUvSet

ludus::foundation::uint32 ludus::graphics::renderer::LitMaterialDescription::MaterialUvSet = 0
Base/surface-map material UV channel, 0 or 1. Both maps share the transform. UV1 requires AreAuthoredInputsEnabled; independently transformed maps must be cooked.

Related types: ludus::foundation::uint32

Declared in modules/graphics/renderer/include/ludus/graphics/renderer/lighting.hpp

EnvironmentOrNull

const EnvironmentMap* ludus::graphics::renderer::LitMaterialDescription::EnvironmentOrNull = nullptr
Optional ready HDR map on the same device, retained during creation. Requires an authored recipe. Its SH/prefiltered specular replace the constant environment terms; baked diffuse still takes precedence. Null uses constants.

Related types: EnvironmentMap

Declared in modules/graphics/renderer/include/ludus/graphics/renderer/lighting.hpp

Emission

ludus::foundation::math::Vector3 ludus::graphics::renderer::LitMaterialDescription::Emission {}
Linear surface emission in [0,10000]; does not create a scene light.

Related types: ludus::foundation::math::Vector3

Declared in modules/graphics/renderer/include/ludus/graphics/renderer/lighting.hpp

IsEmissionTwoSided

bool ludus::graphics::renderer::LitMaterialDescription::IsEmissionTwoSided = true
Legacy default is two-sided emission. False emits only from front-facing geometry; reference transport evaluates the triangle's geometric winding.

Declared in modules/graphics/renderer/include/ludus/graphics/renderer/lighting.hpp

EmissionMap

rhi::TextureHandle ludus::graphics::renderer::LitMaterialDescription::EmissionMap {}
Optional ready RGBA8 linear/sRGB RGB multiplier for Emission; alpha ignored. Authored recipes only. Shares the selected material UV transform and sampler. Creation retains its exact view; reference requires CPU bytes at TextureMip.

Related types: rhi::TextureHandle

Declared in modules/graphics/renderer/include/ludus/graphics/renderer/lighting.hpp

EnvironmentIrradiance

ludus::foundation::math::Vector3 ludus::graphics::renderer::LitMaterialDescription::EnvironmentIrradiance {}
Constant diffuse irradiance in [0,10000], used when a baked chart is absent/invalid.

Related types: ludus::foundation::math::Vector3

Declared in modules/graphics/renderer/include/ludus/graphics/renderer/lighting.hpp

EnvironmentGroundScale

ludus::foundation::float32 ludus::graphics::renderer::LitMaterialDescription::EnvironmentGroundScale = 1
Hemispheric variation of the constant EnvironmentIrradiance in [0,1]: it is the irradiance of a surface facing +Y (the sky), and a surface facing -Y receives that much times this scale, blended by the normal's Y. One keeps the irradiance constant, as before. Ignored when baked or authored irradiance applies.

Related types: ludus::foundation::float32

Declared in modules/graphics/renderer/include/ludus/graphics/renderer/lighting.hpp

EnvironmentRadiance

ludus::foundation::math::Vector3 ludus::graphics::renderer::LitMaterialDescription::EnvironmentRadiance {}
Constant filtered environment radiance in [0,10000]; single-scatter Fresnel approximation.

Related types: ludus::foundation::math::Vector3

Declared in modules/graphics/renderer/include/ludus/graphics/renderer/lighting.hpp

Lights

const DirectLight* ludus::graphics::renderer::LitMaterialDescription::Lights = nullptr
Borrowed list, validated and copied before CreateLitMaterial returns.

Related types: DirectLight

Declared in modules/graphics/renderer/include/ludus/graphics/renderer/lighting.hpp

LightCount

ludus::foundation::usize ludus::graphics::renderer::LitMaterialDescription::LightCount = 0
At most 128 input lights; L4 retains eight, L5 clusters retain all.

Related types: ludus::foundation::usize

Declared in modules/graphics/renderer/include/ludus/graphics/renderer/lighting.hpp

Bake

BakedLighting ludus::graphics::renderer::LitMaterialDescription::Bake {}
Optional immutable bake chart/version with explicit direct-light replacement.

Related types: BakedLighting

Declared in modules/graphics/renderer/include/ludus/graphics/renderer/lighting.hpp

Clusters

const LightClusterDescription* ludus::graphics::renderer::LitMaterialDescription::Clusters = nullptr
Optional L5 assignment profile; requires a clustered shader program. Copied during creation. Null retains the L4 eight-light selection. Lights/LightCount supply either profile.

Related types: LightClusterDescription

Declared in modules/graphics/renderer/include/ludus/graphics/renderer/lighting.hpp

Shadows

ShadowAtlas ludus::graphics::renderer::LitMaterialDescription::Shadows {}
Ready rendered atlas; null supplies unshadowed direct lighting.

Related types: ShadowAtlas

Declared in modules/graphics/renderer/include/ludus/graphics/renderer/lighting.hpp

DebugView

MaterialDebugView ludus::graphics::renderer::LitMaterialDescription::DebugView = MaterialDebugView::None
Diagnostic output for debug-view programs; ignored by ordinary lit programs. Values outside the enumeration are rejected.

Related types: MaterialDebugView

Declared in modules/graphics/renderer/include/ludus/graphics/renderer/lighting.hpp

Scattering

content::scene_format::MaterialScattering ludus::graphics::renderer::LitMaterialDescription::Scattering {}
Typed optical parameters; default preserves the legacy metallic/roughness model.

Related types: content::scene_format::MaterialScattering

Declared in modules/graphics/renderer/include/ludus/graphics/renderer/lighting.hpp