clearMedium
A see-through dielectric that shows the lit room behind it: glass, water, ice, crystal, gems, honey and slime in `glassLiquidsMaterials`. The engine's `pbr` transmission refracts only the sky (gh#10617), so this shader reads the room through the engine's scene-colour copy (`zero:…
clearMedium
A see-through dielectric that shows the lit room behind it: glass, water, ice, crystal, gems, honey and slime in glassLiquidsMaterials. The engine's pbr transmission refracts only the sky (gh#10617), so this shader reads the room through the engine's scene-colour copy (zero::scene_color) at the place the refracted ray really lands, measured with the scene depth (zero::scene_depth): a thin pane barely moves the room, hammered or cracked glass bends it by (ior − 1) × tilt over the distance behind, a ball lens inverts it.
Colour comes only from the medium: Beer–Lambert absorption T = absorb_color ^ (path / absorb_distance) over the real path (a pond as deep as its floor, a sphere as thick as its chord, a slab thickness / cos θ), single scattering for cloudy media (scatter_color, scatter_distance, scatter_g), and the engine's own PBR lighting (zero_pbr_shade: every light, shadows, the environment) for the reflection, with the surface tracing the room's reflection for itself (screenReflection). Also: per-colour refraction (dispersion, glTF's 20 / Abbe number), frost blur that grows with the distance behind, painted parts (lead, wire) and inclusions (crack faces, bubbles at two depths, veils) from a mask, gem facets and the light a stone sends back out after reflecting inside it (sparkle), and gravity–capillary ripples periodic over one UV repeat that a flow carries downstream.
cover = 0 makes a clear shell that composites over what is drawn behind it (other see-through things too); cover = 1 replaces what is behind with its own bent, absorbed read. Draw it premultiplied: shells at queue 3010 without depth, bodies at 3000 writing depth (see the package README, "How they draw").
Scoped to this part · feeds back into the world's score.