pub enum MaterialKind {
Lambert,
Phong,
Pbr,
}Expand description
Describes the shading model applied to a Material during lighting and
ray-tracing evaluation.
Variants§
Lambert
Pure Lambertian diffuse, no specular highlight.
LightingUniforms::shade evaluates the diffuse term only.
Phong
Lambertian diffuse plus Blinn-Phong style specular highlight.
LightingUniforms::shade evaluates the diffuse term plus a specular
lobe driven by the material’s specular and shininess fields.
Pbr
Diffuse with a Schlick fresnel rim, and no separate specular lobe.
§This is not a full PBR model
A physically based renderer would evaluate a microfacet BRDF with
roughness-driven geometry, a metallic / dielectric split, multiple
scattering, and per-channel Fresnel. None of that is implemented here.
What this variant actually does is scale the Lambertian diffuse term
by apply_schlick_fresnel, which brightens grazing angles and adds
a rim. That is a deliberate, documented approximation rather than
the physically based model the variant name suggests.
The variant is kept rather than removed so callers can branch on
material model without a breaking change when a real BRDF lands. Note
that specular and shininess are ignored on this path: the diffuse
fresnel blend replaces them entirely.