Fix T74392: HDRI preview spheres appear in render passes and reflections

Do not render HDRI Previews when a renderpass is active

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D7005
This commit is contained in:
Jeroen Bakker 2020-03-03 09:58:48 +01:00
parent 0c0895e3e6
commit 456595fd39
4 changed files with 21 additions and 7 deletions

@ -5888,7 +5888,9 @@ class VIEW3D_PT_overlay_guides(Panel):
sub.prop(overlay, "show_cursor", text="3D Cursor")
if shading.type == 'MATERIAL':
col.prop(overlay, "show_look_dev")
row = col.row()
row.active = shading.render_pass == 'COMBINED'
row.prop(overlay, "show_look_dev")
col.prop(overlay, "show_annotation", text="Annotations")

@ -76,7 +76,7 @@ void EEVEE_lookdev_cache_init(EEVEE_Data *vedata,
effects->lookdev_view = NULL;
if (LOOK_DEV_OVERLAY_ENABLED(v3d)) {
if (eevee_hdri_preview_overlay_enabled(v3d)) {
/* Viewport / Spheres size. */
const rcti *rect;
rcti fallback_rect;
@ -228,7 +228,7 @@ void EEVEE_lookdev_draw(EEVEE_Data *vedata)
const DRWContextState *draw_ctx = DRW_context_state_get();
if (psl->lookdev_diffuse_pass && LOOK_DEV_OVERLAY_ENABLED(draw_ctx->v3d)) {
if (psl->lookdev_diffuse_pass && eevee_hdri_preview_overlay_enabled(draw_ctx->v3d)) {
/* Config renderer. */
EEVEE_CommonUniformBuffer *common = &sldata->common_data;
common->la_num_light = 0;

@ -1266,7 +1266,7 @@ void EEVEE_materials_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
DRW_shgroup_call(grp, DRW_cache_fullscreen_quad_get(), NULL);
}
if (LOOK_DEV_OVERLAY_ENABLED(draw_ctx->v3d)) {
if (eevee_hdri_preview_overlay_enabled(draw_ctx->v3d)) {
DRWShadingGroup *shgrp;
struct GPUBatch *sphere = DRW_cache_sphere_get();

@ -125,9 +125,21 @@ extern struct DrawEngineType draw_engine_eevee_type;
} \
((void)0)
#define LOOK_DEV_OVERLAY_ENABLED(v3d) \
((v3d) && (v3d->shading.type == OB_MATERIAL) && ((v3d->flag2 & V3D_HIDE_OVERLAYS) == 0) && \
(v3d->overlay.flag & V3D_OVERLAY_LOOK_DEV))
BLI_INLINE bool eevee_hdri_preview_overlay_enabled(View3D *v3d)
{
/* Only show the HDRI Preview in Shading Preview in the Viewport. */
if (v3d == NULL || v3d->shading.type != OB_MATERIAL) {
return false;
}
/* Only show the HDRI Preview when viewing the Combined render pass */
if (v3d->shading.render_pass != SCE_PASS_COMBINED) {
return false;
}
return ((v3d->flag2 & V3D_HIDE_OVERLAYS) == 0) && (v3d->overlay.flag & V3D_OVERLAY_LOOK_DEV);
}
#define USE_SCENE_LIGHT(v3d) \
((!v3d) || \
((v3d->shading.type == OB_MATERIAL) && (v3d->shading.flag & V3D_SHADING_SCENE_LIGHTS)) || \