From 45d3303ae42e0b563bd164148efa516f93261ba0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Fri, 14 May 2021 16:18:12 +0200 Subject: Fix T85845 EEVEE: Depth Of Field: Artifacts with slight out of focus This was caused by the bokeh LUT being sampled outside the valid range. But `texelFetch` is only valid if the sample actually exists. This lead to undefined behavior. The fix is to increase `DOF_MAX_SLIGHT_FOCUS_RADIUS` (which just offsets the LUT along the X=Y axis) to avoid any sample outside the defined range. --- source/blender/draw/engines/eevee/shaders/effect_dof_lib.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/draw/engines') diff --git a/source/blender/draw/engines/eevee/shaders/effect_dof_lib.glsl b/source/blender/draw/engines/eevee/shaders/effect_dof_lib.glsl index faac216480b..dac53719149 100644 --- a/source/blender/draw/engines/eevee/shaders/effect_dof_lib.glsl +++ b/source/blender/draw/engines/eevee/shaders/effect_dof_lib.glsl @@ -136,7 +136,7 @@ const float layer_offset_fg = 0.5 + 1.0; /* Extra offset for convolution layers to avoid light leaking from background. */ const float layer_offset = 0.5 + 0.5; -#define DOF_MAX_SLIGHT_FOCUS_RADIUS 5 +#define DOF_MAX_SLIGHT_FOCUS_RADIUS 16 float dof_layer_weight(float coc, const bool is_foreground) { -- cgit v1.2.3