Eevee: Hair: Make hairs visible even if the show emitter option is disabled.
This commit is contained in:
parent
08a2c5f224
commit
1de73fc6c3
|
@ -129,38 +129,40 @@ static void eevee_cache_populate(void *vedata, Object *ob)
|
|||
|
||||
const DRWContextState *draw_ctx = DRW_context_state_get();
|
||||
const bool is_active = (ob == draw_ctx->obact);
|
||||
bool cast_shadow = false;
|
||||
|
||||
if (is_active) {
|
||||
if (DRW_object_is_mode_shade(ob) == true) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (DRW_check_object_visible_within_active_context(ob) == false) {
|
||||
return;
|
||||
if (ob->base_flag & BASE_VISIBLED) {
|
||||
EEVEE_hair_cache_populate(vedata, sldata, ob, &cast_shadow);
|
||||
}
|
||||
|
||||
if (ELEM(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT)) {
|
||||
bool cast_shadow;
|
||||
if (DRW_check_object_visible_within_active_context(ob)) {
|
||||
if (ELEM(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT)) {
|
||||
EEVEE_materials_cache_populate(vedata, sldata, ob, &cast_shadow);
|
||||
}
|
||||
else if (!USE_SCENE_LIGHT(draw_ctx->v3d)) {
|
||||
/* do not add any scene light sources to the cache */
|
||||
}
|
||||
else if (ob->type == OB_LIGHTPROBE) {
|
||||
if ((ob->base_flag & BASE_FROMDUPLI) != 0) {
|
||||
/* TODO: Special case for dupli objects because we cannot save the object pointer. */
|
||||
}
|
||||
else {
|
||||
EEVEE_lightprobes_cache_add(sldata, ob);
|
||||
}
|
||||
}
|
||||
else if (ob->type == OB_LAMP) {
|
||||
EEVEE_lights_cache_add(sldata, ob);
|
||||
}
|
||||
}
|
||||
|
||||
EEVEE_materials_cache_populate(vedata, sldata, ob, &cast_shadow);
|
||||
|
||||
if (cast_shadow) {
|
||||
EEVEE_lights_cache_shcaster_object_add(sldata, ob);
|
||||
}
|
||||
}
|
||||
else if (!USE_SCENE_LIGHT(draw_ctx->v3d)) {
|
||||
/* do not add any scene light sources to the cache */
|
||||
}
|
||||
else if (ob->type == OB_LIGHTPROBE) {
|
||||
if ((ob->base_flag & BASE_FROMDUPLI) != 0) {
|
||||
/* TODO: Special case for dupli objects because we cannot save the object pointer. */
|
||||
}
|
||||
else {
|
||||
EEVEE_lightprobes_cache_add(sldata, ob);
|
||||
}
|
||||
}
|
||||
else if (ob->type == OB_LAMP) {
|
||||
EEVEE_lights_cache_add(sldata, ob);
|
||||
if (cast_shadow) {
|
||||
EEVEE_lights_cache_shcaster_object_add(sldata, ob);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1576,6 +1576,14 @@ void EEVEE_materials_cache_populate(EEVEE_Data *vedata, EEVEE_ViewLayerData *sld
|
|||
EEVEE_volumes_cache_object_add(sldata, vedata, scene, ob);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EEVEE_hair_cache_populate(EEVEE_Data *vedata, EEVEE_ViewLayerData *sldata, Object *ob, bool *cast_shadow)
|
||||
{
|
||||
EEVEE_PassList *psl = vedata->psl;
|
||||
EEVEE_StorageList *stl = vedata->stl;
|
||||
const DRWContextState *draw_ctx = DRW_context_state_get();
|
||||
Scene *scene = draw_ctx->scene;
|
||||
|
||||
if (ob->type == OB_MESH) {
|
||||
if (ob != draw_ctx->object_edit) {
|
||||
|
|
|
@ -815,6 +815,7 @@ struct GPUTexture *EEVEE_materials_get_util_tex(void); /* XXX */
|
|||
void EEVEE_materials_init(EEVEE_ViewLayerData *sldata, EEVEE_StorageList *stl, EEVEE_FramebufferList *fbl);
|
||||
void EEVEE_materials_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata);
|
||||
void EEVEE_materials_cache_populate(EEVEE_Data *vedata, EEVEE_ViewLayerData *sldata, Object *ob, bool *cast_shadow);
|
||||
void EEVEE_hair_cache_populate(EEVEE_Data *vedata, EEVEE_ViewLayerData *sldata, Object *ob, bool *cast_shadow);
|
||||
void EEVEE_materials_cache_finish(EEVEE_Data *vedata);
|
||||
struct GPUMaterial *EEVEE_material_world_lightprobe_get(struct Scene *scene, struct World *wo);
|
||||
struct GPUMaterial *EEVEE_material_world_background_get(struct Scene *scene, struct World *wo);
|
||||
|
|
Loading…
Reference in New Issue