Example 54 - Transmission (screen-space refraction glass).
← All examples54_transmission
Filament-style screen-space refraction on the PBR material. Two passes: A: render the opaque scene (skybox + an opaque colored backdrop) into a linear HDR target, then mk_pbr_transmission_capture() makes it the refraction backdrop (and builds a mip chain of it for frosted glass). B: redraw the scene to the backbuffer + a row of glass spheres (transmission = 1) that refract the captured backdrop. ./scripts/build-linux.sh --pbr --ibl --target=54_transmission Four modes (M cycles, 1-4 jump) sweep one parameter across the row: VOLUME - thickness 0.2->2.0 with a teal attenuation: Beer-Lambert tint deepens. THIN WALL - IOR 1.05->2.42, thickness 0: transmission without volume attenuation. DISPERSION - dispersion 0->6 (= 20/Abbe) at IOR 1.5: chromatic fringing grows. FROSTED - roughness 0->1 at IOR 1.5: clear glass blurs to frosted. Controls: M / 1-4 = mode, drag = orbit, scroll = zoom, ESC = quit.

Runs the WebAssembly build on this page. Click the canvas to give it keyboard focus.
- Number
- 54
- Tags
- Source
examples/54_transmission/main.c
Build and run
./scripts/build-linux.sh release --target=54_transmission --run