mirror of
https://github.com/izzy2lost/2ship2harkinian-Android.git
synced 2026-06-19 01:20:08 -07:00
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:
committed by
Garrett Cox
co-authored by
Garrett Cox
parent
fc5efd4283
commit
acad9da04f
@@ -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) {
|
||||
|
||||
@@ -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++);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user