diff options
Diffstat (limited to 'source/blender/draw/engines/workbench')
-rw-r--r-- | source/blender/draw/engines/workbench/shaders/workbench_effect_dof_frag.glsl | 7 | ||||
-rw-r--r-- | source/blender/draw/engines/workbench/workbench_deferred.c | 3 |
2 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/draw/engines/workbench/shaders/workbench_effect_dof_frag.glsl b/source/blender/draw/engines/workbench/shaders/workbench_effect_dof_frag.glsl index 5e4e594ecb5..1fb7a9cec46 100644 --- a/source/blender/draw/engines/workbench/shaders/workbench_effect_dof_frag.glsl +++ b/source/blender/draw/engines/workbench/shaders/workbench_effect_dof_frag.glsl @@ -31,9 +31,10 @@ float max_v4(vec4 v) { return max(max(v.x, v.y), max(v.z, v.w)); } /* divide by sensor size to get the normalized size */ #define calculate_coc(zdepth) (dof_aperturesize * (dof_distance / zdepth - 1.0) * dof_invsensorsize) -#define linear_depth(z) ((ProjectionMatrix[3][3] == 0.0) \ - ? (nearFar.x * nearFar.y) / (z * (nearFar.x - nearFar.y) + nearFar.y) \ - : (z * 2.0 - 1.0) * nearFar.y) +#define linear_depth(z) \ + ((ProjectionMatrix[3][3] == 0.0) ? \ + (nearFar.x * nearFar.y) / (z * (nearFar.x - nearFar.y) + nearFar.y) : \ + (z * 2.0 - 1.0) * nearFar.y) const float MAX_COC_SIZE = 100.0; diff --git a/source/blender/draw/engines/workbench/workbench_deferred.c b/source/blender/draw/engines/workbench/workbench_deferred.c index dfd8152ae06..4afc692455c 100644 --- a/source/blender/draw/engines/workbench/workbench_deferred.c +++ b/source/blender/draw/engines/workbench/workbench_deferred.c @@ -264,8 +264,7 @@ static GPUShader *ensure_background_shader(WORKBENCH_PrivateData *wpd) static void select_deferred_shaders(WORKBENCH_PrivateData *wpd, eGPUShaderConfig sh_cfg) { - wpd->prepass_solid_sh - = ensure_deferred_prepass_shader(wpd, false, false, sh_cfg); + wpd->prepass_solid_sh = ensure_deferred_prepass_shader(wpd, false, false, sh_cfg); wpd->prepass_solid_hair_sh = ensure_deferred_prepass_shader(wpd, false, true, sh_cfg); wpd->prepass_texture_sh = ensure_deferred_prepass_shader(wpd, true, false, sh_cfg); wpd->prepass_texture_hair_sh = ensure_deferred_prepass_shader(wpd, true, true, sh_cfg); |