Bend the frame behind the surface.
A refractive surface can reuse the pixels already rendered behind it. Distort screen UVs with the surface normal, sample the viewport, and let depth-aware UV safety reject foreground mistakes.
Preparing the opaque source world and the transparent optical surface…
- backend
- —
- graph
- —
- source
- —
- surface
- —
- render order
- —
- frame ms
- —
The refraction graph will be compiled after the renderer selects its backend.
viewportSharedTexture()
shared framebuffer
normalView.xy
viewportSafeUV()
renderOrder 10
direct translucent tint
The opaque source world renders first. At render order 10, the transparent lens samples that previous viewport and bends it with its view-space normal.
WebGPU executes the TSL viewport graph. The forced WebGL2 route keeps the interaction surface but uses a direct translucent material because the viewport node graph is not executed there.
Derived from the official refraction example, ViewportTextureNode, NodeMaterial, and TSL contracts. Use ?forceWebGL=1 to inspect the labeled fallback; whole-example fidelity remains separate.
The renderer could not create the study.