PbrShader class final

pbr.frag: Cook-Torrance with GGX, height-correlated Smith and Schlick, following the BRDF the glTF specification describes.

Image-based lighting when the scene supplies an environment (frame_params.w carries the cube's level count, zero for none), the flat hemispheric ambient otherwise. Operation for operation with pbr.frag, because golden images compare the two.

Inheritance

Constructors

PbrShader()
pbr.frag, the engine's own stage: no hooks, not layered. builtinCpuShaders files it under Pbr, PbrOpaque and their twins.
const
PbrShader.hooked(PbrHooks hooks)
pbr.frag with a material's injection points — version 4 of the material language, lighting standard; — filled by hooks.
const
PbrShader.layered()
pbr_layered.frag: the same stage with F3D_LAYERED — M1.
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
hooks → PbrHooks?
The injection points a material lit by this model fills, or null for the engine's own stage.
final
layered → bool
Whether this is the layered stage, which reads LayerInfo and the coat map. Plain metal-rough takes none of the branches it guards, so the thirty golden images of that stage see what they always saw.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
run(Float32List v, ShaderBindings b, FragmentContext c) → Vector4?
Returns linear RGBA for attachment zero. Null discards the fragment.
override
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

eonAlbedo(Vector3 rho, double r, double mu) → Vector3
EonAlbedo: eonLobe over the hemisphere of light, at mu to the eye.
eonLobe(Vector3 rho, double r, double muI, double muO, double lDotV) → Vector3
EonLobe: EON for the diffuse colour rho, divided by π.
sheenLobe(double roughness, Surface s, LightSample light) → double
The sheen's lobe in ShadeLight, before its colour: Charlie's distribution at roughness times Neubelt's visibility.

Constants

minGgxRoughness → const double
kMinGgxRoughness: the least perceptual roughness the GGX lobe is evaluated at, which keeps its peak clear of _dGgx's guard. A fraction, nought to one, as roughness is.