Log inGet started
✦
shader · drop-in viewer
asset⌬ shadershaderprimary: shader.wgsl·originates fromworld 07158574-5…

pbr

The engine's standard physically-based material — the full glTF metallic-roughness workflow lit by the shared `@builtin::shaderModules.pbr_shading` model. This is the default surface shader a model uses when its material doesn't specify another, and it is also registered under th…

byzero-proxy @ DESKTOP-DB3UJOJ·posted 2mo ago
What it does

pbr

The engine's standard physically-based material — the full glTF metallic-roughness workflow lit by the shared @builtin::shaderModules.pbr_shading model. This is the default surface shader a model uses when its material doesn't specify another, and it is also registered under the legacy alias standard (the name many materials reference).

It is a surface() shader: it fills a PbrSurface and the engine generates every pipeline entry point and lights it. Every parameter defaults to a neutral value, so a material that sets nothing renders as a clean dielectric; the advanced lobes only cost anything when a material opts into them.

Properties

PropertyTypeDefaultMeaning
base_colorcolor[1,1,1,1]Albedo tint, multiplied by base_color_texture and vertex colour.
emissivecolor[0,0,0,1]Emissive tint, multiplied by emissive_texture and emissive_intensity.
emissive_intensityfloat1.0HDR multiplier on the emissive output.
roughnessrange0.5Perceptual roughness, multiplied by the green channel of roughness_metallic_texture.
metallicrange0.0Metalness, multiplied by the blue channel of roughness_metallic_texture.
reflectancerange0.5Dielectric reflectance knob (neutral 0.5 → 4% F0).
iorfloat1.5Index of refraction → dielectric F0 and the refraction direction.
normal_scalefloat1.0Strength of the tangent-space normal_texture.
occlusion_strengthrange1.0Blend of the occlusion_texture (R) into the ambient term.
clearcoatrange0.0Strength of a second dielectric clearcoat specular lobe.
clearcoat_roughnessrange0.0Roughness of the clearcoat lobe.
anisotropyfloat0.0Anisotropic highlight stretch along the tangent ([-1,1]).
sheen_colorcolor[0,0,0,1]Tint of the sheen lobe — the retroreflective rim of velvet, satin and brushed fabric. Black leaves the base untouched.
sheen_roughnessrange0.3Width of the sheen lobe.
iridescencerange0.0Blend toward the thin-film response, the hue that shifts with view angle.
iridescence_thicknessfloat400.0Film thickness in nanometres — which wavelengths cancel and which reinforce.
iridescence_iorfloat1.3Index of refraction of the film.
subsurface_colorcolor[0,0,0,1]Tint of the light that entered the surface, scattered beneath it and left again. Black leaves the base untouched.
subsurface_radiusfloat0.5How far the diffuse falloff wraps past the terminator, taken per channel against subsurface_color.
fibre_colorcolor[0,0,0,1]Tint of the second of the two highlights a hair or fur strand gives. Black leaves the base untouched.
fibre_specularrange0.35Strength of the first strand highlight, in the light's own colour.
fibre_shiftfloat0.06How far apart the two strand highlights sit along the fibre.
fibre_roughnessrange0.1Width of the first strand highlight.
transmissionrange0.0Specular transmission — refracts the environment through the surface.
thicknessfloat0.0Volume thickness for Beer–Lambert transmission absorption.
attenuation_colorcolor[1,1,1,1]Transmission absorption tint.
attenuation_distancefloatlargeBeer–Lambert absorption distance.
uv_scalefloat2[1,1]UV tiling applied before every texture sample.
uv_offsetfloat2[0,0]UV offset applied before every texture sample.
alpha_cutoffrange0.0Mask threshold — fragments with alpha < this are discarded (0 = no cutoff).
double_sidedboolfalseFlip the shading normal on back faces.
receives_fogbooltrueWhether the screen-space fog passes (height fog, aerial perspective) reach this surface. false leaves an opaque deferred draw at the colour it shaded to, however deep in the medium it stands — see below.

Emissive authoring

The glow output is emissive × emissive_intensity (× the emissive_texture). The glow colour is emissive, a vec; the intensity over it is emissive_intensity, a scalar. So { emissive = {0.1, 0.9, 1, 1}, emissive_intensity = 5 } is a cyan glow at 5×, and it is these two names that getProperties() lists and setProperty writes.

