OCCT3D OCCT 8.0.1
OCCT documentation

Search guides and API reference

Enter at least two characters.

    Open CASCADE Technology Reference Manual 8.0.1
    OpenGl_RaytraceGeometry Class Reference

    Stores geometry of ray-tracing scene. More...

    #include <OpenGl_SceneGeometry.hxx>

    Inheritance diagram for OpenGl_RaytraceGeometry:

    Public Member Functions

     OpenGl_RaytraceGeometry ()
     Creates uninitialized ray-tracing geometry.
     ~OpenGl_RaytraceGeometry () override
     Releases resources of ray-tracing geometry.
    void ClearMaterials ()
     Clears only ray-tracing materials.
    void Clear () override
     Clears ray-tracing geometry.
    methods related to acceleration structure

    Performs post-processing of high-level scene BVH.

    bool ProcessAcceleration ()
     Returns offset of bottom-level BVH for given leaf node. If the node index is not valid the function returns -1.
    int AccelerationOffset (int theNodeIdx)
     Returns offset of bottom-level BVH for given leaf node. If the node index is not valid the function returns -1.
    int VerticesOffset (int theNodeIdx)
     Returns offset of triangulation vertices for given leaf node. If the node index is not valid the function returns -1.
    int ElementsOffset (int theNodeIdx)
     Returns offset of triangulation elements for given leaf node. If the node index is not valid the function returns -1.
    OpenGl_TriangleSetTriangleSet (int theNodeIdx)
     Returns triangulation data for given leaf node. If the node index is not valid the function returns NULL.
    const QuadBvhHandleQuadBVH ()
     Returns quad BVH (QBVH) tree produced from binary BVH.
    methods related to texture management

    Checks if scene contains textured objects.

    bool HasTextures () const
     Adds new OpenGL texture to the scene and returns its index.
    int AddTexture (const occ::handle< OpenGl_Texture > &theTexture)
     Adds new OpenGL texture to the scene and returns its index.
    bool UpdateTextureHandles (const occ::handle< OpenGl_Context > &theContext)
     Updates unique 64-bit texture handles to use in shaders.
    bool AcquireTextures (const occ::handle< OpenGl_Context > &theContext)
     Makes the OpenGL texture handles resident (must be called before using).
    bool ReleaseTextures (const occ::handle< OpenGl_Context > &theContext) const
     Makes the OpenGL texture handles non-resident (must be called after using).
    const NCollection_LinearVector< GLuint64 > & TextureHandles () const
     Returns array of texture handles.
    void ReleaseResources (const occ::handle< OpenGl_Context > &)
     Releases OpenGL resources.
    Public Member Functions inherited from BVH_Geometry< float, 3 >
     BVH_Geometry ()
     Creates uninitialized BVH geometry.
     ~BVH_Geometry () override
     Releases resources of BVH geometry.
    virtual bool IsDirty () const
     Returns TRUE if geometry state should be updated.
    virtual void MarkDirty ()
     Marks geometry as outdated.
    BVH_Box< float, N > Box () const override
     Returns AABB of the whole geometry.
    virtual const opencascade::handle< BVH_Tree< float, N > > & BVH ()
     Returns BVH tree (and builds it if necessary).
    virtual const opencascade::handle< BVH_Builder< float, N > > & Builder () const
     Returns the method (builder) used to construct BVH.
    virtual void SetBuilder (const opencascade::handle< BVH_Builder< float, N > > &theBuilder)
     Sets the method (builder) used to construct BVH.
    Public Member Functions inherited from BVH_ObjectSet< float, N >
     BVH_ObjectSet ()=default
     Creates new set of geometric objects.
     ~BVH_ObjectSet () override=default
     Releases resources of set of geometric objects.
    BVH_ObjectListObjects ()
     Returns reference to the array of geometric objects.
    int Size () const override
     Return total number of objects.
    BVH_Box< float, N > Box (const int theIndex) const override
     Returns AABB of the given object.
    float Center (const int theIndex, const int theAxis) const override
     Returns centroid position along the given axis.
    void Swap (const int theIndex1, const int theIndex2) override
     Performs transposing the two given objects in the set.
    Public Member Functions inherited from BVH_Set< float, N >
     BVH_Set ()=default
     Creates new abstract set of objects.
    virtual ~BVH_Set ()=default
     Releases resources of set of objects.

    Data Fields

    NCollection_LinearVector< OpenGl_RaytraceLightSources
     Array of properties of light sources.
    NCollection_LinearVector< OpenGl_RaytraceMaterialMaterials
     Array of 'front' material properties.
    BVH_Vec4f Ambient
     Global ambient from all light sources.

    Static Public Attributes

    static const int INVALID_OFFSET = -1
     Value of invalid offset to return in case of errors.
    static const int MAX_TEX_NUMBER = 32
     Maximum number of textures used in ray-tracing shaders. This is not restriction of the solution implemented, but rather the reasonable limit of the number of textures in various applications (can be increased if needed).

    auxiliary methods

    Returns depth of top-level scene BVH from last build.

    NCollection_DynamicArray< occ::handle< OpenGl_Texture > > myTextures
     Array of texture maps shared between rendered objects.
    NCollection_LinearVector< GLuint64myTextureHandles
     Array of unique 64-bit texture handles obtained from OpenGL.
    int myTopLevelTreeDepth
     Depth of high-level scene BVH from last build.
    int myBotLevelTreeDepth
     Maximum depth of bottom-level scene BVHs from last build.
    QuadBvhHandle myQuadBVH
     QBVH produced from binary BVH tree.
    int TopLevelTreeDepth () const
     Array of texture maps shared between rendered objects.
    int BotLevelTreeDepth () const
     Returns maximum depth of bottom-level scene BVHs from last build.

    Additional Inherited Members

    Public Types inherited from BVH_ObjectSet< float, N >
    typedef NCollection_DynamicArray< opencascade::handle< BVH_Object< float, N > > > BVH_ObjectList
     Type of array of geometric objects.
    Public Types inherited from BVH_Set< float, N >
    typedef BVH_Box< float, N > BVH_BoxNt
    Protected Member Functions inherited from BVH_Geometry< float, 3 >
    virtual void Update ()
     Updates internal geometry state.
    Protected Attributes inherited from BVH_Geometry< float, 3 >
    bool myIsDirty
     Is geometry state outdated?
    opencascade::handle< BVH_Tree< float, N > > myBVH
     Constructed high-level BVH.
    opencascade::handle< BVH_Builder< float, N > > myBuilder
     Builder for high-level BVH.
    BVH_Box< float, N > myBox
     Cached bounding box of geometric objects.
    Protected Attributes inherited from BVH_ObjectSet< float, N >
    BVH_ObjectList myObjects
     Array of geometric objects.

    Detailed Description

    Stores geometry of ray-tracing scene.

    Constructor & Destructor Documentation

    ◆ OpenGl_RaytraceGeometry()

    OpenGl_RaytraceGeometry::OpenGl_RaytraceGeometry ( )
    inline

    Creates uninitialized ray-tracing geometry.

    ◆ ~OpenGl_RaytraceGeometry()

    OpenGl_RaytraceGeometry::~OpenGl_RaytraceGeometry ( )
    inlineoverride

    Releases resources of ray-tracing geometry.

    Member Function Documentation

    ◆ AccelerationOffset()

    int OpenGl_RaytraceGeometry::AccelerationOffset ( int theNodeIdx)

    Returns offset of bottom-level BVH for given leaf node. If the node index is not valid the function returns -1.

    Note
    Can be used after processing acceleration structure.

    ◆ AcquireTextures()

    bool OpenGl_RaytraceGeometry::AcquireTextures ( const occ::handle< OpenGl_Context > & theContext)

    Makes the OpenGL texture handles resident (must be called before using).

    ◆ AddTexture()

    int OpenGl_RaytraceGeometry::AddTexture ( const occ::handle< OpenGl_Texture > & theTexture)

    Adds new OpenGL texture to the scene and returns its index.

    ◆ BotLevelTreeDepth()

    int OpenGl_RaytraceGeometry::BotLevelTreeDepth ( ) const
    inline

    Returns maximum depth of bottom-level scene BVHs from last build.

    ◆ Clear()

    void OpenGl_RaytraceGeometry::Clear ( )
    overridevirtual

    Clears ray-tracing geometry.

    Reimplemented from BVH_ObjectSet< float, N >.

    ◆ ClearMaterials()

    void OpenGl_RaytraceGeometry::ClearMaterials ( )
    inline

    Clears only ray-tracing materials.

    ◆ ElementsOffset()

    int OpenGl_RaytraceGeometry::ElementsOffset ( int theNodeIdx)

    Returns offset of triangulation elements for given leaf node. If the node index is not valid the function returns -1.

    Note
    Can be used after processing acceleration structure.

    ◆ HasTextures()

    bool OpenGl_RaytraceGeometry::HasTextures ( ) const
    inline

    Adds new OpenGL texture to the scene and returns its index.

    ◆ ProcessAcceleration()

    bool OpenGl_RaytraceGeometry::ProcessAcceleration ( )

    Returns offset of bottom-level BVH for given leaf node. If the node index is not valid the function returns -1.

    Note
    Can be used after processing acceleration structure.

    ◆ QuadBVH()

    const QuadBvhHandle & OpenGl_RaytraceGeometry::QuadBVH ( )

    Returns quad BVH (QBVH) tree produced from binary BVH.

    ◆ ReleaseResources()

    void OpenGl_RaytraceGeometry::ReleaseResources ( const occ::handle< OpenGl_Context > & )
    inline

    Releases OpenGL resources.

    ◆ ReleaseTextures()

    bool OpenGl_RaytraceGeometry::ReleaseTextures ( const occ::handle< OpenGl_Context > & theContext) const

    Makes the OpenGL texture handles non-resident (must be called after using).

    ◆ TextureHandles()

    const NCollection_LinearVector< GLuint64 > & OpenGl_RaytraceGeometry::TextureHandles ( ) const
    inline

    Returns array of texture handles.

    ◆ TopLevelTreeDepth()

    int OpenGl_RaytraceGeometry::TopLevelTreeDepth ( ) const
    inline

    Array of texture maps shared between rendered objects.

    ◆ TriangleSet()

    OpenGl_TriangleSet * OpenGl_RaytraceGeometry::TriangleSet ( int theNodeIdx)

    Returns triangulation data for given leaf node. If the node index is not valid the function returns NULL.

    Note
    Can be used after processing acceleration structure.

    ◆ UpdateTextureHandles()

    bool OpenGl_RaytraceGeometry::UpdateTextureHandles ( const occ::handle< OpenGl_Context > & theContext)

    Updates unique 64-bit texture handles to use in shaders.

    ◆ VerticesOffset()

    int OpenGl_RaytraceGeometry::VerticesOffset ( int theNodeIdx)

    Returns offset of triangulation vertices for given leaf node. If the node index is not valid the function returns -1.

    Note
    Can be used after processing acceleration structure.

    Field Documentation

    ◆ Ambient

    BVH_Vec4f OpenGl_RaytraceGeometry::Ambient

    Global ambient from all light sources.

    ◆ INVALID_OFFSET

    const int OpenGl_RaytraceGeometry::INVALID_OFFSET = -1
    static

    Value of invalid offset to return in case of errors.

    ◆ Materials

    NCollection_LinearVector<OpenGl_RaytraceMaterial> OpenGl_RaytraceGeometry::Materials

    Array of 'front' material properties.

    ◆ MAX_TEX_NUMBER

    const int OpenGl_RaytraceGeometry::MAX_TEX_NUMBER = 32
    static

    Maximum number of textures used in ray-tracing shaders. This is not restriction of the solution implemented, but rather the reasonable limit of the number of textures in various applications (can be increased if needed).

    ◆ myBotLevelTreeDepth

    int OpenGl_RaytraceGeometry::myBotLevelTreeDepth
    protected

    Maximum depth of bottom-level scene BVHs from last build.

    ◆ myQuadBVH

    QuadBvhHandle OpenGl_RaytraceGeometry::myQuadBVH
    protected

    QBVH produced from binary BVH tree.

    ◆ myTextureHandles

    NCollection_LinearVector<GLuint64> OpenGl_RaytraceGeometry::myTextureHandles
    protected

    Array of unique 64-bit texture handles obtained from OpenGL.

    ◆ myTextures

    NCollection_DynamicArray<occ::handle<OpenGl_Texture> > OpenGl_RaytraceGeometry::myTextures
    protected

    Array of texture maps shared between rendered objects.

    ◆ myTopLevelTreeDepth

    int OpenGl_RaytraceGeometry::myTopLevelTreeDepth
    protected

    Depth of high-level scene BVH from last build.

    ◆ Sources

    NCollection_LinearVector<OpenGl_RaytraceLight> OpenGl_RaytraceGeometry::Sources

    Array of properties of light sources.


    The documentation for this class was generated from the following file: