Eevee: Hide lightprobe data when using "Only Render"
This commit is contained in:
@@ -582,7 +582,7 @@ static void EEVEE_planar_reflections_updates(EEVEE_SceneLayerData *sldata, EEVEE
|
|||||||
eplanar->attenuation_bias = max_dist * -eplanar->attenuation_scale;
|
eplanar->attenuation_bias = max_dist * -eplanar->attenuation_scale;
|
||||||
|
|
||||||
/* Debug Display */
|
/* Debug Display */
|
||||||
if ((probe->flag & LIGHTPROBE_FLAG_SHOW_DATA) != 0) {
|
if (DRW_state_draw_support() && (probe->flag & LIGHTPROBE_FLAG_SHOW_DATA)) {
|
||||||
DRWShadingGroup *grp = DRW_shgroup_create(e_data.probe_planar_display_sh, psl->probe_display);
|
DRWShadingGroup *grp = DRW_shgroup_create(e_data.probe_planar_display_sh, psl->probe_display);
|
||||||
|
|
||||||
DRW_shgroup_uniform_int(grp, "probeIdx", &ped->probe_id, 1);
|
DRW_shgroup_uniform_int(grp, "probeIdx", &ped->probe_id, 1);
|
||||||
@@ -635,7 +635,7 @@ static void EEVEE_lightprobes_updates(EEVEE_SceneLayerData *sldata, EEVEE_PassLi
|
|||||||
invert_m4(eprobe->parallaxmat);
|
invert_m4(eprobe->parallaxmat);
|
||||||
|
|
||||||
/* Debug Display */
|
/* Debug Display */
|
||||||
if ((probe->flag & LIGHTPROBE_FLAG_SHOW_DATA) != 0) {
|
if (DRW_state_draw_support() && (probe->flag & LIGHTPROBE_FLAG_SHOW_DATA)) {
|
||||||
DRW_shgroup_call_dynamic_add(stl->g_data->cube_display_shgrp, &ped->probe_id, ob->obmat[3], &probe->data_draw_size);
|
DRW_shgroup_call_dynamic_add(stl->g_data->cube_display_shgrp, &ped->probe_id, ob->obmat[3], &probe->data_draw_size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -693,7 +693,7 @@ static void EEVEE_lightprobes_updates(EEVEE_SceneLayerData *sldata, EEVEE_PassLi
|
|||||||
copy_v3_v3_int(egrid->resolution, &probe->grid_resolution_x);
|
copy_v3_v3_int(egrid->resolution, &probe->grid_resolution_x);
|
||||||
|
|
||||||
/* Debug Display */
|
/* Debug Display */
|
||||||
if ((probe->flag & LIGHTPROBE_FLAG_SHOW_DATA) != 0) {
|
if (DRW_state_draw_support() && (probe->flag & LIGHTPROBE_FLAG_SHOW_DATA)) {
|
||||||
struct Gwn_Batch *geom = DRW_cache_sphere_get();
|
struct Gwn_Batch *geom = DRW_cache_sphere_get();
|
||||||
DRWShadingGroup *grp = DRW_shgroup_instance_create(e_data.probe_grid_display_sh, psl->probe_display, geom);
|
DRWShadingGroup *grp = DRW_shgroup_instance_create(e_data.probe_grid_display_sh, psl->probe_display, geom);
|
||||||
DRW_shgroup_set_instance_count(grp, ped->num_cell);
|
DRW_shgroup_set_instance_count(grp, ped->num_cell);
|
||||||
|
|||||||
@@ -386,6 +386,7 @@ bool DRW_state_is_depth(void);
|
|||||||
bool DRW_state_is_image_render(void);
|
bool DRW_state_is_image_render(void);
|
||||||
bool DRW_state_is_scene_render(void);
|
bool DRW_state_is_scene_render(void);
|
||||||
bool DRW_state_show_text(void);
|
bool DRW_state_show_text(void);
|
||||||
|
bool DRW_state_draw_support(void);
|
||||||
|
|
||||||
struct DRWTextStore *DRW_state_text_cache_get(void);
|
struct DRWTextStore *DRW_state_text_cache_get(void);
|
||||||
|
|
||||||
|
|||||||
@@ -2749,14 +2749,12 @@ static void DRW_engines_enable_external(void)
|
|||||||
use_drw_engine(DRW_engine_viewport_external_type.draw_engine);
|
use_drw_engine(DRW_engine_viewport_external_type.draw_engine);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void DRW_engines_enable(const Scene *scene, SceneLayer *sl, const View3D *v3d)
|
static void DRW_engines_enable(const Scene *scene, SceneLayer *sl)
|
||||||
{
|
{
|
||||||
const int mode = CTX_data_mode_enum_ex(scene->obedit, OBACT_NEW);
|
const int mode = CTX_data_mode_enum_ex(scene->obedit, OBACT_NEW);
|
||||||
DRW_engines_enable_from_engine(scene);
|
DRW_engines_enable_from_engine(scene);
|
||||||
|
|
||||||
if ((DRW_state_is_scene_render() == false) &&
|
if (DRW_state_draw_support()) {
|
||||||
(v3d->flag2 & V3D_RENDER_OVERRIDE) == 0)
|
|
||||||
{
|
|
||||||
DRW_engines_enable_from_object_mode();
|
DRW_engines_enable_from_object_mode();
|
||||||
DRW_engines_enable_from_mode(mode);
|
DRW_engines_enable_from_mode(mode);
|
||||||
}
|
}
|
||||||
@@ -2976,7 +2974,7 @@ void DRW_draw_render_loop_ex(
|
|||||||
v3d->zbuf = true;
|
v3d->zbuf = true;
|
||||||
|
|
||||||
/* Get list of enabled engines */
|
/* Get list of enabled engines */
|
||||||
DRW_engines_enable(scene, sl, v3d);
|
DRW_engines_enable(scene, sl);
|
||||||
|
|
||||||
/* Setup viewport */
|
/* Setup viewport */
|
||||||
cache_is_dirty = GPU_viewport_cache_validate(DST.viewport, DRW_engines_get_hash());
|
cache_is_dirty = GPU_viewport_cache_validate(DST.viewport, DRW_engines_get_hash());
|
||||||
@@ -3366,6 +3364,18 @@ bool DRW_state_show_text(void)
|
|||||||
(DST.options.is_scene_render) == 0;
|
(DST.options.is_scene_render) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Should draw support elements
|
||||||
|
* Objects center, selection outline, probe data, ...
|
||||||
|
*/
|
||||||
|
bool DRW_state_draw_support(void)
|
||||||
|
{
|
||||||
|
View3D *v3d = DST.draw_ctx.v3d;
|
||||||
|
return (DRW_state_is_scene_render() == false) &&
|
||||||
|
(v3d != NULL) &&
|
||||||
|
((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0);
|
||||||
|
}
|
||||||
|
|
||||||
/** \} */
|
/** \} */
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user