by using a separate fullscreen fb for blur effects
This commit is contained in:
fgsfds committed 2023-11-12 15:05:21 +01:00
1 parent eecee9d940
commit 83a155fa49
3 files changed
+14 -11

No files matched your search

+8 -6
View File
@@ -102,7 +102,8 @@ OSScMsg g_SchedRspMsg = {OS_SC_RSP_MSG};
bool g_SchedIsFirstTask = true;
s32 g_PrevFrameFb = -1;
s32 g_PrevFrameCapTimer = -1;
s32 g_BlurFb = -1;
s32 g_BlurFbCapTimer = -1;
void schedSetCrashEnable1(bool enable)
{
@@ -180,6 +181,7 @@ void osCreateScheduler(OSSched *sc, OSThread *thread, u8 mode, u32 numFields)
schedInitCrashLastRendered();
g_PrevFrameFb = videoCreateFramebuffer(0, 0, false, true);
g_BlurFb = videoCreateFramebuffer(0, 0, false, true);
}
void osScAddClient(OSSched *sc, OSScClient *c, OSMesgQueue *msgQ, bool is30fps)
@@ -385,11 +387,11 @@ void schedConsiderScreenshot(void)
g_MenuData.screenshottimer = 0;
}
if (g_PrevFrameCapTimer == 0) {
videoCopyFramebuffer(g_PrevFrameFb, 0, -1, -1);
g_PrevFrameCapTimer = -1;
} else if (g_PrevFrameCapTimer > 0) {
--g_PrevFrameCapTimer;
if (g_BlurFbCapTimer == 0) {
videoCopyFramebuffer(g_BlurFb, 0, -1, -1);
g_BlurFbCapTimer = -1;
} else if (g_BlurFbCapTimer > 0) {
--g_BlurFbCapTimer;
}
if (g_MenuData.screenshottimer >= 2) {
+4 -4
View File
@@ -307,12 +307,12 @@ Gfx *bviewDrawMotionBlur(Gfx *gdl, u32 colour, u32 alpha)
somefloat += 1.0f / fyyy;
}
#else
gDPSetFramebufferTextureEXT(gdl++, 0, 0, 0, g_PrevFrameFb);
gDPSetFramebufferTextureEXT(gdl++, 0, 0, 0, g_BlurFb);
gSPImageRectangleEXT(gdl++,
viewleft << 2, viewtop << 2, viewleft, viewtop,
(viewleft + viewwidth) << 2, (viewtop + viewheight) << 2, viewleft + viewwidth, viewtop + viewheight,
0, videoGetNativeWidth(), videoGetNativeHeight());
g_PrevFrameCapTimer = 0;
g_BlurFbCapTimer = 0;
#endif
return gdl;
@@ -545,12 +545,12 @@ Gfx *bviewDrawZoomBlur(Gfx *gdl, u32 colour, s32 alpha, f32 arg3, f32 arg4)
const s32 top = ycenter - halfh;
const s32 right = xcenter + halfw;
const s32 bottom = ycenter + halfh;
gDPSetFramebufferTextureEXT(gdl++, 0, 0, 0, g_PrevFrameFb);
gDPSetFramebufferTextureEXT(gdl++, 0, 0, 0, g_BlurFb);
gSPImageRectangleEXT(gdl++,
left << 2, top << 2, viewleft, viewtop,
right << 2, bottom << 2, viewleft + viewwidth, viewtop + viewheight,
0, videoGetNativeWidth(), videoGetNativeHeight());
g_PrevFrameCapTimer = 0;
g_BlurFbCapTimer = 0;
#endif
return gdl;
+2 -1
View File
@@ -543,7 +543,8 @@ extern s32 g_HudCenter;
extern u32 g_HudAlignModeL;
extern u32 g_HudAlignModeR;
extern s32 g_PrevFrameFb;
extern s32 g_PrevFrameCapTimer;
extern s32 g_BlurFb;
extern s32 g_BlurFbCapTimer;
#define PLAYER_EXTCFG() g_PlayerExtCfg[g_Vars.currentplayerstats->mpindex & 3]
#define PLAYER_DEFAULT_FOV (PLAYER_EXTCFG().fovy)