74 depth = (dof.camera_type !=
CAMERA_ORTHO) ? 1.0f / depth : depth;
75 return dof.coc_mul * depth + dof.coc_bias;
88 float side_angle = (2.0f *
EEVEE_PI) / sides_count;
89 return cosf(side_angle * 0.5f) /
97 float side_angle = (2.0f *
EEVEE_PI) / sides_count;
98 float halfside_angle = side_angle * 0.5f;
99 float side =
floorf(theta / side_angle);
104 float local_theta = theta - side * side_angle;
105 float ratio = (local_theta - halfside_angle) / halfside_angle;
108 float opposite = ratio * halfside_len;
111 float final_local_theta =
atanf(opposite / adjacent);
113 return side * side_angle + final_local_theta;
static constexpr int DOF_GATHER_RING_COUNT
static float circle_to_polygon_angle(float sides_count, float theta)
static float regular_polygon_side_length(float sides_count)
static constexpr float DOF_FAST_GATHER_COC_ERROR
static float coc_radius_from_camera_depth(DepthOfFieldData dof, float depth)
static float circle_to_polygon_radius(float sides_count, float theta)
static constexpr int DOF_DILATE_RING_COUNT
VecBase< float, 4 > float4
VecBase< int32_t, 2 > int2
VecBase< float, 2 > float2
float scatter_coc_threshold
float2 bokeh_anisotropic_scale_inv
int scatter_sprite_per_row
float2 bokeh_anisotropic_scale
float4 filter_samples_weight
float scatter_neighbor_max_color
float scatter_color_threshold
float filter_center_weight
enum eCameraType camera_type