1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0030640: Visualization, Graphic3d_Camera - add option creating Projection matrix with [0,1] depth range

Added new property Graphic3d_Camera::IsZeroToOneDepth() and OpenGl_Caps::useZeroToOneDepth
for activating [0,1] depth range instead of [-1,1] range using glClipControl() within OpenGL 4.5+.
This commit is contained in:
kgv
2021-03-03 14:58:46 +03:00
committed by bugmaster
parent 395d00e058
commit e70625d6b1
25 changed files with 226 additions and 71 deletions

View File

@@ -6761,6 +6761,7 @@ static int VCaps (Draw_Interpretor& theDI,
theDI << "SoftMode:" << (aCaps->contextNoAccel ? "1" : "0") << "\n";
theDI << "FFP: " << (aCaps->ffpEnable ? "1" : "0") << "\n";
theDI << "PolygonMode: " << (aCaps->usePolygonMode ? "1" : "0") << "\n";
theDI << "DepthZeroToOne: " << (aCaps->useZeroToOneDepth ? "1" : "0") << "\n";
theDI << "VSync: " << aCaps->swapInterval << "\n";
theDI << "Compatible:" << (aCaps->contextCompatible ? "1" : "0") << "\n";
theDI << "Stereo: " << (aCaps->contextStereo ? "1" : "0") << "\n";
@@ -6854,6 +6855,19 @@ static int VCaps (Draw_Interpretor& theDI,
}
aCaps->pntSpritesDisable = !toEnable;
}
else if (anArgCase == "-depthzerotoone"
|| anArgCase == "-zerotoonedepth"
|| anArgCase == "-usezerotoonedepth"
|| anArgCase == "-iszerotoonedepth")
{
Standard_Boolean toEnable = Standard_True;
if (++anArgIter < theArgNb
&& !Draw::ParseOnOff (theArgVec[anArgIter], toEnable))
{
--anArgIter;
}
aCaps->useZeroToOneDepth = toEnable;
}
else if (anArgCase == "-softmode")
{
Standard_Boolean toEnable = Standard_True;
@@ -15072,6 +15086,7 @@ void ViewerTest::ViewerCommands(Draw_Interpretor& theCommands)
"\n\t\t: [-vsync {0|1}] [-useWinBuffer {0|1}] [-opaqueAlpha {0|1}]"
"\n\t\t: [-quadBuffer {0|1}] [-stereo {0|1}]"
"\n\t\t: [-softMode {0|1}] [-noupdate|-update]"
"\n\t\t: [-zeroToOneDepth {0|1}]"
"\n\t\t: [-noExtensions {0|1}] [-maxVersion Major Minor]"
"\n\t\t: Modify particular graphic driver options:"
"\n\t\t: sRGB - enable/disable sRGB rendering"
@@ -15086,6 +15101,7 @@ void ViewerTest::ViewerCommands(Draw_Interpretor& theCommands)
"\n\t\t: vsync - switch VSync on or off"
"\n\t\t: opaqueAlpha - disable writes in alpha component of color buffer"
"\n\t\t: winBuffer - allow using window buffer for rendering"
"\n\t\t: zeroToOneDepth - use [0,1] depth range instead of [-1,1] range"
"\n\t\t: Context creation options:"
"\n\t\t: softMode - software OpenGL implementation"
"\n\t\t: compatibleProfile - backward-compatible profile"