Examples Framebuffer Blur

Framebuffer Blur

The shader in this example uses depth information from a p5.Framebuffer to apply a blur. On a real camera, objects appear blurred if they are closer or farther than the lens’s focus. This simulates that effect. First, the sketch renders five spheres to the framebuffer. Then, it renders the framebuffer to the canvas using the blur shader.

Framebuffer Blur: Revised by Caleb Foss. Edited and maintained by p5.js Contributors and Processing Foundation. Licensed under CC BY-NC-SA 4.0.

You can find the code history of these examples here: pre-2023 example, 2023 code. You can suggest improvements by contributing to the current website!