Workbench: Hair rendering
This commit is contained in:
parent
6c608b2f8a
commit
badab5cb7d
|
@ -29,6 +29,8 @@
|
|||
|
||||
#include "BKE_particle.h"
|
||||
|
||||
#include "DNA_modifier_types.h"
|
||||
|
||||
#include "GPU_shader.h"
|
||||
|
||||
#include "UI_resources.h"
|
||||
|
@ -328,22 +330,26 @@ static void workbench_cache_populate_particles(WORKBENCH_Data *vedata, IDPropert
|
|||
const DRWContextState *draw_ctx = DRW_context_state_get();
|
||||
|
||||
if (ob != draw_ctx->object_edit) {
|
||||
for (ParticleSystem *psys = ob->particlesystem.first; psys; psys = psys->next) {
|
||||
if (psys_check_enabled(ob, psys, false)) {
|
||||
ParticleSettings *part = psys->part;
|
||||
int draw_as = (part->draw_as == PART_DRAW_REND) ? part->ren_as : part->draw_as;
|
||||
for (ModifierData *md = ob->modifiers.first; md; md = md->next) {
|
||||
if (md->type == eModifierType_ParticleSystem) {
|
||||
ParticleSystem *psys = ((ParticleSystemModifierData *)md)->psys;
|
||||
|
||||
if (draw_as == PART_DRAW_PATH && !psys->pathcache && !psys->childcache) {
|
||||
draw_as = PART_DRAW_DOT;
|
||||
}
|
||||
if (psys_check_enabled(ob, psys, false)) {
|
||||
ParticleSettings *part = psys->part;
|
||||
int draw_as = (part->draw_as == PART_DRAW_REND) ? part->ren_as : part->draw_as;
|
||||
|
||||
static float mat[4][4];
|
||||
unit_m4(mat);
|
||||
if (draw_as == PART_DRAW_PATH && !psys->pathcache && !psys->childcache) {
|
||||
draw_as = PART_DRAW_DOT;
|
||||
}
|
||||
|
||||
if (draw_as == PART_DRAW_PATH) {
|
||||
struct Gwn_Batch *geom = DRW_cache_particles_get_hair(psys, NULL);
|
||||
WORKBENCH_MaterialData *material = get_or_create_material_data(vedata, props, ob);
|
||||
DRW_shgroup_call_add(material->shgrp, geom, mat);
|
||||
static float mat[4][4];
|
||||
unit_m4(mat);
|
||||
|
||||
if (draw_as == PART_DRAW_PATH) {
|
||||
struct Gwn_Batch *geom = DRW_cache_particles_get_hair(psys, NULL);
|
||||
WORKBENCH_MaterialData *material = get_or_create_material_data(vedata, props, ob);
|
||||
DRW_shgroup_call_add(material->shgrp, geom, mat);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue