Transmission

A glass cube refracts the scene behind it in screen space: the frame is rendered, blurred into a pyramid, and read back through Snell refraction, chromatic dispersion and a Fresnel-weighted environment reflection.

Open fullscreen
/** Maps perceptual roughness onto the available screen-space blur pyramid. */
export fn transmission_lod(roughness: f32, levels: f32) -> f32 {
  return pow(roughness, 0.8) * max(levels - 1.0, 0.0);
}
 
/** Reflection cone used by env_lod. */
export fn reflection_cone(roughness: f32) -> f32 {
  return max(roughness * 0.6, 0.02);
}