[Bf-blender-cvs] [80fffba132c] blender-v2.83-release: Fix T76729: Particle Hair Get Occluded by Overlays

Jeroen Bakker noreply at git.blender.org
Thu May 14 12:43:59 CEST 2020


Commit: 80fffba132c58c0c4187b2905f7700f4597aa5c2
Author: Jeroen Bakker
Date:   Thu May 14 12:42:52 2020 +0200
Branches: blender-v2.83-release
https://developer.blender.org/rB80fffba132c58c0c4187b2905f7700f4597aa5c2

Fix T76729: Particle Hair Get Occluded by Overlays

When using an external render engine Blender will still draw an OpenGL
depth buffer for the overlay engine to work correctly. Particle systems
were ignored, what lead to occluded hair and other artifacts.

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D7730

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

M	release/datafiles/locale
M	release/scripts/addons
M	source/blender/draw/engines/external/external_engine.c

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

diff --git a/release/datafiles/locale b/release/datafiles/locale
index 80f390fd0e2..1d9b8b2ffa6 160000
--- a/release/datafiles/locale
+++ b/release/datafiles/locale
@@ -1 +1 @@
-Subproject commit 80f390fd0e20d7e2aadf07c43a45717e810fa10d
+Subproject commit 1d9b8b2ffa67a8832073acf316150b2dfaa2db02
diff --git a/release/scripts/addons b/release/scripts/addons
index 44c17b01168..590710871b7 160000
--- a/release/scripts/addons
+++ b/release/scripts/addons
@@ -1 +1 @@
-Subproject commit 44c17b01168ea180d7ea865e9ec1ef6e93097b3a
+Subproject commit 590710871b7b2e1f7f50bb622f1409b794ad38c2
diff --git a/source/blender/draw/engines/external/external_engine.c b/source/blender/draw/engines/external/external_engine.c
index ee4bd58ab80..7dddbd07623 100644
--- a/source/blender/draw/engines/external/external_engine.c
+++ b/source/blender/draw/engines/external/external_engine.c
@@ -25,10 +25,12 @@
 
 #include "DRW_render.h"
 
+#include "DNA_modifier_types.h"
 #include "DNA_screen_types.h"
 #include "DNA_view3d_types.h"
 
 #include "BKE_object.h"
+#include "BKE_particle.h"
 
 #include "ED_screen.h"
 
@@ -166,6 +168,24 @@ static void external_cache_populate(void *vedata, Object *ob)
     return;
   }
 
+  if (ob->type == OB_MESH && ob->modifiers.first != NULL) {
+    LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) {
+      if (md->type != eModifierType_ParticleSystem) {
+        continue;
+      }
+      ParticleSystem *psys = ((ParticleSystemModifierData *)md)->psys;
+      if (!DRW_object_is_visible_psys_in_active_context(ob, psys)) {
+        continue;
+      }
+      ParticleSettings *part = psys->part;
+      const int draw_as = (part->draw_as == PART_DRAW_REND) ? part->ren_as : part->draw_as;
+
+      if (draw_as == PART_DRAW_PATH) {
+        struct GPUBatch *hairs = DRW_cache_particles_get_hair(ob, psys, NULL);
+        DRW_shgroup_call(stl->g_data->depth_shgrp, hairs, NULL);
+      }
+    }
+  }
   struct GPUBatch *geom = DRW_cache_object_surface_get(ob);
   if (geom) {
     /* Depth Prepass */



More information about the Bf-blender-cvs mailing list