mirror of
https://github.com/Mr-Wiseguy/Zelda64Recomp.git
synced 2024-11-26 06:34:20 +01:00
Clamp alpha for blur effect to mitigate image retention
This commit is contained in:
parent
20c999e579
commit
7ff1c194e0
@ -92,7 +92,14 @@ void Play_DrawMotionBlur(PlayState* this) {
|
|||||||
|
|
||||||
// @recomp Scale alpha based on the target framerate so that the blur effect decays at an equivalent rate
|
// @recomp Scale alpha based on the target framerate so that the blur effect decays at an equivalent rate
|
||||||
// to how it does in the original game's framerate.
|
// to how it does in the original game's framerate.
|
||||||
alpha = (s32)(recomp_powf(alpha / 255.0f, 20.0f / recomp_get_target_framerate(gFramerateDivisor)) * 255.0f);
|
s32 original_alpha = alpha;
|
||||||
|
f32 exponent = 20.0f / recomp_get_target_framerate(gFramerateDivisor);
|
||||||
|
f32 alpha_float = recomp_powf(alpha / 255.0f, exponent);
|
||||||
|
// Clamp to an alpha of 0.9, which ensures that the output color converges to within a reasonable delta
|
||||||
|
// of the target color when using an R8G8B8A8 framebuffer as RT64 currently does.
|
||||||
|
// Not clamping leads to image retention at high framerates.
|
||||||
|
alpha_float = MIN(alpha_float, 0.9f);
|
||||||
|
alpha = (s32)(alpha_float * 255.0f);
|
||||||
|
|
||||||
if (sMotionBlurStatus == MOTION_BLUR_PROCESS) {
|
if (sMotionBlurStatus == MOTION_BLUR_PROCESS) {
|
||||||
func_80170AE0(&this->pauseBgPreRender, &gfx, alpha);
|
func_80170AE0(&this->pauseBgPreRender, &gfx, alpha);
|
||||||
|
Loading…
Reference in New Issue
Block a user