Add Bloom Effect Smoothing hack

This commit is contained in:
Luna 2015-01-23 02:08:20 +01:00
parent cae58cafee
commit 722d34e09a
6 changed files with 84 additions and 4 deletions

View File

@ -453,6 +453,7 @@ static ConfigSetting graphicsSettings[] = {
ReportedConfigSetting("DisableStencilTest", &g_Config.bDisableStencilTest, false, true, true),
ReportedConfigSetting("AlwaysDepthWrite", &g_Config.bAlwaysDepthWrite, false, true, true),
ReportedConfigSetting("DepthRangeHack", &g_Config.bDepthRangeHack, false, true, true),
ReportedConfigSetting("BloomHack", &g_Config.iBloomHack, 0, true, true),
// Not really a graphics setting...
ReportedConfigSetting("TimerHack", &g_Config.bTimerHack, &DefaultTimerHack, true, true),

View File

@ -174,6 +174,7 @@ public:
bool bDisableStencilTest;
bool bAlwaysDepthWrite;
bool bDepthRangeHack;
int iBloomHack; //0 = off, 1 = safe, 2 = balanced, 3 = aggressive
bool bTimerHack;
bool bAlphaMaskHack;
bool bBlockTransferGPU;

View File

@ -378,8 +378,44 @@ namespace DX9 {
vfb->bufferHeight = std::max(vfb->bufferHeight, h);
}
vfb->renderWidth = vfb->bufferWidth * renderWidthFactor;
vfb->renderHeight = vfb->bufferHeight * renderHeightFactor;
if (g_Config.iInternalResolution == 1) {
vfb->renderWidth = vfb->bufferWidth * renderWidthFactor;
vfb->renderHeight = vfb->bufferHeight * renderHeightFactor;
} else {
switch (g_Config.iBloomHack) {
case 0:
vfb->renderWidth = vfb->bufferWidth * renderWidthFactor;
vfb->renderHeight = vfb->bufferHeight * renderHeightFactor;
break;
case 1:
if (vfb->bufferWidth <= 128 || vfb->bufferHeight <= 64) {
vfb->renderWidth = vfb->bufferWidth;
vfb->renderHeight = vfb->bufferHeight;
} else {
vfb->renderWidth = vfb->bufferWidth * renderWidthFactor;
vfb->renderHeight = vfb->bufferHeight * renderHeightFactor;
}
break;
case 2:
if (vfb->bufferWidth <= 256 || vfb->bufferHeight <= 128) {
vfb->renderWidth = vfb->bufferWidth;
vfb->renderHeight = vfb->bufferHeight;
} else {
vfb->renderWidth = vfb->bufferWidth * renderWidthFactor;
vfb->renderHeight = vfb->bufferHeight * renderHeightFactor;
}
break;
case 3:
if (vfb->bufferWidth < 480 || vfb->bufferHeight < 272) {
vfb->renderWidth = vfb->bufferWidth;
vfb->renderHeight = vfb->bufferHeight;
} else {
vfb->renderWidth = vfb->bufferWidth * renderWidthFactor;
vfb->renderHeight = vfb->bufferHeight * renderHeightFactor;
}
break;
}
}
bool trueColor = g_Config.bTrueColor;
if (hackForce04154000Download_ && vfb->fb_address == 0x00154000) {

View File

@ -667,8 +667,44 @@ void FramebufferManager::ResizeFramebufFBO(VirtualFramebuffer *vfb, u16 w, u16 h
vfb->bufferHeight = std::max(vfb->bufferHeight, h);
}
vfb->renderWidth = vfb->bufferWidth * renderWidthFactor;
vfb->renderHeight = vfb->bufferHeight * renderHeightFactor;
if (g_Config.iInternalResolution==1) {
vfb->renderWidth = vfb->bufferWidth * renderWidthFactor;
vfb->renderHeight = vfb->bufferHeight * renderHeightFactor;
} else {
switch (g_Config.iBloomHack) {
case 0:
vfb->renderWidth = vfb->bufferWidth * renderWidthFactor;
vfb->renderHeight = vfb->bufferHeight * renderHeightFactor;
break;
case 1:
if (vfb->bufferWidth <= 128 || vfb->bufferHeight <= 64) {
vfb->renderWidth = vfb->bufferWidth;
vfb->renderHeight = vfb->bufferHeight;
} else {
vfb->renderWidth = vfb->bufferWidth * renderWidthFactor;
vfb->renderHeight = vfb->bufferHeight * renderHeightFactor;
}
break;
case 2:
if (vfb->bufferWidth <= 256 || vfb->bufferHeight <= 128) {
vfb->renderWidth = vfb->bufferWidth;
vfb->renderHeight = vfb->bufferHeight;
} else {
vfb->renderWidth = vfb->bufferWidth * renderWidthFactor;
vfb->renderHeight = vfb->bufferHeight * renderHeightFactor;
}
break;
case 3:
if (vfb->bufferWidth < 480 || vfb->bufferHeight < 272) {
vfb->renderWidth = vfb->bufferWidth;
vfb->renderHeight = vfb->bufferHeight;
} else {
vfb->renderWidth = vfb->bufferWidth * renderWidthFactor;
vfb->renderHeight = vfb->bufferHeight * renderHeightFactor;
}
break;
}
}
bool trueColor = g_Config.bTrueColor;
if (hackForce04154000Download_ && vfb->fb_address == 0x00154000) {

View File

@ -287,6 +287,11 @@ void GameSettingsScreen::CreateViews() {
CheckBox *depthRange = graphicsSettings->Add(new CheckBox(&g_Config.bDepthRangeHack, gs->T("Depth Range Hack (Phantasy Star Portable 2)")));
depthRange->SetDisabledPtr(&g_Config.bSoftwareRendering);
static const char *bloomHackOptions[] = { "Off", "Safe", "Balanced", "Aggressive" };
PopupMultiChoice *bloomHack = graphicsSettings->Add(new PopupMultiChoice(&g_Config.iBloomHack, gs->T("Bloom Effect Smoothing"), bloomHackOptions, 0, ARRAY_SIZE(bloomHackOptions), gs, screenManager()));
bloomHackEnable_ = !g_Config.bSoftwareRendering && (g_Config.iInternalResolution != 1);
bloomHack->SetEnabledPtr(&bloomHackEnable_);
graphicsSettings->Add(new ItemHeader(gs->T("Overlay Information")));
static const char *fpsChoices[] = {
"None", "Speed", "FPS", "Both"

View File

@ -105,6 +105,7 @@ private:
bool vtxCacheEnable_;
bool postProcEnable_;
bool resolutionEnable_;
bool bloomHackEnable_;
};
class DeveloperToolsScreen : public UIDialogScreenWithBackground {