Add option to interpolate motion blur (#405)

* add option to interpolate motion blur

* Update mm/2s2h/Enhancements/Graphics/MotionBlur.cpp

Co-authored-by: Garrett Cox <garrettjcox@gmail.com>

---------

Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
This commit is contained in:
Archez
2024-05-22 09:05:05 -05:00
committed by Garrett Cox
co-authored by Garrett Cox
parent fc5efd4283
commit acad9da04f
2 changed files with 9 additions and 2 deletions
@@ -14,6 +14,12 @@ void MotionBlur_RenderMenuOptions() {
UIWidgets::CVarCombobox("Motion Blur Mode", "gEnhancements.Graphics.MotionBlur.Mode", motionBlurOptions, {
.labelPosition = UIWidgets::LabelPosition::None,
});
UIWidgets::CVarCheckbox(
"Interpolate", "gEnhancements.Graphics.MotionBlur.Interpolate",
{ .tooltip = "Change motion blur capture to also happen on interpolated frames instead of only on game frames.\n"
"This notably reduces the overall motion blur strength but smooths out the trails." });
if (CVarGetInteger("gEnhancements.Graphics.MotionBlur.Mode", 0) == 0) {
UIWidgets::Checkbox("On/Off", (bool*)&R_MOTION_BLUR_ENABLED);
if (R_MOTION_BLUR_ENABLED) {
+3 -2
View File
@@ -117,9 +117,10 @@ void Play_DrawMotionBlur(PlayState* this) {
}
hasCopiedForFrame = false;
u8 interpolate = CVarGetInteger("gEnhancements.Graphics.MotionBlur.Interpolate", 0);
// 2S2H [Port] Copy framebuffer only once per game frame to exclude motion blur from interpolation
FB_CopyToFramebuffer(&gfx, 0, gBlurFrameBuffer, true, &hasCopiedForFrame);
// 2S2H [Port] Copy framebuffer, either once per game frame or all frames depending on interpolation setting
FB_CopyToFramebuffer(&gfx, 0, gBlurFrameBuffer, !interpolate, &hasCopiedForFrame);
gSPEndDisplayList(gfx++);