
210 II Rendering Techniques
value to a framebuffer attachment.
2
Then, the second pass computes the contrast
of the current pixel by comparing the pixel’s brightness with the brightness of the
5 × 5 neighboring pixels. If this contrast is above a predefined threshold, its position,
CoC size, and average color are appended to a buffer. During the third pass, a blur-
based depth of field is computed with one of the previous methods, e.g., Gaussian
blur. Finally, a fourth pass splats textured quads at the bokeh positions that were
appended to the buffer in the second pass.
In order to maintain high performance, it is crucial to avoid CPU/GPU syn-
chronizatio ...