Reflection & Refraction
Reflection & Refraction stacks two related effects: a cubemap or reflection-probe lookup, and screen-space refraction via the URP Opaque Texture. Together they cover glass, ice, gemstones, water surfaces, and stylized crystal, with optional blur for frosted finishes and chromatic aberration for prismatic edges.
Screen-space refraction and cubemap reflection on a rotating glass gem.
When to use it
- Glass, ice, and gemstones — reflection and refraction layered together.
- Calm water — reflection only, with a horizon fade.
- Holographic UI — high refraction, low reflection, with a chromatic shift.
- Stylized crystals — push blur and chromatic aberration for the cartoon-crystal look.
Difference from MatCap
Modes
- Reflection — samples either an assigned cubemap or the active URP reflection probe through the standard glossy-environment path. Roughness picks the cubemap mip.
- Refraction — distorts the URP Opaque Texture by the view-space normal, scaled by index of refraction.
Tinted-transparent glass against full refraction with blur. Drag to compare.
Properties
Usage
- Add a Reflection Probe to the scene if you do not already have one; URP needs it for the environment sample.
- Enable the Opaque Texture option on the URP Asset (required for refraction).
- Switch the material’s Blend Mode to Transparent and set the queue to 3000 or higher.
- Dial IOR until the refraction looks right — 1.5 for glass, 1.33 for water.
material.SetFloat("_RefractionIOR", 1.5f);
material.SetFloat("_RefractionBlur", 2.0f);
material.SetFloat("_ChromaticAberration", 0.003f);Tips & gotchas
- The Opaque Texture is mandatory for refraction. Without it, the refraction term reads black.
- Refraction only includes opaque geometry, so two refractive panes in front of each other will not see each other.
- Blur cost scales with mip count; keep blur below 3 on mobile.
- Refraction is per-eye and handles stereo UVs correctly in URP 12+.
Related
- Surface Settings — switch to Transparent for refraction.
- Iridescence — view-angle rainbow on top of reflection.
- MatCap — cheaper alternative for stylized metals.
- Depth Coloring — pair with refraction for stylized water.
Last updated on