How it works: 4 color channels store 4 depths to fake ray-traced liquid refraction

Michael_Moroz_ · x · 2026-09-24

The developer explains the trick: minimum blending writes 4 depths into the screen's 4 color channels (nearest front/back, furthest front/back surfaces, min/max via number inversion). Rendering liquid with ZTest Off approximates visible liquid surfaces; combined with screen-space ray marching of scene depth, it emulates multibounce ray-traced fluid far cheaper — and the 4 depths are essential for correct optical absorption depth of liquid plus air in between.

Related event: Dev Achieves Real-Time Liquid Refraction in VRChat(2 posts)→

Original post →

More from Research

Research channel →