Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/eevee/shaders/effect_dof_bokeh_frag.glsl
| Context not available. | |||||
| float ratio = (local_theta - halfside_angle) / halfside_angle; | float ratio = (local_theta - halfside_angle) / halfside_angle; | ||||
| float halfside_len = polygon_sides_length(sides_count) * 0.5; | float halfside_len = polygon_sides_length(sides_count) * 0.5; | ||||
| float oposite = ratio * halfside_len; | float opposite = ratio * halfside_len; | ||||
| /* NOTE: atan(y_over_x) has output range [-M_PI_2..M_PI_2]. */ | /* NOTE: atan(y_over_x) has output range [-M_PI_2..M_PI_2]. */ | ||||
| float final_local_theta = atan(oposite / adjacent); | float final_local_theta = atan(opposite / adjacent); | ||||
| return side * side_angle + final_local_theta; | return side * side_angle + final_local_theta; | ||||
| } | } | ||||
| Context not available. | |||||