advanced

#19 Texture Sampling

Using iChannel for multi-pass effects

Most shaders are single-pass — one calculation per pixel per frame. Multi-pass rendering changes the game by letting you write intermediate results to framebuffers (Buffers A–D) and read them back in later passes via iChannel0–3. This unlocks feedback loops where each frame builds on the last, enabling effects like motion blur, fluid simulation, particle physics, and trails. The key concept is the ping-pong pattern: read last frame's buffer, compute new values, write them back for next frame.

Key Concepts

Try this shader live in the Shader Sandbox editor with real-time preview.
Open in Sandbox

Source Code


    
← Previous Morphing Shapes Next → Post Processing

All Tutorials