Skip to Content
DocumentationFeaturesReflection & Refraction

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.

Video

A glass gemstone rotating in front of a detailed background, the background refracting and warping through it with chromatic aberration on the edges and a cubemap reflection sliding across the surface.

features/reflection-refraction/glass-refraction.mp4

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.

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.

Glass reads as a flat tinted surface.

The background distorts through the glass with a slight frost.

No refraction
Refraction · IOR 1.5 + blur

Tinted-transparent glass against full refraction with blur. Drag to compare.

Properties

Inspector labelShader propertyTypeDefaultDescription
Reflection Cubemap_ReflectionCubemapCubemapNoneOptional override; falls back to the active reflection probe.
Reflection Strength_ReflectionStrengthFloat (0–1)0.5Mix between reflection and surface color.
Reflection Roughness_ReflectionRoughnessFloat (0–1)0.20 = mirror, 1 = matte. Selects the cubemap mip.
Index of Refraction_RefractionIORFloat (1–2.5)1.45Glass 1.5, water 1.33, diamond 2.4.
Refraction Strength_RefractionStrengthFloat (0–2)1.0Multiplier on the distortion amount.
Refraction Blur_RefractionBlurFloat (0–6)0.0Frosted-glass mip bias.
Chromatic Aberration_ChromaticAberrationFloat (0–0.05)0.0Per-channel UV offset on the refraction sample.
Fresnel Power_FresnelPowerFloat (0.1–8)5.0Biases reflection toward grazing angles.

Usage

  1. Add a Reflection Probe to the scene if you do not already have one; URP needs it for the environment sample.
  2. Enable the Opaque Texture option on the URP Asset (required for refraction).
  3. Switch the material’s Blend Mode to Transparent and set the queue to 3000 or higher.
  4. 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+.
Last updated on