OpenGL Renderer: Replace the accuracy/performance tradeoff "Enable Depth Equals Test Tolerance" with "Enable NDS-Style Depth Calculation", where disabling this option allows the host GPU to natively calculate depth which significantly improves performance in many games.

- New Behavior: In addition to emulating the existing Depth Equals Test Tolerance, NDS-Style Depth Calculation accounts for all NDS depth calculations within the fragment shader. Most notably, disabling this option forgoes the W-depth / Z-depth differentiation that the NDS uses, instead preferring the GPU's native Z-depth calculation. Using the GPU's native depth calculation significantly improves performance, but many games use W-depth calculations or are sensitive to subtleties in the Z-depth calculation, and so this option must remain ON by default for compatibility's sake.
- Also fixes a shader initialization issue on the Windows port. (Regression from commit 7080e21.)
This commit is contained in:
rogerman 2018-12-18 10:50:41 -08:00
parent 7080e2156b
commit 37afaefa2f
13 changed files with 89540 additions and 91340 deletions

View File

@ -507,7 +507,7 @@ extern struct TCommonSettings
, GFX3D_TXTHack(false)
, OpenGL_Emulation_ShadowPolygon(true)
, OpenGL_Emulation_SpecialZeroAlphaBlending(true)
, OpenGL_Emulation_DepthEqualsTestTolerance(true)
, OpenGL_Emulation_NDSDepthCalculation(true)
, OpenGL_Emulation_DepthLEqualPolygonFacing(false)
, jit_max_block_size(12)
, loadToMemory(false)
@ -569,7 +569,7 @@ extern struct TCommonSettings
bool OpenGL_Emulation_ShadowPolygon;
bool OpenGL_Emulation_SpecialZeroAlphaBlending;
bool OpenGL_Emulation_DepthEqualsTestTolerance;
bool OpenGL_Emulation_NDSDepthCalculation;
bool OpenGL_Emulation_DepthLEqualPolygonFacing;
bool loadToMemory;

View File

