VideoCommon: Add a user-defined far clipping plane.

This commit is contained in:
Jules Blok
2016-08-12 15:06:26 +02:00
parent 6e2052fae6
commit 94927f360f
4 changed files with 21 additions and 5 deletions

View File

@ -734,6 +734,7 @@ Renderer::Renderer()
if (g_ActiveConfig.backend_info.bSupportsDepthClamp)
{
glEnable(GL_CLIP_DISTANCE0);
glEnable(GL_CLIP_DISTANCE1);
glEnable(GL_DEPTH_CLAMP);
}
@ -1664,7 +1665,10 @@ void Renderer::ResetAPIState()
if (GLInterface->GetMode() == GLInterfaceMode::MODE_OPENGL)
glDisable(GL_COLOR_LOGIC_OP);
if (g_ActiveConfig.backend_info.bSupportsDepthClamp)
{
glDisable(GL_CLIP_DISTANCE0);
glDisable(GL_CLIP_DISTANCE1);
}
glDepthMask(GL_FALSE);
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
}
@ -1674,7 +1678,10 @@ void Renderer::RestoreAPIState()
// Gets us back into a more game-like state.
glEnable(GL_SCISSOR_TEST);
if (g_ActiveConfig.backend_info.bSupportsDepthClamp)
{
glEnable(GL_CLIP_DISTANCE0);
glEnable(GL_CLIP_DISTANCE1);
}
SetGenerationMode();
BPFunctions::SetScissor();
SetColorMask();