mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0027607: Visualization - Implement adaptive screen space sampling in path tracing
This commit provides useful functionality for path tracing rendering core. 1) Graphic3d_RenderingParams class was extended with additional AdaptiveScreenSampling option (disabled by default). If this option is enabled, path tracing tries to adjust the number of samples for different screen areas. In this way, the more complex areas (from the point of light conditions) are sampled more intensively, while the simple areas are sampled very rarely. For example, caustics and glossy reflections are typical candidates for more precise sampling. In general, this allows to equalize image convergence and not to waste resources for already converged areas. It is also possible to visualize sampling densities by enabling ShowSamplingTiles option (activating and deactivating this option does not affect on the accumulated image). 2) Mixing OpenGL and ray-tracing output has been changed. Now blending is performed using OpenGL functionality, while ray-tracing shaders only output correct Z-value. Test case bugs vis bug27083 has been updated, since the alpha value is now correctly set by Ray-Tracing to 1, opaque.
This commit is contained in:
@@ -8168,7 +8168,7 @@ static Standard_Integer VRenderParams (Draw_Interpretor& theDI,
|
||||
case Graphic3d_RM_RAYTRACING: theDI << "raytrace "; break;
|
||||
}
|
||||
theDI << "\n";
|
||||
theDI << "msaa: " << aParams.NbMsaaSamples << "\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";
|
||||
@@ -8176,6 +8176,8 @@ static Standard_Integer VRenderParams (Draw_Interpretor& theDI,
|
||||
theDI << "gleam: " << (aParams.IsTransparentShadowEnabled ? "on" : "off") << "\n";
|
||||
theDI << "GI: " << (aParams.IsGlobalIlluminationEnabled ? "on" : "off") << "\n";
|
||||
theDI << "blocked RNG: " << (aParams.CoherentPathTracingMode ? "on" : "off") << "\n";
|
||||
theDI << "iss: " << (aParams.AdaptiveScreenSampling ? "on" : "off") << "\n";
|
||||
theDI << "iss debug: " << (aParams.ShowSamplingTiles ? "on" : "off") << "\n";
|
||||
theDI << "shadingModel: ";
|
||||
switch (aView->ShadingModel())
|
||||
{
|
||||
@@ -8401,6 +8403,38 @@ static Standard_Integer VRenderParams (Draw_Interpretor& theDI,
|
||||
}
|
||||
aParams.CoherentPathTracingMode = toEnable;
|
||||
}
|
||||
else if (aFlag == "-iss")
|
||||
{
|
||||
if (toPrint)
|
||||
{
|
||||
theDI << (aParams.AdaptiveScreenSampling ? "on" : "off") << " ";
|
||||
continue;
|
||||
}
|
||||
|
||||
Standard_Boolean toEnable = Standard_True;
|
||||
if (++anArgIter < theArgNb
|
||||
&& !ViewerTest::ParseOnOff (theArgVec[anArgIter], toEnable))
|
||||
{
|
||||
--anArgIter;
|
||||
}
|
||||
aParams.AdaptiveScreenSampling = toEnable;
|
||||
}
|
||||
else if (aFlag == "-issd")
|
||||
{
|
||||
if (toPrint)
|
||||
{
|
||||
theDI << (aParams.ShowSamplingTiles ? "on" : "off") << " ";
|
||||
continue;
|
||||
}
|
||||
|
||||
Standard_Boolean toEnable = Standard_True;
|
||||
if (++anArgIter < theArgNb
|
||||
&& !ViewerTest::ParseOnOff (theArgVec[anArgIter], toEnable))
|
||||
{
|
||||
--anArgIter;
|
||||
}
|
||||
aParams.ShowSamplingTiles = toEnable;
|
||||
}
|
||||
else if (aFlag == "-env")
|
||||
{
|
||||
if (toPrint)
|
||||
@@ -9500,6 +9534,8 @@ void ViewerTest::ViewerCommands(Draw_Interpretor& theCommands)
|
||||
"\n '-gi on|off' Enables/disables global illumination effects"
|
||||
"\n '-brng on|off' Enables/disables blocked RNG (fast coherent PT)"
|
||||
"\n '-env on|off' Enables/disables environment map background"
|
||||
"\n '-iss on|off' Enables/disables adaptive screen sampling (PT mode)"
|
||||
"\n '-issd on|off' Shows screen sampling distribution in ISS mode"
|
||||
"\n '-shadingModel model' Controls shading model from enumeration"
|
||||
"\n color, flat, gouraud, phong"
|
||||
"\n '-resolution value' Sets a new pixels density (PPI), defines scaling factor for parameters like text size"
|
||||
|
Reference in New Issue
Block a user