blur is also a screen space technique.
works by determining, for a current fragment p
, where it was located on a
previous frame (let’s call this q
blur vector is formed between p
colours are averaged.Pass
1: Render the scene to texture using an
2: Render a full-screen quad using the
texture from pass 1 to the default framebuffer.
In the fragment shader,
- Retrieve the distance to the point from
the depth buffer, forming p
- Unproject to local coordinates using the
inverse projection matrix and inverse modelview matrix, forming p3d.
- Project p3d using the previous
frame’s modelview / projection matrix and shift to the range [0, 1], forming q.
- Blur the image along the vector between p and q.