@ -328,25 +328,15 @@ void main()\n\
vec4 newPolyID = vec4(0.0, 0.0, 0.0, 0.0);\n\
vec4 newFogAttributes = vec4(0.0, 0.0, 0.0, 0.0);\n\
\n\
#if USE_NDS_DEPTH_CALCULATION || USE_DEPTH_EQUALS_TOLERANCE || ENABLE_FOG\n\
#if ENABLE_W_DEPTH\n\
#if USE_DEPTH_EQUALS_TOLERANCE\n\
#if USE_NDS_DEPTH_CALCULATION || ENABLE_FOG\n\
float depthOffset = (polyDepthOffsetMode == 0) ? 0.0 : ((polyDepthOffsetMode == 1) ? -DEPTH_EQUALS_TEST_TOLERANCE : DEPTH_EQUALS_TEST_TOLERANCE);\n\
\n\
#if ENABLE_W_DEPTH\n\
float newFragDepthValue = clamp( ( (vtxPosition.w * 4096.0) + depthOffset ) / 16777215.0, 0.0, 1.0 );\n\
#else\n\
float newFragDepthValue = clamp( (vtxPosition.w * 4096.0) / 16777215.0, 0.0, 1.0 );\n\
#endif\n\
#else\n\
float vertW = (vtxPosition.w == 0.0) ? 0.00000001 : vtxPosition.w;\n\
\n\
#if USE_DEPTH_EQUALS_TOLERANCE\n\
float depthOffset = (polyDepthOffsetMode == 0) ? 0.0 : ((polyDepthOffsetMode == 1) ? -DEPTH_EQUALS_TEST_TOLERANCE : DEPTH_EQUALS_TEST_TOLERANCE);\n\
// hack: when using z-depth, drop some LSBs so that the overworld map in Dragon Quest IV shows up correctly\n\
float newFragDepthValue = clamp( ( (floor(((vtxPosition.z/vertW) * 0.5 + 0.5) * 4194303.0) * 4.0) + depthOffset ) / 16777215.0, 0.0, 1.0 );\n\
#else\n\
// hack: when using z-depth, drop some LSBs so that the overworld map in Dragon Quest IV shows up correctly\n\
float newFragDepthValue = clamp( (floor(((vtxPosition.z/vertW) * 0.5 + 0.5) * 4194303.0) * 4.0) / 16777215.0, 0.0, 1.0 );\n\
#endif\n\
#endif\n\
#endif\n\
\n\
@ -413,7 +403,7 @@ void main()\n\
gl_FragData[1] = newPolyID;\n\
gl_FragData[2] = newFogAttributes;\n\
\n\
#if USE_NDS_DEPTH_CALCULATION || USE_DEPTH_EQUALS_TOLERANCE || ENABLE_FOG\n\
#if USE_NDS_DEPTH_CALCULATION || ENABLE_FOG\n\
gl_FragDepth = newFragDepthValue;\n\
#endif\n\
}\n\
@ -1307,7 +1297,6 @@ OpenGLRenderer::OpenGLRenderer()
_emulateShadowPolygon = true;
_emulateSpecialZeroAlphaBlending = true;
_emulateNDSDepthCalculation = true;
_emulateDepthEqualsTestTolerance = true;
_emulateDepthLEqualPolygonFacing = false;
// Init OpenGL rendering states
@ -2027,7 +2016,7 @@ Render3DError OpenGLRenderer::DrawAlphaTexturePolygon(const GLenum polyPrimitive
if (this->isShaderSupported)
{
if ((DRAWMODE != OGLPolyDrawMode_ZeroAlphaPass) && performDepthEqualTest && this->_emulateDepthEqualsTestTolerance)
if ((DRAWMODE != OGLPolyDrawMode_ZeroAlphaPass) && performDepthEqualTest && this->_emulateNDSDepthCalculation)
{
if (DRAWMODE == OGLPolyDrawMode_DrawTranslucentPolys)
{
@ -2263,7 +2252,7 @@ Render3DError OpenGLRenderer::DrawOtherPolygon(const GLenum polyPrimitive,
{
OGLRenderRef &OGLRef = *this->ref;
if ((DRAWMODE != OGLPolyDrawMode_ZeroAlphaPass) && performDepthEqualTest && this->_emulateDepthEqualsTestTolerance && this->isShaderSupported)
if ((DRAWMODE != OGLPolyDrawMode_ZeroAlphaPass) && performDepthEqualTest && this->_emulateNDSDepthCalculation && this->isShaderSupported)
{
glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
glDepthMask(GL_FALSE);
@ -2373,14 +2362,12 @@ Render3DError OpenGLRenderer::ApplyRenderingSettings(const GFX3D_State &renderSt
Render3DError error = RENDER3DERROR_NOERR;
const bool didSelectedMultisampleSizeChange = (this->_selectedMultisampleSize != CommonSettings.GFX3D_Renderer_MultisampleSize);
//const bool didEmulateNDSDepthCalculationChange = (this->_emulateNDSDepthCalculation != CommonSettings.OpenGL_Emulation_NDSDepthCalculation);
const bool didEmulateDepthEqualsToleranceChange = (this->_emulateDepthEqualsTestTolerance != CommonSettings.OpenGL_Emulation_DepthEqualsTestTolerance);
const bool didEmulateNDSDepthCalculationChange = (this->_emulateNDSDepthCalculation != CommonSettings.OpenGL_Emulation_NDSDepthCalculation);
const bool didEnableTextureSmoothingChange = (this->_enableTextureSmoothing != CommonSettings.GFX3D_Renderer_TextureSmoothing);
this->_emulateShadowPolygon = CommonSettings.OpenGL_Emulation_ShadowPolygon;
this->_emulateSpecialZeroAlphaBlending = CommonSettings.OpenGL_Emulation_SpecialZeroAlphaBlending;
//this->_emulateNDSDepthCalculation = CommonSettings.OpenGL_Emulation_NDSDepthCalculation;
this->_emulateDepthEqualsTestTolerance = CommonSettings.OpenGL_Emulation_DepthEqualsTestTolerance;
this->_emulateNDSDepthCalculation = CommonSettings.OpenGL_Emulation_NDSDepthCalculation;
this->_emulateDepthLEqualPolygonFacing = CommonSettings.OpenGL_Emulation_DepthLEqualPolygonFacing;
this->_selectedMultisampleSize = CommonSettings.GFX3D_Renderer_MultisampleSize;
@ -2393,8 +2380,7 @@ Render3DError OpenGLRenderer::ApplyRenderingSettings(const GFX3D_State &renderSt
}
if (didSelectedMultisampleSizeChange ||
//didEmulateNDSDepthCalculationChange ||
didEmulateDepthEqualsToleranceChange ||
didEmulateNDSDepthCalculationChange ||
didEnableTextureSmoothingChange )
{
if (!BEGINGL())
@ -2409,8 +2395,7 @@ Render3DError OpenGLRenderer::ApplyRenderingSettings(const GFX3D_State &renderSt
}
if ( this->isShaderSupported &&
(//didEmulateNDSDepthCalculationChange ||
didEmulateDepthEqualsToleranceChange ||
(didEmulateNDSDepthCalculationChange ||
didEnableTextureSmoothingChange) )
{
glUseProgram(0);
@ -2521,6 +2506,12 @@ Render3DError OpenGLRenderer_1_2::InitExtensions()
if ( (maxDrawBuffersOGL >= 4) && (maxShaderTexUnitsOGL >= 8) )
{
this->_enableTextureSmoothing = CommonSettings.GFX3D_Renderer_TextureSmoothing;
this->_emulateShadowPolygon = CommonSettings.OpenGL_Emulation_ShadowPolygon;
this->_emulateSpecialZeroAlphaBlending = CommonSettings.OpenGL_Emulation_SpecialZeroAlphaBlending;
this->_emulateNDSDepthCalculation = CommonSettings.OpenGL_Emulation_NDSDepthCalculation;
this->_emulateDepthLEqualPolygonFacing = CommonSettings.OpenGL_Emulation_DepthLEqualPolygonFacing;
error = this->CreateGeometryPrograms();
if (error == OGLERROR_NOERR)
{
@ -3158,7 +3149,6 @@ Render3DError OpenGLRenderer_1_2::CreateGeometryPrograms()
{
std::stringstream shaderFlags;
shaderFlags << "#define USE_TEXTURE_SMOOTHING " << ((this->_enableTextureSmoothing) ? 1 : 0) << "\n";
shaderFlags << "#define USE_DEPTH_EQUALS_TOLERANCE " << ((this->_emulateDepthEqualsTestTolerance) ? 1 : 0) << "\n";
shaderFlags << "#define USE_NDS_DEPTH_CALCULATION " << ((this->_emulateNDSDepthCalculation) ? 1 : 0) << "\n";
shaderFlags << "\n";
shaderFlags << "#define ENABLE_W_DEPTH " << ((programFlags.EnableWDepth) ? 1 : 0) << "\n";

View File

@ -646,7 +646,6 @@ protected:
bool _emulateShadowPolygon;
bool _emulateSpecialZeroAlphaBlending;
bool _emulateNDSDepthCalculation;
bool _emulateDepthEqualsTestTolerance;
bool _emulateDepthLEqualPolygonFacing;
FragmentColor *_mappedFramebuffer;

View File

@ -208,25 +208,15 @@ void main()\n\
vec4 newFogAttributes = vec4(0.0, 0.0, 0.0, 0.0);\n\
#endif\n\
\n\
#if USE_NDS_DEPTH_CALCULATION || USE_DEPTH_EQUALS_TOLERANCE || ENABLE_FOG\n\
#if ENABLE_W_DEPTH\n\
#if USE_DEPTH_EQUALS_TOLERANCE\n\
#if USE_NDS_DEPTH_CALCULATION || ENABLE_FOG\n\
float depthOffset = (polyDepthOffsetMode == 0) ? 0.0 : ((polyDepthOffsetMode == 1) ? -DEPTH_EQUALS_TEST_TOLERANCE : DEPTH_EQUALS_TEST_TOLERANCE);\n\
\n\
#if ENABLE_W_DEPTH\n\
float newFragDepthValue = clamp( ( (vtxPosition.w * 4096.0) + depthOffset ) / 16777215.0, 0.0, 1.0 );\n\
#else\n\
float newFragDepthValue = clamp( (vtxPosition.w * 4096.0) / 16777215.0, 0.0, 1.0 );\n\
#endif\n\
#else\n\
float vertW = (vtxPosition.w == 0.0) ? 0.00000001 : vtxPosition.w;\n\
\n\
#if USE_DEPTH_EQUALS_TOLERANCE\n\
float depthOffset = (polyDepthOffsetMode == 0) ? 0.0 : ((polyDepthOffsetMode == 1) ? -DEPTH_EQUALS_TEST_TOLERANCE : DEPTH_EQUALS_TEST_TOLERANCE);\n\
// hack: when using z-depth, drop some LSBs so that the overworld map in Dragon Quest IV shows up correctly\n\
float newFragDepthValue = clamp( ( (floor(((vtxPosition.z/vertW) * 0.5 + 0.5) * 4194303.0) * 4.0) + depthOffset ) / 16777215.0, 0.0, 1.0 );\n\
#else\n\
// hack: when using z-depth, drop some LSBs so that the overworld map in Dragon Quest IV shows up correctly\n\
float newFragDepthValue = clamp( (floor(((vtxPosition.z/vertW) * 0.5 + 0.5) * 4194303.0) * 4.0) / 16777215.0, 0.0, 1.0 );\n\
#endif\n\
#endif\n\
#endif\n\
\n\
@ -308,7 +298,7 @@ void main()\n\
#if ENABLE_FOG\n\
outFogAttributes = newFogAttributes;\n\
#endif\n\
#if USE_NDS_DEPTH_CALCULATION || USE_DEPTH_EQUALS_TOLERANCE || ENABLE_FOG\n\
#if USE_NDS_DEPTH_CALCULATION || ENABLE_FOG\n\
gl_FragDepth = newFragDepthValue;\n\
#endif\n\
}\n\
@ -900,6 +890,12 @@ Render3DError OpenGLRenderer_3_2::InitExtensions()
this->isSampleShadingSupported = this->IsExtensionPresent(&oglExtensionSet, "GL_ARB_sample_shading");
this->_enableTextureSmoothing = CommonSettings.GFX3D_Renderer_TextureSmoothing;
this->_emulateShadowPolygon = CommonSettings.OpenGL_Emulation_ShadowPolygon;
this->_emulateSpecialZeroAlphaBlending = CommonSettings.OpenGL_Emulation_SpecialZeroAlphaBlending;
this->_emulateNDSDepthCalculation = CommonSettings.OpenGL_Emulation_NDSDepthCalculation;
this->_emulateDepthLEqualPolygonFacing = CommonSettings.OpenGL_Emulation_DepthLEqualPolygonFacing;
error = this->CreateGeometryPrograms();
if (error != OGLERROR_NOERR)
{
@ -1389,7 +1385,6 @@ Render3DError OpenGLRenderer_3_2::CreateGeometryPrograms()
{
std::stringstream shaderFlags;
shaderFlags << "#define USE_TEXTURE_SMOOTHING " << ((this->_enableTextureSmoothing) ? 1 : 0) << "\n";
shaderFlags << "#define USE_DEPTH_EQUALS_TOLERANCE " << ((this->_emulateDepthEqualsTestTolerance) ? 1 : 0) << "\n";
shaderFlags << "#define USE_NDS_DEPTH_CALCULATION " << ((this->_emulateNDSDepthCalculation) ? 1 : 0) << "\n";
shaderFlags << "\n";
shaderFlags << "#define ENABLE_W_DEPTH " << ((programFlags.EnableWDepth) ? 1 : 0) << "\n";

View File

@ -868,7 +868,7 @@
<true/>
<key>Render3D_OpenGL_EmulateSpecialZeroAlphaBlending</key>
<true/>
<key>Render3D_OpenGL_EmulateDepthEqualTestTolerance</key>
<key>Render3D_OpenGL_EmulateNDSDepthCalculation</key>
<true/>
<key>Render3D_OpenGL_EmulateDepthLEqualPolygonFacing</key>
<false/>

View File

@ -169,7 +169,7 @@ typedef std::map<CGDirectDisplayID, int64_t> DisplayLinkFlushTimeLimitMap;
@property (assign) BOOL render3DFragmentSamplingHack;
@property (assign) BOOL openGLEmulateShadowPolygon;
@property (assign) BOOL openGLEmulateSpecialZeroAlphaBlending;
@property (assign) BOOL openGLEmulateDepthEqualsTestTolerance;
@property (assign) BOOL openGLEmulateNDSDepthCalculation;
@property (assign) BOOL openGLEmulateDepthLEqualPolygonFacing;
#ifdef ENABLE_SHARED_FETCH_OBJECT

View File

@ -123,7 +123,7 @@ public:
@dynamic render3DFragmentSamplingHack;
@dynamic openGLEmulateShadowPolygon;
@dynamic openGLEmulateSpecialZeroAlphaBlending;
@dynamic openGLEmulateDepthEqualsTestTolerance;
@dynamic openGLEmulateNDSDepthCalculation;
@dynamic openGLEmulateDepthLEqualPolygonFacing;
#ifdef ENABLE_SHARED_FETCH_OBJECT
@ -755,17 +755,17 @@ public:
return state;
}
- (void) setOpenGLEmulateDepthEqualsTestTolerance:(BOOL)state
- (void) setOpenGLEmulateNDSDepthCalculation:(BOOL)state
{
gpuEvent->ApplyRender3DSettingsLock();
CommonSettings.OpenGL_Emulation_DepthEqualsTestTolerance = (state) ? true : false;
CommonSettings.OpenGL_Emulation_NDSDepthCalculation = (state) ? true : false;
gpuEvent->ApplyRender3DSettingsUnlock();
}
- (BOOL) openGLEmulateDepthEqualsTestTolerance
- (BOOL) openGLEmulateNDSDepthCalculation
{
gpuEvent->ApplyRender3DSettingsLock();
const BOOL state = (CommonSettings.OpenGL_Emulation_DepthEqualsTestTolerance) ? YES : NO;
const BOOL state = (CommonSettings.OpenGL_Emulation_NDSDepthCalculation) ? YES : NO;
gpuEvent->ApplyRender3DSettingsUnlock();
return state;

View File

@ -963,7 +963,7 @@
[[NSUserDefaults standardUserDefaults] setBool:[[cdsCore cdsGPU] openGLEmulateShadowPolygon] forKey:@"Render3D_OpenGL_EmulateShadowPolygon"];
[[NSUserDefaults standardUserDefaults] setBool:[[cdsCore cdsGPU] openGLEmulateSpecialZeroAlphaBlending] forKey:@"Render3D_OpenGL_EmulateSpecialZeroAlphaBlending"];
[[NSUserDefaults standardUserDefaults] setBool:[[cdsCore cdsGPU] openGLEmulateDepthEqualsTestTolerance] forKey:@"Render3D_OpenGL_EmulateDepthEqualTestTolerance"];
[[NSUserDefaults standardUserDefaults] setBool:[[cdsCore cdsGPU] openGLEmulateNDSDepthCalculation] forKey:@"Render3D_OpenGL_EmulateNDSDepthCalculation"];
[[NSUserDefaults standardUserDefaults] setBool:[[cdsCore cdsGPU] openGLEmulateDepthLEqualPolygonFacing] forKey:@"Render3D_OpenGL_EmulateDepthLEqualPolygonFacing"];
[[NSUserDefaults standardUserDefaults] synchronize];
@ -2396,7 +2396,7 @@
[[cdsCore cdsGPU] setOpenGLEmulateShadowPolygon:[[NSUserDefaults standardUserDefaults] boolForKey:@"Render3D_OpenGL_EmulateShadowPolygon"]];
[[cdsCore cdsGPU] setOpenGLEmulateSpecialZeroAlphaBlending:[[NSUserDefaults standardUserDefaults] boolForKey:@"Render3D_OpenGL_EmulateSpecialZeroAlphaBlending"]];
[[cdsCore cdsGPU] setOpenGLEmulateDepthEqualsTestTolerance:[[NSUserDefaults standardUserDefaults] boolForKey:@"Render3D_OpenGL_EmulateDepthEqualTestTolerance"]];
[[cdsCore cdsGPU] setOpenGLEmulateNDSDepthCalculation:[[NSUserDefaults standardUserDefaults] boolForKey:@"Render3D_OpenGL_EmulateNDSDepthCalculation"]];
[[cdsCore cdsGPU] setOpenGLEmulateDepthLEqualPolygonFacing:[[NSUserDefaults standardUserDefaults] boolForKey:@"Render3D_OpenGL_EmulateDepthLEqualPolygonFacing"]];
[[[cdsCore cdsGPU] sharedData] fetchSynchronousAtIndex:0];

View File

@ -2374,7 +2374,7 @@ int _main()
CommonSettings.GFX3D_TXTHack = GetPrivateProfileBool("3D", "EnableTXTHack", 0, IniName); // Default is off.
CommonSettings.OpenGL_Emulation_ShadowPolygon = GetPrivateProfileBool("3D", "EnableShadowPolygon", 1, IniName);
CommonSettings.OpenGL_Emulation_SpecialZeroAlphaBlending = GetPrivateProfileBool("3D", "EnableSpecialZeroAlphaBlending", 1, IniName);
CommonSettings.OpenGL_Emulation_DepthEqualsTestTolerance = GetPrivateProfileBool("3D", "EnableDepthEqualsTestTolerance", 1, IniName);
CommonSettings.OpenGL_Emulation_NDSDepthCalculation = GetPrivateProfileBool("3D", "EnableNDSDepthCalculation", 1, IniName);
CommonSettings.OpenGL_Emulation_DepthLEqualPolygonFacing = GetPrivateProfileBool("3D", "EnableDepthLEqualPolygonFacing", 0, IniName); // Default is off.
CommonSettings.GFX3D_Renderer_MultisampleSize = GetValid3DIntSetting("MultisampleSize", 0, possibleMSAA, 6);
Change3DCoreWithFallbackAndSave(cur3DCore);
@ -5764,7 +5764,7 @@ LRESULT CALLBACK GFX3DSettingsDlgProc(HWND hw, UINT msg, WPARAM wp, LPARAM lp)
CheckDlgButton(hw, IDC_TEX_SMOOTH, CommonSettings.GFX3D_Renderer_TextureSmoothing);
CheckDlgButton(hw, IDC_SHADOW_POLYGONS, CommonSettings.OpenGL_Emulation_ShadowPolygon);
CheckDlgButton(hw, IDC_S_0_ALPHA_BLEND, CommonSettings.OpenGL_Emulation_SpecialZeroAlphaBlending);
CheckDlgButton(hw, IDC_DEPTH_EQUALS_TT, CommonSettings.OpenGL_Emulation_DepthEqualsTestTolerance);
CheckDlgButton(hw, IDC_NDS_DEPTH_CALC, CommonSettings.OpenGL_Emulation_NDSDepthCalculation);
CheckDlgButton(hw, IDC_DEPTH_L_EQUAL_PF, CommonSettings.OpenGL_Emulation_DepthLEqualPolygonFacing);
SendDlgItemMessage(hw, IDC_NUD_PRESCALEHD, UDM_SETRANGE, 0, MAKELPARAM(16, 1));
@ -5838,7 +5838,7 @@ LRESULT CALLBACK GFX3DSettingsDlgProc(HWND hw, UINT msg, WPARAM wp, LPARAM lp)
CommonSettings.GFX3D_Renderer_TextureSmoothing = IsDlgCheckboxChecked(hw, IDC_TEX_SMOOTH);
CommonSettings.OpenGL_Emulation_ShadowPolygon = IsDlgCheckboxChecked(hw, IDC_SHADOW_POLYGONS);
CommonSettings.OpenGL_Emulation_SpecialZeroAlphaBlending = IsDlgCheckboxChecked(hw, IDC_S_0_ALPHA_BLEND);
CommonSettings.OpenGL_Emulation_DepthEqualsTestTolerance = IsDlgCheckboxChecked(hw, IDC_DEPTH_EQUALS_TT);
CommonSettings.OpenGL_Emulation_NDSDepthCalculation = IsDlgCheckboxChecked(hw, IDC_NDS_DEPTH_CALC);
CommonSettings.OpenGL_Emulation_DepthLEqualPolygonFacing = IsDlgCheckboxChecked(hw, IDC_DEPTH_L_EQUAL_PF);
int newPrescaleHD = video.prescaleHD;
@ -5880,7 +5880,7 @@ LRESULT CALLBACK GFX3DSettingsDlgProc(HWND hw, UINT msg, WPARAM wp, LPARAM lp)
WritePrivateProfileBool("3D", "TextureSmooth", CommonSettings.GFX3D_Renderer_TextureSmoothing, IniName);
WritePrivateProfileBool("3D", "EnableShadowPolygon", CommonSettings.OpenGL_Emulation_ShadowPolygon, IniName);
WritePrivateProfileBool("3D", "EnableSpecialZeroAlphaBlending", CommonSettings.OpenGL_Emulation_SpecialZeroAlphaBlending, IniName);
WritePrivateProfileBool("3D", "EnableDepthEqualsTestTolerance", CommonSettings.OpenGL_Emulation_DepthEqualsTestTolerance, IniName);
WritePrivateProfileBool("3D", "EnableNDSDepthCalculation", CommonSettings.OpenGL_Emulation_NDSDepthCalculation, IniName);
WritePrivateProfileBool("3D", "EnableDepthLEqualPolygonFacing", CommonSettings.OpenGL_Emulation_DepthLEqualPolygonFacing, IniName);
}
case IDCANCEL:

4
desmume/src/frontend/windows/resource.h Normal file → Executable file
View File

@ -503,7 +503,7 @@
#define IDC_GPU_COLOR_DEPTH 1095
#define IDC_SHADOW_POLYGONS 1096
#define IDC_S_0_ALPHA_BLEND 1097
#define IDC_DEPTH_EQUALS_TT 1098
#define IDC_NDS_DEPTH_CALC 1098
#define IDC_DEPTH_L_EQUAL_PF 1099
#define IDM_FIRMSETTINGS 1100
#define IDD_FIRMSETTINGS 1101
@ -1039,7 +1039,7 @@
#define IDC_KILLSTYLUSTOP 50039
#define IDC_KILLSTYLUSOFF 50040
#define ID_LABEL_S_0_ALPHA_BLEND 50186
#define ID_LABEL_DEPTH_EQUALS_TT 50187
#define ID_LABEL_NDS_DEPTH_CALC 50187
#define ID_LABEL_DEPTH_L_EQUAL_PF 50188
#define IDC_LUASCRIPT_RESERVE_START 58000
#define IDC_LUASCRIPT_RESERVE_END 58099

4
desmume/src/frontend/windows/resources.rc Normal file → Executable file
View File

@ -154,12 +154,12 @@ BEGIN
CONTROL "Enable Shadow Polygons",IDC_SHADOW_POLYGONS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,173,137,10
CONTROL "Enable Special Zero Alpha Blending",IDC_S_0_ALPHA_BLEND,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,172,173,137,10
CONTROL "Enable Depth Equals Test Tolerance",IDC_DEPTH_EQUALS_TT,
CONTROL "Enable NDS-Style Depth Calculation",IDC_NDS_DEPTH_CALC,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,203,137,10
CONTROL "Enable Depth L-Equal Polygon Facing",IDC_DEPTH_L_EQUAL_PF,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,172,203,137,10
LTEXT "Disabling this option may cause some shadows to disappear.",ID_LABEL_SHADOW_POLYGONS,17,183,137,16
LTEXT "Disabling this option may cause certain polygons to get caught up in Z-fighting or disappear completely.",ID_LABEL_DEPTH_EQUALS_TT,17,213,137,24
LTEXT "Disabling this option may cause certain polygons to render incorrectly or disappear completely.",ID_LABEL_NDS_DEPTH_CALC,17,213,137,24
LTEXT "Disabling this option may cause some colors to look darker than normal.",ID_LABEL_S_0_ALPHA_BLEND,172,183,137,16
LTEXT "Disabling this option may cause some fragments to disappear. Disabled by default due to performance impact.",ID_LABEL_DEPTH_L_EQUAL_PF,172,213,137,24
GROUPBOX "Rendering Accuracy Options",IDC_STATIC,12,161,305,81,BS_CENTER