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
This commit is contained in:

committed by
Jeroen Bakker

parent
a88316b4a6
commit
80fffba132
Submodule release/datafiles/locale updated: 80f390fd0e...1d9b8b2ffa
Submodule release/scripts/addons updated: 44c17b0116...590710871b
@@ -25,10 +25,12 @@
|
|||||||
|
|
||||||
#include "DRW_render.h"
|
#include "DRW_render.h"
|
||||||
|
|
||||||
|
#include "DNA_modifier_types.h"
|
||||||
#include "DNA_screen_types.h"
|
#include "DNA_screen_types.h"
|
||||||
#include "DNA_view3d_types.h"
|
#include "DNA_view3d_types.h"
|
||||||
|
|
||||||
#include "BKE_object.h"
|
#include "BKE_object.h"
|
||||||
|
#include "BKE_particle.h"
|
||||||
|
|
||||||
#include "ED_screen.h"
|
#include "ED_screen.h"
|
||||||
|
|
||||||
@@ -166,6 +168,24 @@ static void external_cache_populate(void *vedata, Object *ob)
|
|||||||
return;
|
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);
|
struct GPUBatch *geom = DRW_cache_object_surface_get(ob);
|
||||||
if (geom) {
|
if (geom) {
|
||||||
/* Depth Prepass */
|
/* Depth Prepass */
|
||||||
|
Reference in New Issue
Block a user