33 gather_uv = gather_uv * 2.0f - 1.0f;
37 float radius =
length(gather_uv);
39 if (srt.dof_buf.bokeh_blades > 0.0f) {
41 float theta =
atan(gather_uv.
y, gather_uv.
x) +
M_TAU;
43 radius /= circle_to_polygon_radius(srt.dof_buf.bokeh_blades,
44 theta - srt.dof_buf.bokeh_rotation);
46 float theta_new = circle_to_polygon_angle(srt.dof_buf.bokeh_blades, theta);
47 float r_new = circle_to_polygon_radius(srt.dof_buf.bokeh_blades, theta_new);
49 theta_new -= srt.dof_buf.bokeh_rotation;
51 gather_uv = r_new *
float2(-
cos(theta_new),
sin(theta_new));
55 slight_focus_texel *= srt.dof_buf.bokeh_anisotropic_scale_inv;
57 float theta =
atan(slight_focus_texel.
y + 1e-8f, -slight_focus_texel.
x + 1e-8f) +
M_TAU;
58 slight_focus_texel /= circle_to_polygon_radius(srt.dof_buf.bokeh_blades,
59 theta + srt.dof_buf.bokeh_rotation);