/////////////////////////////////////////////////////////////////////////////// // 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. /////////////////////////////////////////////////////////////////////////////// #ifdef TOOLKIT_EXPORT // Avoid TKBuildTest fail #ifndef ODDBVISUALIZERTRENDERSETTING #define ODDBVISUALIZERTRENDERSETTING #include "DbRenderSettings.h" #include "Gi/GiEnvironment.h" #include "Gi/GiEnvironmentTraitsData.h" #include "TD_PackPush.h" class OdDbVisualizeRTRenderSettings : public OdDbRenderSettings { protected: static const int lastKnownVersion; OdGiVisualizeRTRenderSettingsTraitsData m_rtData; public: ODDB_DECLARE_MEMBERS(OdDbVisualizeRTRenderSettings); OdDbVisualizeRTRenderSettings(); ~OdDbVisualizeRTRenderSettings(); static int getVersion(); // Global settings /** \details Specifies desirable renderer type. \param renderType [in] Renderer type. */ void setRendererType(OdGiVisualizeRTRenderSettingsTraits::RendererType renderType); /** \details Retrieves the desireable renderer type. \returns renderer type. */ OdGiVisualizeRTRenderSettingsTraits::RendererType rendererType() const; /** \details Specifies desirable rendering quality. \param renderQual [in] Rendering quality. */ void setRenderQuality(OdGiVisualizeRTRenderSettingsTraits::QualityLevel renderQual); /** \details Retrieves the desireable rendering quality. \returns rendering quality. */ OdGiVisualizeRTRenderSettingsTraits::QualityLevel renderQuality() const; /** \details Specifies default rendering shader. \param shader [in] Default rendering shader. */ void setDefaultShader(OdGiVisualizeRTRenderSettingsTraits::DefaultShader shader); /** \details Retrieves the default rendering shader. \returns default rendering shader. */ OdGiVisualizeRTRenderSettingsTraits::DefaultShader defaultShader() const; /** \details Specifies textures rendering quality. \param texQlty [in] Textures rendering quality. */ void setTextureQuality(OdGiVisualizeRTRenderSettingsTraits::TextureQuality texQlty); /** \details Retrieves the textures rendering quality. \returns textures rendering quality. */ OdGiVisualizeRTRenderSettingsTraits::TextureQuality textureQuality() const; /** \details Specifies number of samples per pixel. \param nX [in] Number of horizontal samples per pixel. \param nY [in] Number of vertical samples per pixel. */ void setPixelSamples(OdInt32 nX, OdInt32 nY); /** \details Retrieves the number of samples per pixel. \param nX [out] Number of horizontal samples per pixel. \param nY [out] Number of vertical samples per pixel. */ void pixelSamples(OdInt32 &nX, OdInt32 &nY) const; /** \details Specifies number of ray bounces (including reflections, refractions and etc.). \param nBounces [in] Number of ray bounces. */ void setMaxBounces(OdUInt32 nBounces); /** \details Retrieves the number of ray bounces (including reflections, refractions and etc.). \returns number of ray bounces. */ OdUInt32 maxBounces() const; /** \details Specifies maximal number of ray self reflections (when ray reflected inside solid object). \param nRels [in] Maximal number of ray self reflections. */ void setMaxSelfReflections(OdUInt32 nRels); /** \details Retrieves the maximal number of ray self reflections (when ray reflected inside solid object). \returns maximal number of ray self reflections. */ OdUInt32 maxSelfReflections() const; /** \details Specifies maximal number of ray self refractions (when ray refracted inside solid object). \param nRefs [in] Maximal number of ray self refractions. */ void setMaxSelfRefractions(OdUInt32 nRefs); /** \details Retrieves the maximal number of ray self refractions (when ray refracted inside solid object). \returns maximal number of ray self refractions. */ OdUInt32 maxSelfRefractions() const; /** \details Specifies settings for geometry intersecting acceleration tree. \param treeType [in] Type of geometry intersecting acceleration tree. \param splitMode [in] Acceleration tree splitting method. \param nMaxLeafPrims [in] Maximal number of geometry primitives in tree leaf. \param nNodeDepth [in] Maximal depth of tree nodes. \param bSort [in] Pre-sort geometries before adding it into BVH structures. */ void setGeometryAccelerator(OdGiVisualizeRTRenderSettingsTraits::AcceleratorType treeType, OdGiVisualizeRTRenderSettingsTraits::SplitMethod splitMode = OdGiVisualizeRTRenderSettingsTraits::kSplitSAH, OdUInt32 nMaxLeafPrims = 8, OdUInt32 nNodeDepth = 24, bool bSort = true); /** \details Retrieves the settings of geometry intersecting acceleration tree. \param treeType [out] Type of geometry intersecting acceleration tree. \param splitMode [out] Acceleration tree splitting method. \param nMaxLeafPrims [out] Maximal number of geometry primitives in tree leaf. \param nNodeDepth [out] Maximal depth of tree nodes. \param bSort [out] Pre-sort geometries before adding it into BVH structures. */ void geometryAccelerator(OdGiVisualizeRTRenderSettingsTraits::AcceleratorType &treeType, OdGiVisualizeRTRenderSettingsTraits::SplitMethod &splitMode, OdUInt32 &nMaxLeafPrims, OdUInt32 &nNodeDepth, bool &bSort) const; /** \details Specifies settings for primitives intersecting acceleration tree. \param treeType [in] Type of primitives intersecting acceleration tree. \param splitMode [in] Acceleration tree splitting method. \param nMaxLeafPrims [in] Maximal number of primitives in tree leaf. \param nNodeDepth [in] Maximal depth of tree nodes. \param bSort [in] Pre-sort primitives before adding it into BVH structures. */ void setPrimitiveAccelerator(OdGiVisualizeRTRenderSettingsTraits::AcceleratorType treeType, OdGiVisualizeRTRenderSettingsTraits::SplitMethod splitMode = OdGiVisualizeRTRenderSettingsTraits::kSplitSAH, OdUInt32 nMaxLeafPrims = 2, OdUInt32 nNodeDepth = 24, bool bSort = true); /** \details Retrieves the settings of primitives intersecting acceleration tree. \param treeType [out] Type of primitives intersecting acceleration tree. \param splitMode [out] Acceleration tree splitting method. \param nMaxLeafPrims [out] Maximal number of primitives in tree leaf. \param nNodeDepth [out] Maximal depth of tree nodes. \param bSort [out] Pre-sort primitives before adding it into BVH structures. */ void primitiveAccelerator(OdGiVisualizeRTRenderSettingsTraits::AcceleratorType &treeType, OdGiVisualizeRTRenderSettingsTraits::SplitMethod &splitMode, OdUInt32 &nMaxLeafPrims, OdUInt32 &nNodeDepth, bool &bSort) const; /** \details Specifies ray tracer tolerance override. \param bOverride [in] Enable tolerance overriding. \param fTol [in] Tolerance for single precision floating point operations. \param dTol [in] Tolerance for double precision floating point operations. */ void setToleranceOverride(bool bOverride, float fTol = 1.0e-8f, double dTol = 1.0e-10); /** \details Retrieves the ray tracer tolerance override. \param fTol [out] Tolerance for single precision floating point operations. \param dTol [out] Tolerance for double precision floating point operations. \returns true if ray tracer tolerance override enabled or false elsewhere. */ bool toleranceOverride(float &fTol, double &dTol) const; /** \details Specifies minimal processible ray energy. \param fEnergy [in] Minimal processible ray energy. */ void setMinEnergy(float fEnergy); /** \details Retrieves the minimal processible ray energy. \returns minimal processible ray energy. */ float minEnergy() const; // CPU ray-tracer options /** \details Enables line and point primitives processing (real rendering device emulation). \param bEnable [in] Enable line and point primitives processing. \param fWidth [in] Line and point primitives width. */ void setLinePrimitivesEnabled(bool bEnable, float fWidth = 1.0f); /** \details Retrieves the line and point primitives processing mode. \param fWidth [out] Line and point primitives width. \returns true if line and point primitives processing mode enabled or false elsewhere. */ bool linePrimitivesEnabled(float &fWidth) const; /** \details Specifies maximal number of CPU threads invoking rendering process. \param nThreads [in] Maximal number of CPU threads. */ void setMaxCPUThreads(OdUInt32 nThreads); /** \details Retrieves the maximal number of CPU threads invoking rendering process. \returns maximal number of CPU threads. */ OdUInt32 maxCPUThreads() const; /** \details Specifies size of single per-thread computation unit. \param nWidth [in] Width of single computation tile. \param nHeight [in] Height of single computation tile. */ void setTileSize(OdUInt32 nWidth, OdUInt32 nHeight); /** \details Retrieves the size of single per-thread computation unit. \param nWidth [out] Width of single computation tile. \param nHeight [out] Height of single computation tile. */ void tileSize(OdUInt32 &nWidth, OdUInt32 &nHeight) const; /** \details Specifies tiles processing order. \param order [in] Tiles order. */ void setTileOrder(OdGiMrTileOrder order); /** \details Retrieves the tiles processing order. \returns tiles processing order. */ OdGiMrTileOrder tileOrder() const; // GPU ray-tracer options /** \details Specifies maximum number of GPU buffer subdivisions (in 1-4 range). \param nSubdivs [in] Number of GPU buffer subdivisions. */ void setMaxGPUBufferSubdivisions(OdUInt32 nSubdivs); /** \details Retrieves the maximum number of GPU buffer subdivisions (in 1-4 range). \returns maximum number of GPU buffer subdivisions. */ OdUInt32 maxGPUBufferSubdivisions() const; /** \details Specifies minimal GPU buffer subdivision size. \param nWidth [in] Minimal width of GPU buffer subdivision. \param nHeight [in] Minimal height of GPU buffer subdivision. */ void setMinGPUBufferSubdivisionSize(OdUInt32 nWidth, OdUInt32 nHeight); /** \details Retrieves the minimal GPU buffer subdivision size. \param nWidth [out] Minimal width of GPU buffer subdivision. \param nHeight [out] Minimal height of GPU buffer subdivision. */ void minGPUBufferSubdivisionSize(OdUInt32 &nWidth, OdUInt32 &nHeight) const; /** \details Specifies GPU buffer size scale coefficient in percents. \param nPercs [in] GPU buffer size scale coefficient in percents. */ void setGPUBufferScalePercents(OdUInt32 nPercs); /** \details Retrieves the GPU buffer size scale coefficient in percents. \returns GPU buffer size scale coefficient in percents. */ OdUInt32 gpuBufferScalePercents() const; /** \details Specifies local GPU work group size. \param nThreads [in] Local GPU work group size. */ void setGPUWorkGroupSize(OdUInt32 nThreads); /** \details Retrieves the local GPU work group size. \returns Local GPU work group size. */ OdUInt32 gpuWorkGroupSize() const; /** \details Improve memory access coherency using tiled rendering. \param bEnable [in] Enable tiled rendering. */ void setGPUTiledRendering(bool bEnable); /** \details Checks does GPU tiled rendering enabled. \returns true if tiled rendering enabled or false elsewhere. */ bool gpuTiledRendering() const; /** \details Force shadow maps inside reflections in GPU renderer. \param bEnable [in] Enable shadow maps forcing inside reflections. */ void setGPUForceShadowMapsInsideReflections(bool bEnable); /** \details Checks does shadow maps usage forced inside reflections in GPU renderer. \returns true if shadow maps usage forced inside reflections or false elsewhere. */ bool gpuForceShadowMapsInsideReflections() const; // Partial GPU ray-tracer options /** \details Specifies set of partial render components to process via ray-tracing. \param nComponents [in] Set of bit flags, specified by PartialRenderComponents enumeration. */ void setPartialRenderComponents(OdUInt32 nComponents); /** \details Retrieves set of partial render components to process via ray-tracing. \returns Set of bit flags, specified by PartialRenderComponents enumeration. */ OdUInt32 partialRenderComponents() const; /** \details Specifies minimal reflection cutoff value to initiate ray-tracing. \param refCutoff [in] Minimal reflection cutoff value. */ void setMinimalReflectionCutoff(float refCutoff); /** \details Retrieves minimal reflection cutoff value to initiate ray-tracing. \returns Minimal reflection cutoff value. */ float minimalReflectionCutoff() const; /** \details Specifies minimal refraction cutoff value to initiate ray-tracing. \param refCutoff [in] Minimal refraction cutoff value. */ void setMinimalRefractionCutoff(float refCutoff); /** \details Retrieves minimal refraction cutoff value to initiate ray-tracing. \returns Minimal refraction cutoff value. */ float minimalRefractionCutoff() const; /** \details Specifies minimal lighting intensity cutoff value to initiate ray-tracing. \param lightCutoff [in] Minimal lighting intensity cutoff value. */ void setMinimalLightingCutoff(float lightCutoff); /** \details Retrieves minimal lighting intensity cutoff value to initiate ray-tracing. \returns Minimal lighting intensity cutoff value. */ float minimalLightingCutoff() const; /** \details Sets shadow type override for scene light sources. \param shadowType [in] Shadow type override value. */ void setShadowTypeOverride(OdGiVisualizeRTRenderSettingsTraits::ShadowTypeOverride shadowType); /** \details Retrieves shadow type override setting. \returns Shadow type override value. */ OdGiVisualizeRTRenderSettingsTraits::ShadowTypeOverride shadowTypeOverride() const; // Global illumination /** \details Enables global illumination. \param bSet [in] Global illumination enable flag. */ void setGlobalIlluminationEnabled(bool bSet); /** \details Retrieves the global illumination enable flag. \returns global illumination mode. */ bool globalIlluminationEnabled() const; /** \details Specifies number of global illumination samples. \param nX [in] Horizontal number of samples. \param nY [in] Vertical number of samples. */ void setGlobalIlluminationSamples(OdInt32 nX, OdInt32 nY); /** \details Retrieves the number of global illumination samples. \param nX [out] Horizontal number of samples. \param nY [out] Vertical number of samples. */ void globalIlluminationSamples(OdInt32 &nX, OdInt32 &nY) const; /** \details Specifies global illumination sampling radius. \param fRad [in] Radius. */ void setGlobalIlluminationRadius(float fRad); /** \details Retrieves the global illumination sampling radius. \returns radius. */ float globalIlluminationRadius() const; /** \details Enables global illumination radius auto-calculation. \param bSet [in] Global illumination radius auto-calculation. */ void setGlobalIlluminationAutoRadiusEnabled(bool bSet); /** \details Retrieves the global illumination radius auto-calculation enable flag. \returns global illumination radius auto-calculation mode. */ bool globalIlluminationAutoRadiusEnabled() const; /** \details Specifies global illumination radius auto-calculation coefficient (percents in 0-1 range). \param fPerc [in] Radius auto-calculation coefficient in percents. */ void setGlobalIlluminationAutoRadiusPercents(float fPerc); /** \details Retrieves the global illumination radius auto-calculation coefficient (percents in 0-1 range). \returns radius auto-calculation coefficient in percents. */ float globalIlluminationAutoRadiusPercents() const; /** \details Specifies global illumination mix coefficient between GI and AO (percents in 0-1 range). \param fCoef [in] Global illumination mixing coefficient. */ void setGlobalIlluminationOcclusionCoefficient(float fCoef); /** \details Retrieves the global illumination mix coefficient between GI and AO (percents in 0-1 range). \returns global illumination mixing coefficient. */ float globalIlluminationOcclusionCoefficient() const; /** \details Specifies number of roughness effect samples. \param nX [in] Horizontal number of samples. \param nY [in] Vertical number of samples. */ void setRoughnessSamples(OdInt32 nX, OdInt32 nY); /** \details Retrieves the number of roughness effect samples. \param nX [out] Horizontal number of samples. \param nY [out] Vertical number of samples. */ void roughnessSamples(OdInt32 &nX, OdInt32 &nY) const; // OdDbObject functions OdResult dwgInFields(OdDbDwgFiler* pFiler); void dwgOutFields(OdDbDwgFiler* pFiler) const; OdResult dxfInFields(OdDbDxfFiler* pFiler); void dxfOutFields(OdDbDxfFiler* pFiler) const; // OdGiDrawable functions OdUInt32 subSetAttributes(OdGiDrawableTraits* pTraits) const; bool operator==(const OdDbVisualizeRTRenderSettings& settings); }; /** \details This template class is a specialization of the OdSmartPtr class for OdDbVisualizeRTRenderSettings object pointers. */ typedef OdSmartPtr OdDbVisualizeRTRenderSettingsPtr; #include "TD_PackPop.h" #endif // ODDBVISUALIZERTRENDERSETTING #endif // TOOLKIT_EXPORT