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

0026711: Visualization, TKOpenGl - support creation of multisampling off-screen FBOs

OpenGl_Texture::Init2DMultisample() - new method to initialize multisampled texture.
Graphic3d_RenderingParams::NbMsaaSamples - add option defining MSAA samples number.

RayTracing will keep using FBO without MSAA, however it is possible to combine
MSAA for rasterization and FSAA for RayTracing.

OpenGl_FrameBuffer constructor has been changed to do not take arguments.
OpenGl_FrameBuffer::Init() method has been extended with mandatory parameters
defining Color and Depth attachment formats
and optional parameter defining number of MSAA parameters.

Draw Harness, add option -msaa to vrenderparams.
This commit is contained in:
kgv
2015-10-21 19:06:02 +03:00
committed by bugmaster
parent 9535c4be46
commit 3c4b62a436
17 changed files with 508 additions and 168 deletions

View File

@@ -8267,10 +8267,11 @@ static Standard_Integer VRenderParams (Draw_Interpretor& theDI,
case Graphic3d_RM_RAYTRACING: theDI << "raytrace "; break;
}
theDI << "\n";
theDI << "msaa: " << aParams.NbMsaaSamples << "\n";
theDI << "rayDepth: " << aParams.RaytracingDepth << "\n";
theDI << "fsaa: " << (aParams.IsAntialiasingEnabled ? "on" : "off") << "\n";
theDI << "shadows: " << (aParams.IsShadowEnabled ? "on" : "off") << "\n";
theDI << "reflections: " << (aParams.IsReflectionEnabled ? "on" : "off") << "\n";
theDI << "rayDepth: " << aParams.RaytracingDepth << "\n";
theDI << "gleam: " << (aParams.IsTransparentShadowEnabled ? "on" : "off") << "\n";
theDI << "GI: " << (aParams.IsGlobalIlluminationEnabled ? "on" : "off") << "\n";
theDI << "blocked RNG: " << (aParams.CoherentPathTracingMode ? "on" : "off") << "\n";
@@ -8345,6 +8346,30 @@ static Standard_Integer VRenderParams (Draw_Interpretor& theDI,
aParams.Method = Graphic3d_RM_RASTERIZATION;
}
else if (aFlag == "-msaa")
{
if (toPrint)
{
theDI << aParams.NbMsaaSamples << " ";
continue;
}
else if (++anArgIter >= theArgNb)
{
std::cerr << "Error: wrong syntax at argument '" << anArg << "'\n";
return 1;
}
const Standard_Integer aNbSamples = Draw::Atoi (theArgVec[anArgIter]);
if (aNbSamples < 0)
{
std::cerr << "Error: invalid number of MSAA samples " << aNbSamples << ".\n";
return 1;
}
else
{
aParams.NbMsaaSamples = aNbSamples;
}
}
else if (aFlag == "-raydepth"
|| aFlag == "-ray_depth")
{
@@ -9270,8 +9295,9 @@ void ViewerTest::ViewerCommands(Draw_Interpretor& theCommands)
__FILE__, VRenderParams, group);
theCommands.Add("vrenderparams",
"\n Manages rendering parameters: "
"\n '-rayTrace' Enables GPU ray-tracing"
"\n '-raster' Disables GPU ray-tracing"
"\n '-msaa 0..4' Specifies number of samples for MSAA"
"\n '-rayTrace' Enables GPU ray-tracing"
"\n '-rayDepth 0..10' Defines maximum ray-tracing depth"
"\n '-shadows on|off' Enables/disables shadows rendering"
"\n '-reflections on|off' Enables/disables specular reflections"