Chapter 19. Generic Refraction Simulation — Tiago Sousa (Crytek)
- Source: https://developer.nvidia.com/gpugems/gpugems2/part-ii-shading-lighting-and-shadows/chapter-19-generic-refraction-simulation
- Volume: GPU Gems 2
- Note: add-only excerpt; images omitted.
Summary of full chapter read
Far Cry–style screen-space refraction: render non-refractive scene → texture S; refractive meshes sample S with normal-map XY perturbation of projected UVs. No per-refractor cubemap; water needs no extra clip-pass for refraction.
Refraction mask
Large bumps leak foreground into refractor. Clear S.a=1, paint refractive meshes black into alpha; lerp perturbed vs unperturbed sample by alpha so perturbation only sticks inside refractor footprint.
Applications
Water: mask in S.a + separate reflection map + multi-layer animated bumps + Fresnel; deep-water color by distance. Glass: diffuse tint × refraction + env map × Fresnel. Limit: differently colored overlapping refractors wrong unless back-to-front + update S or alpha blend.