[Bf-blender-cvs] [a0437c3f730] master: Fix T75087 Workbench: DoF: Divide By Zero when antialiasing is disabled

Clément Foucault noreply at git.blender.org
Thu Mar 26 16:03:54 CET 2020


Commit: a0437c3f730f14be83f8e6cb20432b3775ffd03f
Author: Clément Foucault
Date:   Thu Mar 26 16:03:37 2020 +0100
Branches: master
https://developer.blender.org/rBa0437c3f730f14be83f8e6cb20432b3775ffd03f

Fix T75087 Workbench: DoF: Divide By Zero when antialiasing is disabled

===================================================================

M	source/blender/draw/engines/workbench/workbench_effect_dof.c

===================================================================

diff --git a/source/blender/draw/engines/workbench/workbench_effect_dof.c b/source/blender/draw/engines/workbench/workbench_effect_dof.c
index 9716ccd4b44..e13f7bfdd92 100644
--- a/source/blender/draw/engines/workbench/workbench_effect_dof.c
+++ b/source/blender/draw/engines/workbench/workbench_effect_dof.c
@@ -326,7 +326,7 @@ void workbench_dof_cache_init(WORKBENCH_Data *vedata)
     /* We reuse the same noise texture. Ensure it is up to date. */
     workbench_cavity_samples_ubo_ensure(wpd);
 
-    float offset = wpd->taa_sample / wpd->taa_sample_len;
+    float offset = wpd->taa_sample / (float)max_ii(1, wpd->taa_sample_len);
     DRWShadingGroup *grp = DRW_shgroup_create(blur1_sh, psl->dof_blur1_ps);
     DRW_shgroup_uniform_block(grp, "dofSamplesBlock", wpd->vldata->dof_sample_ubo);
     DRW_shgroup_uniform_texture(grp, "noiseTex", wpd->vldata->cavity_jitter_tx);



More information about the Bf-blender-cvs mailing list