Fix T74898: Multiresolution Ghost After Orbiting
EEVEE and Workbench both had the same issue that they continue with the last sample when leaving navigating. This is ok for regular meshes as they are all the same. For multiresolution it ain't as a low res version of the mesh is used during navigation. This patch also resets the AA samples when the user leaves navigation.
This commit is contained in:
parent
24f8c8491d
commit
039d619c76
Notes:
blender-bot
2023-02-13 23:08:09 +01:00
Referenced by issue #74898, Multiresolution ghost after orbiting
|
@ -600,6 +600,7 @@ typedef struct EEVEE_EffectsInfo {
|
|||
int taa_total_sample;
|
||||
float taa_alpha;
|
||||
bool prev_drw_support;
|
||||
bool prev_is_navigating;
|
||||
float prev_drw_persmat[4][4];
|
||||
struct DRWView *taa_view;
|
||||
/* Ambient Occlusion */
|
||||
|
|
|
@ -244,8 +244,10 @@ int EEVEE_temporal_sampling_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data
|
|||
copy_m4_m4(effects->prev_drw_persmat, persmat);
|
||||
|
||||
/* Prevent ghosting from probe data. */
|
||||
view_is_valid = view_is_valid && (effects->prev_drw_support == DRW_state_draw_support());
|
||||
view_is_valid = view_is_valid && (effects->prev_drw_support == DRW_state_draw_support()) &&
|
||||
(effects->prev_is_navigating == DRW_state_is_navigating());
|
||||
effects->prev_drw_support = DRW_state_draw_support();
|
||||
effects->prev_is_navigating = DRW_state_is_navigating();
|
||||
|
||||
if (((effects->taa_total_sample == 0) ||
|
||||
(effects->taa_current_sample < effects->taa_total_sample)) ||
|
||||
|
|
|
@ -182,7 +182,7 @@ void workbench_private_data_init(WORKBENCH_PrivateData *wpd)
|
|||
WORKBENCH_ViewLayerData *vldata = workbench_view_layer_data_ensure_ex(draw_ctx->view_layer);
|
||||
|
||||
wpd->is_playback = DRW_state_is_playback();
|
||||
wpd->is_navigating = rv3d && (rv3d->rflag & (RV3D_NAVIGATING | RV3D_PAINTING));
|
||||
wpd->is_navigating = DRW_state_is_navigating();
|
||||
|
||||
wpd->ctx_mode = CTX_data_mode_enum_ex(
|
||||
draw_ctx->object_edit, draw_ctx->obact, draw_ctx->object_mode);
|
||||
|
|
|
@ -168,10 +168,17 @@ void workbench_antialiasing_engine_init(WORKBENCH_Data *vedata)
|
|||
|
||||
wpd->view = NULL;
|
||||
|
||||
/* reset complete drawing when navigating or during viewport playback. */
|
||||
/* Reset complete drawing when navigating or during viewport playback or when
|
||||
* leaving one of those states. In case of multires modifier the navigation
|
||||
* mesh differs from the viewport mesh, so we need to be sure to restart. */
|
||||
if (wpd->taa_sample != 0) {
|
||||
if (wpd->is_navigating || wpd->is_playback) {
|
||||
wpd->taa_sample = 0;
|
||||
wpd->reset_next_sample = true;
|
||||
}
|
||||
else if (wpd->reset_next_sample) {
|
||||
wpd->taa_sample = 0;
|
||||
wpd->reset_next_sample = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -333,6 +333,7 @@ typedef struct WORKBENCH_PrivateData {
|
|||
bool dof_enabled;
|
||||
bool is_playback;
|
||||
bool is_navigating;
|
||||
bool reset_next_sample;
|
||||
} WORKBENCH_PrivateData; /* Transient data */
|
||||
|
||||
typedef struct WORKBENCH_ObjectData {
|
||||
|
|
|
@ -670,6 +670,7 @@ bool DRW_state_do_color_management(void);
|
|||
bool DRW_state_is_scene_render(void);
|
||||
bool DRW_state_is_opengl_render(void);
|
||||
bool DRW_state_is_playback(void);
|
||||
bool DRW_state_is_navigating(void);
|
||||
bool DRW_state_show_text(void);
|
||||
bool DRW_state_draw_support(void);
|
||||
bool DRW_state_draw_background(void);
|
||||
|
|
|
@ -2574,6 +2574,15 @@ bool DRW_state_is_playback(void)
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is the user navigating the region.
|
||||
*/
|
||||
bool DRW_state_is_navigating(void)
|
||||
{
|
||||
const RegionView3D *rv3d = DST.draw_ctx.rv3d;
|
||||
return (rv3d) && (rv3d->rflag & (RV3D_NAVIGATING | RV3D_PAINTING));
|
||||
}
|
||||
|
||||
/**
|
||||
* Should text draw in this mode?
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue