Builtin Library
- ..
- README.md1.2 KB
- preview.png29.8 KB
- properties.yaml6.6 KB
- shader.wgsl5.7 KB
README.md
pbrReflective
pbr, plus a reflection the surface traces for itself against the scene already
drawn. Every property means exactly what it means on pbr; screen_reflection
scales how much of the traced reflection reaches the pixel.
Reach for this on a surface a reflection PASS cannot serve: anything in the transparent queue — glass, a canopy, a wet sheet, a puddle. A pass traces the surface the depth buffer holds, so it has no pixel to trace for a sheet of glass and no normal to trace with. This fragment has both.
Why it is a separate shader
Whether a shader reads the scene-colour binding is decided from its compiled
module, and the surface framework injects zero::pbr into every surface shader
in the engine. A trace reachable from there would make every material in every
scene a scene-colour reader, and the renderer would take the scene-colour copy
and route through the sampleable intermediate for every world, reflective or
not. Held in this shader, that cost lands on the scenes that asked for it.
An opaque surface does not need this: the reflections render feature traces those in one pass, under its own settings, which is cheaper than a march per fragment.