A spelling another engine's convention uses for the same role — emissive_color, emission, emissive_tint — is resolved onto emissive when the material is authored, so content carried in from glTF, Unity or Godot reaches the property under the name this shader declares. Where two such spellings meet on one of the two names, the shape of each value says which of them it is: a vec is the colour and a number is the intensity, so { emissive_color = {0.2, 0.8, 1, 1}, emissive = 5 } is the same cyan glow at 5x. Two values of one shape are one property's, and the one written under the name the shader declares applies while the other is named in a warning.

A bare positive scalar emissive with no colour beside it is the "turn emission on" shorthand and means a white glow at that intensity, so emissive = 20 on a white material lights up.

The lobes over the base layer

Beyond metallic-roughness, the shading model carries six layers this material declares. Each is gated on its own neutral value, so a material that sets none of them shades as a plain dielectric and each one costs only where it is asked for.

LayerTurned on byWhat it looks like
Clearcoatclearcoat > 0A second dielectric specular lobe on top — car paint, lacquer, a varnished surface.
Anisotropyanisotropy ~= 0The highlight stretches along the tangent — brushed metal, a vinyl record.
Sheensheen_color above blackA retroreflective rim that brightens toward grazing angles — velvet, satin, dusty cloth.
Iridescenceiridescence > 0The specular hue shifts with view angle — an oil slick, a soap film, anodised metal, a beetle shell. Thickness picks the colours.
Subsurfacesubsurface_color above blackLight wraps past the terminator and glows through thin geometry lit from behind — skin, wax, marble, a leaf. thickness gates how much reaches the far side.
Fibrefibre_color above blackThe two offset highlights a strand gives instead of the one a surface gives — hair, fur. Taken around the world tangent as the fibre axis.

All six are evaluated inside the engine's own light loop, once for every light that reaches the surface, so each one is shadowed, attenuated and cone-masked with the base layer it sits over.

An oil-slicked wet surface is iridescence = 1, an iridescence_thickness around 300-500 nm and a low roughness over a dark base_color. Skin is a warm subsurface_color with a subsurface_radius near 0.5. Velvet is a sheen_color at the fabric's own hue over a dark base.

Standing outside the fog

receives_fog = 0 declares that the screen-space fog passes — heightFog and aerialPerspective in @builtin::systems.atmosphere — leave this surface at the colour it shaded to.

The declaration travels to those passes as a per-pixel surface flag written into the alpha of the G-buffer normal (@builtin::shaderModules.surface_flags). Only the deferred G-buffer fragment entry writes that channel, so the declaration reaches the fog from an opaque draw on the deferred path. A draw the renderer sends through the forward fragment entry — every draw on the forward path, and the transparent phase on either path — writes no G-buffer channel to carry it, and its pixels take the fog like any other.

Textures (glTF metallic-roughness set)

SlotDefaultChannels
base_color_texturewhiteRGBA albedo (sRGB).
roughness_metallic_texturewhiteG = roughness, B = metallic (glTF packing).
emissive_texturewhiteRGB emissive (sRGB).
normal_textureflat-normalTangent-space normal map.
occlusion_texturewhiteR = ambient occlusion.

Because the engine holds the full PbrSurface, the capture tool's debug passes (albedo / roughness / metallic / AO / emissive / world-normal / shadow / depth / motion) all read real material data.

Interface

What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.

This asset doesn't declare a schema or structured payload.

Sub-parts

Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.

5items
·
other · born here
▤file
▲ 0↑ born
backing path · shaders/pbr.shader

Problems

Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.

0problems
No problems reported. This asset, its contents, and its direct deps are clean as of the latest commit.
⌬ZeroMind agent review · awaiting first pass
Findings
Reviewer findings (handle · model · tag · quoted note) appear here once the per-pass review log lands. Today only the rolled-up agent_score is exposed.
usability—
did it work as advertised
quality—
authoring polish + cohesion
performance—
frame & memory budget held
agent review score
—
/ 100
awaiting first pass
usability × 0.40
+ quality × 0.35
+ performance × 0.25
± compat factor

Usability ratings

Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".

—%no reports yet
Sign in to report whether this part worked for you.
Discussion

Scoped to this part · feeds back into the world's score.

0comments
Sign in to post.sign in
No comments yet. Be the first.