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

0028369: Visualization, Path Tracing - Expose radiance clamping setting in path tracing mode

New parameter was added in the vrenderparams command:
vrenderparams -maxrad <value>
This commit is contained in:
dbp
2017-01-18 14:24:13 +03:00
committed by apn
parent 7a59f4ce9f
commit b09447ed89
9 changed files with 129 additions and 40 deletions

View File

@@ -9075,6 +9075,7 @@ static Standard_Integer VRenderParams (Draw_Interpretor& theDI,
theDI << "iss: " << (aParams.AdaptiveScreenSampling ? "on" : "off") << "\n";
theDI << "iss debug: " << (aParams.ShowSamplingTiles ? "on" : "off") << "\n";
theDI << "two-sided BSDF: " << (aParams.TwoSidedBsdfModels ? "on" : "off") << "\n";
theDI << "max radiance: " << aParams.RadianceClampingValue << "\n";
theDI << "shadingModel: ";
switch (aView->ShadingModel())
{
@@ -9300,6 +9301,37 @@ static Standard_Integer VRenderParams (Draw_Interpretor& theDI,
}
aParams.CoherentPathTracingMode = toEnable;
}
else if (aFlag == "-maxrad")
{
if (toPrint)
{
theDI << aParams.RadianceClampingValue << " ";
continue;
}
else if (++anArgIter >= theArgNb)
{
std::cerr << "Error: wrong syntax at argument '" << anArg << "'\n";
return 1;
}
const TCollection_AsciiString aMaxRadStr = theArgVec[anArgIter];
if (!aMaxRadStr.IsRealValue())
{
std::cerr << "Error: wrong syntax at argument '" << anArg << "'\n";
return 1;
}
const Standard_Real aMaxRadiance = aMaxRadStr.RealValue();
if (aMaxRadiance <= 0.0)
{
std::cerr << "Error: invalid radiance clamping value " << aMaxRadiance << ".\n";
return 1;
}
else
{
aParams.RadianceClampingValue = static_cast<Standard_ShortReal> (aMaxRadiance);
}
}
else if (aFlag == "-iss")
{
if (toPrint)
@@ -10906,6 +10938,7 @@ void ViewerTest::ViewerCommands(Draw_Interpretor& theCommands)
"\n '-twoside on|off' Enables/disables two-sided BSDF models (PT mode)"
"\n '-iss on|off' Enables/disables adaptive screen sampling (PT mode)"
"\n '-issd on|off' Shows screen sampling distribution in ISS mode"
"\n '-maxrad > 0.0' Value used for clamping radiance estimation (PT mode)"
"\n '-rebuildGlsl on|off' Rebuild Ray-Tracing GLSL programs (for debugging)"
"\n '-shadingModel model' Controls shading model from enumeration"
"\n color, flat, gouraud, phong"