Eevee: Fix wrong SSR reprojection when switching orthographic view

We just reset the temporal sampling and avoid using the previous frame
for SSR at all.
This commit is contained in:
Clément Foucault 2018-07-20 22:43:30 +02:00
parent 3005c2e2be
commit a1689fb091
Notes: blender-bot 2023-02-14 08:06:35 +01:00
Referenced by issue #56107, Moving keyframe in DopeSheet = crash
Referenced by issue #56076, Crash when increasing shadow map resolution with EEVEE
Referenced by issue #56077, 3D cursor moving Crash
Referenced by issue #56081, make static override on a linked collection will crash blender
Referenced by issue #56068, Basic Vorkflov not vorking
Referenced by issue #56069, crash 2.8 selection to cursor
Referenced by issue #56011, Crash dragging Cursor tool and hitting S (scale)
3 changed files with 15 additions and 0 deletions

View File

@ -515,6 +515,7 @@ typedef struct EEVEE_EffectsInfo {
int volume_current_sample;
/* SSR */
bool reflection_trace_full;
bool ssr_was_persp;
int ssr_neighbor_ofs;
int ssr_halfres_ofs[2];
struct GPUTexture *ssr_normal_input; /* Textures from pool */
@ -908,6 +909,7 @@ void EEVEE_mist_output_accumulate(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedat
void EEVEE_mist_free(void);
/* eevee_temporal_sampling.c */
void EEVEE_temporal_sampling_reset(EEVEE_Data *vedata);
int EEVEE_temporal_sampling_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata);
void EEVEE_temporal_sampling_matrices_calc(
EEVEE_EffectsInfo *effects, float viewmat[4][4], float persmat[4][4], const double ht_point[2]);

View File

@ -132,6 +132,14 @@ int EEVEE_screen_raytrace_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
});
}
const bool is_persp = DRW_viewport_is_persp_get();
if (effects->ssr_was_persp != is_persp) {
effects->ssr_was_persp = is_persp;
DRW_viewport_request_redraw();
EEVEE_temporal_sampling_reset(vedata);
stl->g_data->valid_double_buffer = false;
}
effects->reflection_trace_full = (scene_eval->eevee.flag & SCE_EEVEE_SSR_HALF_RESOLUTION) == 0;
common_data->ssr_thickness = scene_eval->eevee.ssr_thickness;
common_data->ssr_border_fac = scene_eval->eevee.ssr_border_fade;

View File

@ -174,6 +174,11 @@ void EEVEE_temporal_sampling_matrices_calc(
invert_m4_m4(effects->overide_wininv, effects->overide_winmat);
}
void EEVEE_temporal_sampling_reset(EEVEE_Data *vedata)
{
vedata->stl->effects->taa_render_sample = 1;
}
int EEVEE_temporal_sampling_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *vedata)
{
EEVEE_StorageList *stl = vedata->stl;