Workbench: Fix TAA logic
Having both TAA and FXAA enabled at the same time resulted in conflicts. The jitter_index was incremented twice before being used instead of once.
This commit is contained in:
parent
774022260a
commit
657165db94
|
@ -49,6 +49,7 @@ void workbench_aa_create_pass(WORKBENCH_Data *vedata, GPUTexture **tx)
|
|||
}
|
||||
else {
|
||||
psl->effect_aa_pass = NULL;
|
||||
effect_info->jitter_index = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -243,7 +243,7 @@ void workbench_taa_draw_scene_start(WORKBENCH_Data *vedata)
|
|||
|
||||
const int jitter_index = effect_info->jitter_index;
|
||||
const float *transform_offset = samples[jitter_index];
|
||||
effect_info->taa_mix_factor = 1.0f / (effect_info->jitter_index + 1);
|
||||
effect_info->taa_mix_factor = 1.0f / (jitter_index + 1);
|
||||
effect_info->jitter_index = (jitter_index + 1) % num_samples;
|
||||
|
||||
/* construct new matrices from transform delta */
|
||||
|
|
|
@ -326,7 +326,8 @@ BLI_INLINE bool workbench_is_taa_enabled(WORKBENCH_PrivateData *wpd)
|
|||
}
|
||||
}
|
||||
else {
|
||||
return wpd->preferences->viewport_aa > SCE_DISPLAY_AA_FXAA && !wpd->is_playback;
|
||||
return !(IS_NAVIGATING(wpd) || wpd->is_playback) &&
|
||||
wpd->preferences->viewport_aa > SCE_DISPLAY_AA_FXAA;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -346,8 +347,9 @@ BLI_INLINE bool workbench_is_fxaa_enabled(WORKBENCH_PrivateData *wpd)
|
|||
return true;
|
||||
}
|
||||
|
||||
/* when navigating or animation playback use FXAA. */
|
||||
return (IS_NAVIGATING(wpd) || wpd->is_playback) && workbench_is_taa_enabled(wpd);
|
||||
/* when navigating or animation playback use FXAA if scene uses TAA. */
|
||||
return (IS_NAVIGATING(wpd) || wpd->is_playback) &&
|
||||
wpd->preferences->viewport_aa > SCE_DISPLAY_AA_FXAA;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue