Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/workbench/workbench_effect_dof.c
| Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | |||||
| /* Shaders */ | /* Shaders */ | ||||
| extern char datatoc_workbench_effect_dof_frag_glsl[]; | extern char datatoc_workbench_effect_dof_frag_glsl[]; | ||||
| /* *********** Functions *********** */ | /* *********** Functions *********** */ | ||||
| /** | /** | ||||
| * Transform [-1..1] square to unit circle. | * Transform [-1..1] square to unit circle. | ||||
| **/ | */ | ||||
| static void square_to_circle(float x, float y, float *r, float *T) | static void square_to_circle(float x, float y, float *r, float *T) | ||||
| { | { | ||||
| if (x > -y) { | if (x > -y) { | ||||
| if (x > y) { | if (x > y) { | ||||
| *r = x; | *r = x; | ||||
| *T = (M_PI / 4.0f) * (y / x); | *T = (M_PI / 4.0f) * (y / x); | ||||
| } | } | ||||
| else { | else { | ||||
| ▲ Show 20 Lines • Show All 376 Lines • Show Last 20 Lines | |||||