Talk:OpenGL Programming/Depth of Field

This is an error - it is passing vec3, vec3 and a int/float to the vec3:

glm::vec3 bokeh = glm::vec3(right * cosf(i * 2 * M_PI / n), p_up * sinf(i * 2 * M_PI / n), 0);

The fix is trivial:

glm::vec3 bokeh = right * cosf(i * 2 * M_PI / n + p_up * sinf(i * 2 * M_PI / n);

It should also be mentioned that it relies on accumulation buffers, and functions reliant on it, which are considered deprecated, and not supported in OpenGL 3+ core profile.