/////////////////////////////////////////////////////////////////////////////// // Copyright (C) 2002-2024, Open Design Alliance (the "Alliance"). // All rights reserved. // // This software and its documentation and related materials are owned by // the Alliance. The software may only be incorporated into application // programs owned by members of the Alliance, subject to a signed // Membership Agreement and Supplemental Software License Agreement with the // Alliance. The structure and organization of this software are the valuable // trade secrets of the Alliance and its suppliers. The software is also // protected by copyright law and international treaty provisions. Application // programs incorporating this software must include the following statement // with their copyright notices: // // This application incorporates Open Design Alliance software pursuant to a license // agreement with Open Design Alliance. // Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance. // All rights reserved. // // By use of this software, its documentation or related materials, you // acknowledge and accept the above terms. /////////////////////////////////////////////////////////////////////////////// // Scene Graph settings user interface component #ifndef ODDBVISUALIZERTRENDERSETTINGSUI #define ODDBVISUALIZERTRENDERSETTINGSUI #include "../extbar/ExtBar.h" #include "Gi/GiEnvironment.h" #include "TD_PackPush.h" /** \details */ template class OdDbVisualizeRTRenderSettingsUI : public ExtBar::Callback { protected: enum UIElements { kUIGenericSettingsGroup = 100, kUIRendererTypeComboBox, kUIRendererTypeText, kUIRenderQualityComboBox, kUIRenderQualityText, kUIDefaultShaderComboBox, kUIDefaultShaderText, kUITextureQualityComboBox, kUITextureQualityText, kUIPixelSamplesXRangeBox, kUIPixelSamplesXText, kUIPixelSamplesYRangeBox, kUIPixelSamplesYText, kUIMaxBouncesRangeBox, kUIMaxBouncesText, kUIMaxSelfRelsRangeBox, kUIMaxSelfRelsText, kUIMaxSelfRefsRangeBox, kUIMaxSelfRefsText, kUIGeomAccelTypeComboBox, kUIGeomAccelTypeText, kUIGeomSplitModeComboBox, kUIGeomSplitModeText, kUIGeomMaxLeafPrimsRangeBox, kUIGeomMaxLeafPrimsText, kUIGeomNodeDepthRangeBox, kUIGeomNodeDepthText, kUIGeomAccelSortCheckBox, kUIGeomAccelSortText, kUIPrimAccelTypeComboBox, kUIPrimAccelTypeText, kUIPrimSplitModeComboBox, kUIPrimSplitModeText, kUIPrimMaxLeafPrimsRangeBox, kUIPrimMaxLeafPrimsText, kUIPrimNodeDepthRangeBox, kUIPrimNodeDepthText, kUIPrimAccelSortCheckBox, kUIPrimAccelSortText, kUITolOverrideCheckBox, kUITolOverrideText, kUIFloatTolRangeBox, kUIFloatTolText, kUIDoubleTolRangeBox, kUIDoubleTolText, kUIMinEnergyRangeBox, kUIMinEnergyText, kUICPUSettingsGroup = 200, kUILinePrimsCheckBox, kUILinePrimsText, kUILinesWidthRangeBox, kUILinesWidthText, kUIMaxThreadsRangeBox, kUIMaxThreadsText, kUITileWidthRangeBox, kUITileWidthText, kUITileHeightRangeBox, kUITileHeightText, kUITileOrderComboBox, kUITileOrderText, kUIGPUSettingsGroup = 300, kUIMaxBufSubdivsRangeBox, kUIMaxBufSubdivsText, kUIBufSubdivWidthRangeBox, kUIBufSubdivWidthText, kUIBufSubdivHeightRangeBox, kUIBufSubdivHeightText, kUIBufScalePercsRangeBox, kUIBufScalePercsText, kUIWorkGroupSizeRangeBox, kUIWorkGroupSizeText, kUITiledRenderingCheckBox, kUITiledRenderingText, kUIForceShadowMapsCheckBox, kUIForceShadowMapsText, kUIPartialGPUSettingsGroup = 400, kUIPartComponentsRangeBox, kUIPartComponentsText, kUIPartMinReflectRangeBox, kUIPartMinReflectText, kUIPartMinRefractRangeBox, kUIPartMinRefractText, kUIPartMinLightRangeBox, kUIPartMinLightText, kUIShadowTypeOverComboBox, kUIShadowTypeOverText, kUIGlobalIllumSettingsGroup = 500, kUIGlobalIllumCheckBox, kUIGlobalIllumText, kUIGISamplesXRangeBox, kUIGISamplesXText, kUIGISamplesYRangeBox, kUIGISamplesYText, kUIGIRadiusRangeBox, kUIGIRadiusText, kUIGIAutoRadiusCheckBox, kUIGIAutoRadiusText, kUIGIAutoRadiusPercRangeBox, kUIGIAutoRadiusPercText, kUIGIOcclusionCoefRangeBox, kUIGIOcclusionCoefText, kUIRoughnessSamplesXRangeBox, kUIRoughnessSamplesXText, kUIRoughnessSamplesYRangeBox, kUIRoughnessSamplesYText, kUIBasicSettingsGroup = 600, kUIEnableMaterialsCheckBox, kUIEnableMaterialsText, kUITextureSamplingCheckBox, kUITextureSamplingText, kUIEnableBackFacesCheckBox, kUIEnableBackFacesText, kUIEnableShadowsCheckBox, kUIEnableShadowsText, kUIEnableDiagBkgndCheckBox, kUIEnableDiagBkgndText }; protected: SettingsClient *m_pClient; public: OdDbVisualizeRTRenderSettingsUI(SettingsClient *pClient) : m_pClient(pClient) { } SettingsClient *client() const { return m_pClient; } // ExtBar interface virtual void fillExtBar(ExtBar *pExtBar) { // Basic render settings ExtBar::GroupElement *pGroup = pExtBar->createGroup(kUIBasicSettingsGroup, true, false); ExtBar::TextElement::cast(pGroup)->setText(OD_T("Basic settings")); // Enable materials pExtBar->createCheckBox(kUIEnableMaterialsCheckBox, pGroup, ExtBar::k8d8, m_pClient->materialsEnabled())->setText(OD_T("Enable materials")); // Enable textures sampling pExtBar->createCheckBox(kUITextureSamplingCheckBox, pGroup, ExtBar::k8d8, m_pClient->textureSampling())->setText(OD_T("Enable textures sampling")); // Enable materials pExtBar->createCheckBox(kUIEnableBackFacesCheckBox, pGroup, ExtBar::k8d8, m_pClient->backFacesEnabled())->setText(OD_T("Enable back faces")); // Enable materials pExtBar->createCheckBox(kUIEnableShadowsCheckBox, pGroup, ExtBar::k8d8, m_pClient->shadowsEnabled())->setText(OD_T("Enable shadows")); // Enable materials pExtBar->createCheckBox(kUIEnableDiagBkgndCheckBox, pGroup, ExtBar::k8d8, m_pClient->diagnosticBackgroundEnabled())->setText(OD_T("Enable diagnostic background")); // Generic settings pGroup = pExtBar->createGroup(kUIGenericSettingsGroup); ExtBar::TextElement::cast(pGroup)->setText(OD_T("Generic settings")); // Renderer type pExtBar->createText(kUIRendererTypeText, pGroup, ExtBar::k8d8)->setText(OD_T("Renderer type:")); { ExtBar::ListElement *pList = pExtBar->createComboBox(kUIRendererTypeComboBox, pGroup); pList->addString(OD_T("Software renderer")); pList->addString(OD_T("Hardware renderer")); pList->addString(OD_T("Hardware partial")); pList->setSelString((int)m_pClient->rendererType()); } // Render quality pExtBar->createText(kUIRenderQualityText, pGroup, ExtBar::k8d8)->setText(OD_T("Render quality:")); { ExtBar::ListElement *pList = pExtBar->createComboBox(kUIRenderQualityComboBox, pGroup); pList->addString(OD_T("Bounding box")); pList->addString(OD_T("Geometry")); pList->addString(OD_T("Shaded")); pList->setSelString((int)m_pClient->renderQuality()); } // Default shader pExtBar->createText(kUIDefaultShaderText, pGroup, ExtBar::k8d8)->setText(OD_T("Default shader:")); { ExtBar::ListElement *pList = pExtBar->createComboBox(kUIDefaultShaderComboBox, pGroup); pList->addString(OD_T("Phong")); pList->setSelString((int)m_pClient->defaultShader()); } // Texture quality pExtBar->createText(kUITextureQualityText, pGroup, ExtBar::k8d8)->setText(OD_T("Textures quality:")); { ExtBar::ListElement *pList = pExtBar->createComboBox(kUITextureQualityComboBox, pGroup); pList->addString(OD_T("Nearest")); pList->addString(OD_T("Smooth")); pList->addString(OD_T("Trilinear")); pList->addString(OD_T("Anisotropic")); pList->setSelString((int)m_pClient->textureQuality()); } // Pixel samples OdInt32 nX = 0, nY = 0; m_pClient->pixelSamples(nX, nY); pExtBar->createText(kUIPixelSamplesXText, pGroup, ExtBar::k6d8)->setText(OD_T("Pixel samples X:")); pExtBar->createRangeBox(kUIPixelSamplesXRangeBox, pGroup, ExtBar::k2d8)->setInt(nX, 1, 16); pExtBar->createText(kUIPixelSamplesYText, pGroup, ExtBar::k6d8)->setText(OD_T("Pixel samples Y:")); pExtBar->createRangeBox(kUIPixelSamplesYRangeBox, pGroup, ExtBar::k2d8)->setInt(nY, 1, 16); // Max bounces pExtBar->createText(kUIMaxBouncesText, pGroup, ExtBar::k6d8)->setText(OD_T("Max ray bounces:")); pExtBar->createRangeBox(kUIMaxBouncesRangeBox, pGroup, ExtBar::k2d8)->setUInt(m_pClient->maxBounces(), 1, 32000); // Max self reflections pExtBar->createText(kUIMaxSelfRelsText, pGroup, ExtBar::k6d8)->setText(OD_T("Max self reflections:")); pExtBar->createRangeBox(kUIMaxSelfRelsRangeBox, pGroup, ExtBar::k2d8)->setUInt(m_pClient->maxSelfReflections(), 1, 32000); // Max self refractions pExtBar->createText(kUIMaxSelfRefsText, pGroup, ExtBar::k6d8)->setText(OD_T("Max self refractions:")); pExtBar->createRangeBox(kUIMaxSelfRefsRangeBox, pGroup, ExtBar::k2d8)->setUInt(m_pClient->maxSelfRefractions(), 1, 32000); // Geometry accelerator tree type OdGiVisualizeRTRenderSettingsTraits::AcceleratorType accelType = OdGiVisualizeRTRenderSettingsTraits::kAccelBVH8; OdGiVisualizeRTRenderSettingsTraits::SplitMethod splitMode = OdGiVisualizeRTRenderSettingsTraits::kSplitHalf; OdUInt32 nMaxLeafPrims = 0, nNodeDepth = 0; bool bVal = false; m_pClient->geometryAccelerator(accelType, splitMode, nMaxLeafPrims, nNodeDepth, bVal); pExtBar->createText(kUIGeomAccelTypeText, pGroup, ExtBar::k8d8)->setText(OD_T("Geometry accelerator type:")); { ExtBar::ListElement *pList = pExtBar->createComboBox(kUIGeomAccelTypeComboBox, pGroup); pList->addString(OD_T("BVH2")); pList->addString(OD_T("BVH4")); pList->addString(OD_T("BVH8")); pList->setSelString((int)accelType); } // Geometry accelerator split method pExtBar->createText(kUIGeomSplitModeText, pGroup, ExtBar::k8d8)->setText(OD_T("Geometry tree split method:")); { ExtBar::ListElement *pList = pExtBar->createComboBox(kUIGeomSplitModeComboBox, pGroup); pList->addString(OD_T("Half")); pList->addString(OD_T("SAH")); pList->setSelString((int)splitMode); } // Geometry accelerator max leaf primitives pExtBar->createText(kUIGeomMaxLeafPrimsText, pGroup, ExtBar::k6d8)->setText(OD_T("Max geometry leaf primitives:")); pExtBar->createRangeBox(kUIGeomMaxLeafPrimsRangeBox, pGroup, ExtBar::k2d8)->setUInt(nMaxLeafPrims, 1, 32000); // Geometry accelerator max nodes depth pExtBar->createText(kUIGeomNodeDepthText, pGroup, ExtBar::k6d8)->setText(OD_T("Max geometry nodes depth:")); pExtBar->createRangeBox(kUIGeomNodeDepthRangeBox, pGroup, ExtBar::k2d8)->setUInt(nNodeDepth, 1, 256); // Geometry accelerator sorting pExtBar->createCheckBox(kUIGeomAccelSortCheckBox, pGroup, ExtBar::k8d8, bVal)->setText(OD_T("Geometry structure sorting")); // Primitives accelerator tree type m_pClient->primitiveAccelerator(accelType, splitMode, nMaxLeafPrims, nNodeDepth, bVal); pExtBar->createText(kUIPrimAccelTypeText, pGroup, ExtBar::k8d8)->setText(OD_T("Primitives accelerator type:")); { ExtBar::ListElement *pList = pExtBar->createComboBox(kUIPrimAccelTypeComboBox, pGroup); pList->addString(OD_T("BVH2")); pList->addString(OD_T("BVH4")); pList->addString(OD_T("BVH8")); pList->setSelString((int)accelType); } // Primitives accelerator split method pExtBar->createText(kUIPrimSplitModeText, pGroup, ExtBar::k8d8)->setText(OD_T("Primitives tree split method:")); { ExtBar::ListElement *pList = pExtBar->createComboBox(kUIPrimSplitModeComboBox, pGroup); pList->addString(OD_T("Half")); pList->addString(OD_T("SAH")); pList->setSelString((int)splitMode); } // Primitives accelerator max leaf primitives pExtBar->createText(kUIPrimMaxLeafPrimsText, pGroup, ExtBar::k6d8)->setText(OD_T("Max leaf primitives:")); pExtBar->createRangeBox(kUIPrimMaxLeafPrimsRangeBox, pGroup, ExtBar::k2d8)->setUInt(nMaxLeafPrims, 1, 32000); // Primitives accelerator max nodes depth pExtBar->createText(kUIPrimNodeDepthText, pGroup, ExtBar::k6d8)->setText(OD_T("Max primitives node depth:")); pExtBar->createRangeBox(kUIPrimNodeDepthRangeBox, pGroup, ExtBar::k2d8)->setUInt(nNodeDepth, 1, 256); // Primitives accelerator sorting pExtBar->createCheckBox(kUIPrimAccelSortCheckBox, pGroup, ExtBar::k8d8, bVal)->setText(OD_T("Primitives structure sorting")); // Tolerance override float fVal = 0.0f; double dVal = 0.0; pExtBar->createCheckBox(kUITolOverrideCheckBox, pGroup, ExtBar::k8d8, m_pClient->toleranceOverride(fVal, dVal))->setText(OD_T("Tolerance override")); // Floating point tolerance pExtBar->createText(kUIFloatTolText, pGroup, ExtBar::k6d8)->setText(OD_T("Single precision tolerance:")); pExtBar->createRangeBox(kUIFloatTolRangeBox, pGroup, ExtBar::k2d8, false, true)->setFP(fVal, 1.e-20, 1.0, 1.e-8); pExtBar->createText(kUIDoubleTolText, pGroup, ExtBar::k6d8)->setText(OD_T("Double precision tolerance:")); pExtBar->createRangeBox(kUIDoubleTolRangeBox, pGroup, ExtBar::k2d8, false, true)->setFP(dVal, 1.e-40, 1.0, 1.e-10); // Minimal ray energy pExtBar->createText(kUIMinEnergyText, pGroup, ExtBar::k6d8)->setText(OD_T("Minimal ray energy:")); pExtBar->createRangeBox(kUIMinEnergyRangeBox, pGroup, ExtBar::k2d8, false, true)->setFP(m_pClient->minEnergy(), 0.0, 10.0, 0.001); // CPU settings pGroup = pExtBar->createGroup(kUICPUSettingsGroup); ExtBar::TextElement::cast(pGroup)->setText(OD_T("CPU renderer settings")); // Line primitives pExtBar->createCheckBox(kUILinePrimsCheckBox, pGroup, ExtBar::k8d8, m_pClient->linePrimitivesEnabled(fVal))->setText(OD_T("Render line/point primitives")); // Line primitives width pExtBar->createText(kUILinesWidthText, pGroup, ExtBar::k6d8)->setText(OD_T("Line primitives width:")); pExtBar->createRangeBox(kUILinesWidthRangeBox, pGroup, ExtBar::k2d8, false, true)->setFP(fVal, 0.01, 64.0, 0.01); // Primitives accelerator max nodes depth pExtBar->createText(kUIMaxThreadsText, pGroup, ExtBar::k6d8)->setText(OD_T("Max CPU threads:")); pExtBar->createRangeBox(kUIMaxThreadsRangeBox, pGroup, ExtBar::k2d8)->setUInt(m_pClient->maxCPUThreads(), 0, 256); // Tile size OdUInt32 nWidth = 0, nHeight = 0; m_pClient->tileSize(nWidth, nHeight); pExtBar->createText(kUITileWidthText, pGroup, ExtBar::k6d8)->setText(OD_T("Tile width:")); pExtBar->createRangeBox(kUITileWidthRangeBox, pGroup, ExtBar::k2d8)->setUInt(nWidth, 1, 16000); pExtBar->createText(kUITileHeightText, pGroup, ExtBar::k6d8)->setText(OD_T("Tile height:")); pExtBar->createRangeBox(kUITileHeightRangeBox, pGroup, ExtBar::k2d8)->setUInt(nHeight, 1, 16000); // Tile order pExtBar->createText(kUITileOrderText, pGroup, ExtBar::k8d8)->setText(OD_T("Tiles order:")); { ExtBar::ListElement *pList = pExtBar->createComboBox(kUITileOrderComboBox, pGroup); pList->addString(OD_T("Hilbert")); pList->addString(OD_T("Spiral")); pList->addString(OD_T("Left to right")); pList->addString(OD_T("Right to left")); pList->addString(OD_T("Top to bottom")); pList->addString(OD_T("Bottom to top")); pList->setSelString((int)m_pClient->tileOrder()); } // GPU settings pGroup = pExtBar->createGroup(kUIGPUSettingsGroup); ExtBar::TextElement::cast(pGroup)->setText(OD_T("GPU renderer settings")); // Max buffer subdivisions pExtBar->createText(kUIMaxBufSubdivsText, pGroup, ExtBar::k6d8)->setText(OD_T("Max buffer subdivisions:")); pExtBar->createRangeBox(kUIMaxBufSubdivsRangeBox, pGroup, ExtBar::k2d8)->setUInt(m_pClient->maxGPUBufferSubdivisions(), 1, 4); // Min buffer subdivision size m_pClient->minGPUBufferSubdivisionSize(nWidth, nHeight); pExtBar->createText(kUIBufSubdivWidthText, pGroup, ExtBar::k6d8)->setText(OD_T("Min buffer subdivision width:")); pExtBar->createRangeBox(kUIBufSubdivWidthRangeBox, pGroup, ExtBar::k2d8)->setUInt(nWidth, 1, 16000); pExtBar->createText(kUIBufSubdivHeightText, pGroup, ExtBar::k6d8)->setText(OD_T("Min buffer subdivision height:")); pExtBar->createRangeBox(kUIBufSubdivHeightRangeBox, pGroup, ExtBar::k2d8)->setUInt(nHeight, 1, 16000); // GPU buffer scale percents pExtBar->createText(kUIBufScalePercsText, pGroup, ExtBar::k6d8)->setText(OD_T("Buffer scale percents:")); pExtBar->createRangeBox(kUIBufScalePercsRangeBox, pGroup, ExtBar::k2d8)->setUInt(m_pClient->gpuBufferScalePercents(), 1, 16000); // GPU work group size pExtBar->createText(kUIWorkGroupSizeText, pGroup, ExtBar::k6d8)->setText(OD_T("Work group size:")); pExtBar->createRangeBox(kUIWorkGroupSizeRangeBox, pGroup, ExtBar::k2d8)->setUInt(m_pClient->gpuWorkGroupSize(), 1, 2048); // GPU tiled rendering pExtBar->createCheckBox(kUITiledRenderingCheckBox, pGroup, ExtBar::k8d8, m_pClient->gpuTiledRendering())->setText(OD_T("Tiled (coherent) rendering")); // Force shadow maps inside reflections in GPU renderer pExtBar->createCheckBox(kUIForceShadowMapsCheckBox, pGroup, ExtBar::k8d8, m_pClient->gpuForceShadowMapsInsideReflections())->setText(OD_T("Force shadow maps inside reflections")); // Partial GPU settings pGroup = pExtBar->createGroup(kUIPartialGPUSettingsGroup); ExtBar::TextElement::cast(pGroup)->setText(OD_T("Partial GPU renderer settings")); // Partial rendering components pExtBar->createText(kUIPartComponentsText, pGroup, ExtBar::k6d8)->setText(OD_T("Render components:")); pExtBar->createRangeBox(kUIPartComponentsRangeBox, pGroup, ExtBar::k2d8)->setUInt(m_pClient->partialRenderComponents(), 0, (OdUInt32)OdGiVisualizeRTRenderSettingsTraits::kAllRenderComponents); // Minimal reflection cutoff pExtBar->createText(kUIPartMinReflectText, pGroup, ExtBar::k6d8)->setText(OD_T("Minimal reflection cutoff:")); pExtBar->createRangeBox(kUIPartMinReflectRangeBox, pGroup, ExtBar::k2d8, false, true)->setFP(m_pClient->minimalReflectionCutoff(), 0.0, 1.0, 0.0091); // Minimal refraction cutoff pExtBar->createText(kUIPartMinRefractText, pGroup, ExtBar::k6d8)->setText(OD_T("Minimal refraction cutoff:")); pExtBar->createRangeBox(kUIPartMinRefractRangeBox, pGroup, ExtBar::k2d8, false, true)->setFP(m_pClient->minimalRefractionCutoff(), 1.0, 4.0, 0.0001); // Minimal lighting cutoff pExtBar->createText(kUIPartMinLightText, pGroup, ExtBar::k6d8)->setText(OD_T("Minimal lighting cutoff:")); pExtBar->createRangeBox(kUIPartMinLightRangeBox, pGroup, ExtBar::k2d8, false, true)->setFP(m_pClient->minimalLightingCutoff(), 0.0, 1.0, 0.0001); // Shadow type override pExtBar->createText(kUIShadowTypeOverText, pGroup, ExtBar::k8d8)->setText(OD_T("Shadows type override:")); { ExtBar::ListElement *pList = pExtBar->createComboBox(kUIShadowTypeOverComboBox, pGroup); pList->addString(OD_T("No override")); pList->addString(OD_T("Shadow maps")); pList->addString(OD_T("Ray-traced shadows")); pList->setSelString((int)m_pClient->shadowTypeOverride()); } // Global illumination settings pGroup = pExtBar->createGroup(kUIGlobalIllumSettingsGroup); ExtBar::TextElement::cast(pGroup)->setText(OD_T("Global illumination settings")); // Global illumination enable pExtBar->createCheckBox(kUIGlobalIllumCheckBox, pGroup, ExtBar::k8d8, m_pClient->globalIlluminationEnabled())->setText(OD_T("Enable global illumination")); // Global illumination samples m_pClient->globalIlluminationSamples(nX, nY); pExtBar->createText(kUIGISamplesXText, pGroup, ExtBar::k6d8)->setText(OD_T("Global illumination samples X:")); pExtBar->createRangeBox(kUIGISamplesXRangeBox, pGroup, ExtBar::k2d8)->setInt(nX, 1, 16); pExtBar->createText(kUIGISamplesYText, pGroup, ExtBar::k6d8)->setText(OD_T("Global illumination samples Y:")); pExtBar->createRangeBox(kUIGISamplesYRangeBox, pGroup, ExtBar::k2d8)->setInt(nY, 1, 16); // Global illumination radius pExtBar->createText(kUIGIRadiusText, pGroup, ExtBar::k6d8)->setText(OD_T("Global illumination radius:")); pExtBar->createRangeBox(kUIGIRadiusRangeBox, pGroup, ExtBar::k2d8, false, true)->setFP(m_pClient->globalIlluminationRadius(), 0.01, 1.e+100, 0.01); // Global illumination auto-radius pExtBar->createCheckBox(kUIGIAutoRadiusCheckBox, pGroup, ExtBar::k8d8, m_pClient->globalIlluminationAutoRadiusEnabled())->setText(OD_T("Global illumination auto-radius")); // Global illumination auto-radius percents pExtBar->createText(kUIGIAutoRadiusPercText, pGroup, ExtBar::k6d8)->setText(OD_T("Auto-radius percents:")); pExtBar->createRangeBox(kUIGIAutoRadiusPercRangeBox, pGroup, ExtBar::k2d8, false, true)->setFP(m_pClient->globalIlluminationAutoRadiusPercents(), 1.e-8, 2.0, 0.01); // Global illumination occlusion coefficient pExtBar->createText(kUIGIOcclusionCoefText, pGroup, ExtBar::k6d8)->setText(OD_T("Occlusion coefficient:")); pExtBar->createRangeBox(kUIGIOcclusionCoefRangeBox, pGroup, ExtBar::k2d8, false, true)->setFP(m_pClient->globalIlluminationOcclusionCoefficient(), 0.0, 1.0, 0.01); // Roughness samples m_pClient->roughnessSamples(nX, nY); pExtBar->createText(kUIRoughnessSamplesXText, pGroup, ExtBar::k6d8)->setText(OD_T("Roughness effect samples X:")); pExtBar->createRangeBox(kUIRoughnessSamplesXRangeBox, pGroup, ExtBar::k2d8)->setInt(nX, 1, 16); pExtBar->createText(kUIRoughnessSamplesYText, pGroup, ExtBar::k6d8)->setText(OD_T("Roughness effect samples Y:")); pExtBar->createRangeBox(kUIRoughnessSamplesYRangeBox, pGroup, ExtBar::k2d8)->setInt(nY, 1, 16); } virtual void closeExtBar(ExtBar *pExtBar, int nReason) { if (!nReason) return; // Grab basic settings m_pClient->setMaterialsEnabled(ExtBar::CheckElement::cast(pExtBar->getElement(kUIEnableMaterialsCheckBox))->isChecked()); m_pClient->setTextureSampling(ExtBar::CheckElement::cast(pExtBar->getElement(kUITextureSamplingCheckBox))->isChecked()); m_pClient->setBackFacesEnabled(ExtBar::CheckElement::cast(pExtBar->getElement(kUIEnableBackFacesCheckBox))->isChecked()); m_pClient->setShadowsEnabled(ExtBar::CheckElement::cast(pExtBar->getElement(kUIEnableShadowsCheckBox))->isChecked()); m_pClient->setDiagnosticBackgroundEnabled(ExtBar::CheckElement::cast(pExtBar->getElement(kUIEnableDiagBkgndCheckBox))->isChecked()); // Grab generic settings m_pClient->setRendererType((OdGiVisualizeRTRenderSettingsTraits::RendererType) ExtBar::ListElement::cast(pExtBar->getElement(kUIRendererTypeComboBox))->getSelString()); m_pClient->setRenderQuality((OdGiVisualizeRTRenderSettingsTraits::QualityLevel) ExtBar::ListElement::cast(pExtBar->getElement(kUIRenderQualityComboBox))->getSelString()); m_pClient->setDefaultShader((OdGiVisualizeRTRenderSettingsTraits::DefaultShader) ExtBar::ListElement::cast(pExtBar->getElement(kUIDefaultShaderComboBox))->getSelString()); m_pClient->setTextureQuality((OdGiVisualizeRTRenderSettingsTraits::TextureQuality) ExtBar::ListElement::cast(pExtBar->getElement(kUITextureQualityComboBox))->getSelString()); m_pClient->setPixelSamples(ExtBar::RangeElement::cast(pExtBar->getElement(kUIPixelSamplesXRangeBox))->getPosInt(), ExtBar::RangeElement::cast(pExtBar->getElement(kUIPixelSamplesYRangeBox))->getPosInt()); m_pClient->setMaxBounces(ExtBar::RangeElement::cast(pExtBar->getElement(kUIMaxBouncesRangeBox))->getPosUInt()); m_pClient->setMaxSelfReflections(ExtBar::RangeElement::cast(pExtBar->getElement(kUIMaxSelfRelsRangeBox))->getPosUInt()); m_pClient->setMaxSelfRefractions(ExtBar::RangeElement::cast(pExtBar->getElement(kUIMaxSelfRefsRangeBox))->getPosUInt()); m_pClient->setGeometryAccelerator((OdGiVisualizeRTRenderSettingsTraits::AcceleratorType) ExtBar::ListElement::cast(pExtBar->getElement(kUIGeomAccelTypeComboBox))->getSelString(), (OdGiVisualizeRTRenderSettingsTraits::SplitMethod) ExtBar::ListElement::cast(pExtBar->getElement(kUIGeomSplitModeComboBox))->getSelString(), ExtBar::RangeElement::cast(pExtBar->getElement(kUIGeomMaxLeafPrimsRangeBox))->getPosUInt(), ExtBar::RangeElement::cast(pExtBar->getElement(kUIGeomNodeDepthRangeBox))->getPosUInt(), ExtBar::CheckElement::cast(pExtBar->getElement(kUIGeomAccelSortCheckBox))->isChecked()); m_pClient->setPrimitiveAccelerator((OdGiVisualizeRTRenderSettingsTraits::AcceleratorType) ExtBar::ListElement::cast(pExtBar->getElement(kUIPrimAccelTypeComboBox))->getSelString(), (OdGiVisualizeRTRenderSettingsTraits::SplitMethod) ExtBar::ListElement::cast(pExtBar->getElement(kUIPrimSplitModeComboBox))->getSelString(), ExtBar::RangeElement::cast(pExtBar->getElement(kUIPrimMaxLeafPrimsRangeBox))->getPosUInt(), ExtBar::RangeElement::cast(pExtBar->getElement(kUIPrimNodeDepthRangeBox))->getPosUInt(), ExtBar::CheckElement::cast(pExtBar->getElement(kUIPrimAccelSortCheckBox))->isChecked()); m_pClient->setToleranceOverride(ExtBar::CheckElement::cast(pExtBar->getElement(kUITolOverrideCheckBox))->isChecked(), (float)ExtBar::RangeElement::cast(pExtBar->getElement(kUIFloatTolRangeBox))->getPosFP(), ExtBar::RangeElement::cast(pExtBar->getElement(kUIDoubleTolRangeBox))->getPosFP()); m_pClient->setMinEnergy((float)ExtBar::RangeElement::cast(pExtBar->getElement(kUIMinEnergyRangeBox))->getPosFP()); // CPU renderer settings m_pClient->setLinePrimitivesEnabled(ExtBar::CheckElement::cast(pExtBar->getElement(kUILinePrimsCheckBox))->isChecked(), (float)ExtBar::RangeElement::cast(pExtBar->getElement(kUILinesWidthRangeBox))->getPosFP()); m_pClient->setMaxCPUThreads(ExtBar::RangeElement::cast(pExtBar->getElement(kUIMaxThreadsRangeBox))->getPosUInt()); m_pClient->setTileSize(ExtBar::RangeElement::cast(pExtBar->getElement(kUITileWidthRangeBox))->getPosUInt(), ExtBar::RangeElement::cast(pExtBar->getElement(kUITileHeightRangeBox))->getPosUInt()); m_pClient->setTileOrder((OdGiMrTileOrder)ExtBar::ListElement::cast(pExtBar->getElement(kUITileOrderComboBox))->getSelString()); // GPU renderer settings m_pClient->setMaxGPUBufferSubdivisions(ExtBar::RangeElement::cast(pExtBar->getElement(kUIMaxBufSubdivsRangeBox))->getPosUInt()); m_pClient->setMinGPUBufferSubdivisionSize(ExtBar::RangeElement::cast(pExtBar->getElement(kUIBufSubdivWidthRangeBox))->getPosUInt(), ExtBar::RangeElement::cast(pExtBar->getElement(kUIBufSubdivHeightRangeBox))->getPosUInt()); m_pClient->setGPUBufferScalePercents(ExtBar::RangeElement::cast(pExtBar->getElement(kUIBufScalePercsRangeBox))->getPosUInt()); m_pClient->setGPUWorkGroupSize(ExtBar::RangeElement::cast(pExtBar->getElement(kUIWorkGroupSizeRangeBox))->getPosUInt()); m_pClient->setGPUTiledRendering(ExtBar::CheckElement::cast(pExtBar->getElement(kUITiledRenderingCheckBox))->isChecked()); m_pClient->setGPUForceShadowMapsInsideReflections(ExtBar::CheckElement::cast(pExtBar->getElement(kUIForceShadowMapsCheckBox))->isChecked()); // Partial GPU renderer settings m_pClient->setPartialRenderComponents(ExtBar::RangeElement::cast(pExtBar->getElement(kUIPartComponentsRangeBox))->getPosUInt()); m_pClient->setMinimalReflectionCutoff((float)ExtBar::RangeElement::cast(pExtBar->getElement(kUIPartMinReflectRangeBox))->getPosFP()); m_pClient->setMinimalRefractionCutoff((float)ExtBar::RangeElement::cast(pExtBar->getElement(kUIPartMinRefractRangeBox))->getPosFP()); m_pClient->setMinimalLightingCutoff((float)ExtBar::RangeElement::cast(pExtBar->getElement(kUIPartMinLightRangeBox))->getPosFP()); m_pClient->setShadowTypeOverride((OdGiVisualizeRTRenderSettingsTraits::ShadowTypeOverride) ExtBar::ListElement::cast(pExtBar->getElement(kUIShadowTypeOverComboBox))->getSelString()); // Global illumination settings m_pClient->setGlobalIlluminationEnabled(ExtBar::CheckElement::cast(pExtBar->getElement(kUIGlobalIllumCheckBox))->isChecked()); m_pClient->setGlobalIlluminationSamples(ExtBar::RangeElement::cast(pExtBar->getElement(kUIGISamplesXRangeBox))->getPosInt(), ExtBar::RangeElement::cast(pExtBar->getElement(kUIGISamplesYRangeBox))->getPosInt()); m_pClient->setGlobalIlluminationRadius((float)ExtBar::RangeElement::cast(pExtBar->getElement(kUIGIRadiusRangeBox))->getPosFP()); m_pClient->setGlobalIlluminationAutoRadiusEnabled(ExtBar::CheckElement::cast(pExtBar->getElement(kUIGIAutoRadiusCheckBox))->isChecked()); m_pClient->setGlobalIlluminationAutoRadiusPercents((float)ExtBar::RangeElement::cast(pExtBar->getElement(kUIGIAutoRadiusPercRangeBox))->getPosFP()); m_pClient->setGlobalIlluminationOcclusionCoefficient((float)ExtBar::RangeElement::cast(pExtBar->getElement(kUIGIOcclusionCoefRangeBox))->getPosFP()); m_pClient->setRoughnessSamples(ExtBar::RangeElement::cast(pExtBar->getElement(kUIRoughnessSamplesXRangeBox))->getPosInt(), ExtBar::RangeElement::cast(pExtBar->getElement(kUIRoughnessSamplesYRangeBox))->getPosInt()); } virtual void elementChanged(ExtBar::Element * /*pElem*/) { /* if some element will require special handling */ } }; #include "TD_PackPop.h" #endif // ODDBVISUALIZERTRENDERSETTINGSUI