Open CASCADE Technology  7.2.0
Data Structures | Public Member Functions

OpenGl_View Class Reference

Implementation of OpenGl view. More...

#include <OpenGl_View.hxx>

Inheritance diagram for OpenGl_View:
Inheritance graph
[legend]

Data Structures

struct  RaytracingParams
 Compile-time ray-tracing parameters. More...
 
class  ShaderSource
 Tool class for management of shader sources. More...
 
struct  StructState
 Describes state of OpenGL structure. More...
 

Public Member Functions

 OpenGl_View (const Handle< Graphic3d_StructureManager > &theMgr, const Handle< OpenGl_GraphicDriver > &theDriver, const Handle< OpenGl_Caps > &theCaps, OpenGl_StateCounter *theCounter)
 Constructor. More...
 
virtual ~OpenGl_View ()
 Default destructor. More...
 
void ReleaseGlResources (const Handle< OpenGl_Context > &theCtx)
 
virtual void Remove () override
 Deletes and erases the view. More...
 
Standard_Boolean SetImmediateModeDrawToFront (const Standard_Boolean theDrawToFrontBuffer) override
 
virtual void SetWindow (const Handle< Aspect_Window > &theWindow, const Aspect_RenderingContext theContext) override
 Creates and maps rendering window to the view. More...
 
virtual Handle< Aspect_WindowWindow () const override
 Returns window associated with the view. More...
 
virtual Standard_Boolean IsDefined () const override
 Returns True if the window associated to the view is defined. More...
 
virtual void Resized () override
 Handle changing size of the rendering window. More...
 
virtual void Redraw () override
 Redraw content of the view. More...
 
virtual void RedrawImmediate () override
 Redraw immediate content of the view. More...
 
virtual void Invalidate () override
 Marks BVH tree for given priority list as dirty and marks primitive set for rebuild. More...
 
virtual Standard_Boolean IsInvalidated () override
 Return true if view content cache has been invalidated. More...
 
const Graphic3d_GraduatedTrihedronGetGraduatedTrihedron () override
 Returns data of a graduated trihedron. More...
 
virtual void GraduatedTrihedronDisplay (const Graphic3d_GraduatedTrihedron &theTrihedronData) override
 Displays Graduated Trihedron. More...
 
virtual void GraduatedTrihedronErase () override
 Erases Graduated Trihedron. More...
 
virtual void GraduatedTrihedronMinMaxValues (const Graphic3d_Vec3 theMin, const Graphic3d_Vec3 theMax) override
 Sets minimum and maximum points of scene bounding box for Graduated Trihedron stored in graphic view object. More...
 
virtual Standard_Boolean BufferDump (Image_PixMap &theImage, const Graphic3d_BufferType &theBufferType) override
 Dump active rendering buffer into specified memory buffer. In Ray-Tracing allow to get a raw HDR buffer using Graphic3d_BT_RGB_RayTraceHdrLeft buffer type, only Left view will be dumped ignoring stereoscopic parameter. More...
 
virtual Standard_Boolean Export (const Standard_CString theFileName, const Graphic3d_ExportFormat theFormat, const Graphic3d_SortType theSortType=Graphic3d_ST_BSP_Tree) override
 Export scene into the one of the Vector graphics formats (SVG, PS, PDF...). In contrast to Bitmaps, Vector graphics is scalable (so you may got quality benefits on printing to laser printer). Notice however that results may differ a lot and do not contain some elements. More...
 
virtual void InvalidateBVHData (const Standard_Integer theLayerId) override
 Marks BVH tree and the set of BVH primitives of correspondent priority list with id theLayerId as outdated. More...
 
virtual void AddZLayer (const Graphic3d_ZLayerId theLayerId) override
 Insert a new top-level z layer with the given ID. More...
 
virtual void RemoveZLayer (const Graphic3d_ZLayerId theLayerId) override
 Remove a z layer with the given ID. More...
 
virtual void SetZLayerSettings (const Graphic3d_ZLayerId theLayerId, const Graphic3d_ZLayerSettings &theSettings) override
 Sets the settings for a single Z layer of specified view. More...
 
virtual Standard_Integer ZLayerMax () const override
 Returns the maximum Z layer ID. First layer ID is Graphic3d_ZLayerId_Default, last ID is ZLayerMax(). More...
 
virtual void InvalidateZLayerBoundingBox (const Graphic3d_ZLayerId theLayerId) const override
 Returns the bounding box of all structures displayed in the Z layer. Never fails. If Z layer does not exist nothing happens. More...
 
virtual Bnd_Box ZLayerBoundingBox (const Graphic3d_ZLayerId theLayerId, const Handle< Graphic3d_Camera > &theCamera, const Standard_Integer theWindowWidth, const Standard_Integer theWindowHeight, const Standard_Boolean theToIncludeAuxiliary) const override
 Returns the bounding box of all structures displayed in the Z layer. If Z layer does not exist the empty box is returned. More...
 
virtual Handle< Standard_TransientFBO () const override
 Returns pointer to an assigned framebuffer object. More...
 
virtual void SetFBO (const Handle< Standard_Transient > &theFbo) override
 Sets framebuffer object for offscreen rendering. More...
 
virtual Handle< Standard_TransientFBOCreate (const Standard_Integer theWidth, const Standard_Integer theHeight) override
 Generate offscreen FBO in the graphic library. If not supported on hardware returns NULL. More...
 
virtual void FBORelease (Handle< Standard_Transient > &theFbo) override
 Remove offscreen FBO from the graphic library. More...
 
virtual void FBOGetDimensions (const Handle< Standard_Transient > &theFbo, Standard_Integer &theWidth, Standard_Integer &theHeight, Standard_Integer &theWidthMax, Standard_Integer &theHeightMax) override
 Read offscreen FBO configuration. More...
 
virtual void FBOChangeViewport (const Handle< Standard_Transient > &theFbo, const Standard_Integer theWidth, const Standard_Integer theHeight) override
 Change offscreen FBO viewport. More...
 
virtual Aspect_Background Background () const override
 Returns background fill color. More...
 
virtual void SetBackground (const Aspect_Background &theBackground) override
 Sets background fill color. More...
 
virtual Aspect_GradientBackground GradientBackground () const override
 Returns gradient background fill colors. More...
 
virtual void SetGradientBackground (const Aspect_GradientBackground &theBackground) override
 Sets gradient background fill colors. More...
 
virtual TCollection_AsciiString BackgroundImage () override
 Returns background image texture file path. More...
 
virtual void SetBackgroundImage (const TCollection_AsciiString &theFilePath) override
 Sets background image texture file path. More...
 
virtual Aspect_FillMethod BackgroundImageStyle () const override
 Returns background image fill style. More...
 
virtual void SetBackgroundImageStyle (const Aspect_FillMethod theFillStyle) override
 Sets background image fill style. More...
 
virtual Handle< Graphic3d_TextureEnvTextureEnv () const override
 Returns environment texture set for the view. More...
 
virtual void SetTextureEnv (const Handle< Graphic3d_TextureEnv > &theTextureEnv) override
 Sets environment texture for the view. More...
 
virtual Standard_Boolean IsCullingEnabled () const override
 Returns the state of frustum culling optimization. More...
 
virtual void SetCullingEnabled (const Standard_Boolean theIsEnabled) override
 Enables or disables frustum culling optimization. More...
 
virtual Graphic3d_TypeOfShadingModel ShadingModel () const override
 Returns shading model of the view. More...
 
virtual void SetShadingModel (const Graphic3d_TypeOfShadingModel theModel) override
 Sets shading model of the view. More...
 
virtual Graphic3d_TypeOfBackfacingModel BackfacingModel () const override
 Return backfacing model used for the view. More...
 
virtual void SetBackfacingModel (const Graphic3d_TypeOfBackfacingModel theModel) override
 Sets backfacing model for the view. More...
 
virtual const Handle< Graphic3d_Camera > & Camera () const override
 Returns camera object of the view. More...
 
const gp_XYZLocalOrigin () const
 Returns local camera origin currently set for rendering, might be modified during rendering. More...
 
void SetLocalOrigin (const gp_XYZ &theOrigin)
 Setup local camera origin currently set for rendering. More...
 
virtual void SetCamera (const Handle< Graphic3d_Camera > &theCamera) override
 Sets camera used by the view. More...
 
virtual const Graphic3d_ListOfCLightLights () const override
 Returns list of lights of the view. More...
 
virtual void SetLights (const Graphic3d_ListOfCLight &theLights) override
 Sets list of lights for the view. More...
 
virtual const Handle< Graphic3d_SequenceOfHClipPlane > & ClipPlanes () const override
 Returns list of clip planes set for the view. More...
 
virtual void SetClipPlanes (const Handle< Graphic3d_SequenceOfHClipPlane > &thePlanes) override
 Sets list of clip planes for the view. More...
 
virtual void DiagnosticInformation (TColStd_IndexedDataMapOfStringString &theDict, Graphic3d_DiagnosticInfo theFlags) const override
 Fill in the dictionary with diagnostic info. Should be called within rendering thread. More...
 
const Quantity_ColorRGBABackgroundColor () const
 Returns background color. More...
 
OpenGl_GraduatedTrihedronChangeGraduatedTrihedron ()
 Change graduated trihedron. More...
 
void SetTextureEnv (const Handle< OpenGl_Context > &theCtx, const Handle< Graphic3d_TextureEnv > &theTexture)
 
void SetBackgroundTextureStyle (const Aspect_FillMethod FillStyle)
 
void SetBackgroundGradient (const Quantity_Color &AColor1, const Quantity_Color &AColor2, const Aspect_GradientFillMethod AType)
 
void SetBackgroundGradientType (const Aspect_GradientFillMethod AType)
 
const OpenGl_LayerListLayerList () const
 Returns list of OpenGL Z-layers. More...
 
const OpenGl_ListOfLightLightList () const
 Returns list of openGL light sources. More...
 
const Handle< OpenGl_WindowGlWindow () const
 Returns OpenGL window implementation. More...
 
const Handle< OpenGl_TextureSet > & GlTextureEnv () const
 Returns OpenGL environment map. More...
 
OpenGl_BVHTreeSelectorBVHTreeSelector ()
 Returns selector for BVH tree, providing a possibility to store information about current view volume and to detect which objects are overlapping it. More...
 
bool HasImmediateStructures () const
 Returns true if there are immediate structures to display. More...
 
- Public Member Functions inherited from Graphic3d_CView
 Graphic3d_CView (const Handle< Graphic3d_StructureManager > &theMgr)
 Constructor. More...
 
virtual ~Graphic3d_CView ()
 Destructor. More...
 
Standard_Integer Identification () const
 Returns the identification number of the view. More...
 
virtual void Activate ()
 Activates the view. Maps presentations defined within structure manager onto this view. More...
 
virtual void Deactivate ()
 Deactivates the view. Unmaps presentations defined within structure manager. The view in deactivated state will ignore actions on structures such as Display(). More...
 
Standard_Boolean IsActive () const
 Returns the activity flag of the view. More...
 
Standard_Boolean IsRemoved () const
 Returns true if the view was removed. More...
 
Graphic3d_TypeOfVisualization VisualizationType () const
 Returns visualization type of the view. More...
 
void SetVisualizationType (const Graphic3d_TypeOfVisualization theType)
 Sets visualization type of the view. More...
 
void SetComputedMode (const Standard_Boolean theMode)
 Switches computed HLR mode in the view. More...
 
Standard_Boolean ComputedMode () const
 Returns the computed HLR mode state. More...
 
void ReCompute (const Handle< Graphic3d_Structure > &theStructure)
 Computes the new presentation of the structure displayed in this view with the type Graphic3d_TOS_COMPUTED. More...
 
void Update (const Graphic3d_ZLayerId theLayerId=Graphic3d_ZLayerId_UNKNOWN)
 Invalidates bounding box of specified ZLayerId. More...
 
void Compute ()
 Computes the new presentation of the structures displayed in this view with the type Graphic3d_TOS_COMPUTED. More...
 
Standard_Boolean ContainsFacet () const
 Returns Standard_True if one of the structures displayed in the view contains Polygons, Triangles or Quadrangles. More...
 
Standard_Boolean ContainsFacet (const Graphic3d_MapOfStructure &theSet) const
 Returns Standard_True if one of the structures in the set contains Polygons, Triangles or Quadrangles. More...
 
void DisplayedStructures (Graphic3d_MapOfStructure &theStructures) const
 Returns the set of structures displayed in this view. More...
 
virtual Standard_Integer NumberOfDisplayedStructures () const
 Returns number of displayed structures in the view. More...
 
const Handle< Graphic3d_NMapOfTransient > & HiddenObjects () const
 Returns map of objects hidden within this specific view (not viewer-wise). More...
 
Handle< Graphic3d_NMapOfTransient > & ChangeHiddenObjects ()
 Returns map of objects hidden within this specific view (not viewer-wise). More...
 
Standard_Boolean IsComputed (const Standard_Integer theStructId, Handle< Graphic3d_Structure > &theComputedStruct) const
 Returns Standard_True in case if the structure with the given <theStructId> is in list of structures to be computed and stores computed struct to <theComputedStruct>. More...
 
virtual Bnd_Box MinMaxValues (const Standard_Boolean theToIncludeAuxiliary=Standard_False) const
 Returns the bounding box of all structures displayed in the view. If theToIncludeAuxiliary is TRUE, then the boundary box also includes minimum and maximum limits of graphical elements forming parts of infinite and other auxiliary structures. More...
 
Bnd_Box MinMaxValues (const Graphic3d_MapOfStructure &theSet, const Standard_Boolean theToIncludeAuxiliary=Standard_False) const
 Returns the coordinates of the boundary box of all structures in the set <theSet>. If <theToIgnoreInfiniteFlag> is TRUE, then the boundary box also includes minimum and maximum limits of graphical elements forming parts of infinite structures. More...
 
const Handle< Graphic3d_StructureManager > & StructureManager () const
 Returns the structure manager handle which manage structures associated with this view. More...
 
Standard_Real ConsiderZoomPersistenceObjects ()
 Returns zoom-scale factor. More...
 
virtual void CopySettings (const Handle< Graphic3d_CView > &theOther)
 Copy visualization settings from another view. Method is used for cloning views in viewer when its required to create view with same view properties. More...
 
const Graphic3d_RenderingParamsRenderingParams () const
 Returns current rendering parameters and effect settings. More...
 
Graphic3d_RenderingParamsChangeRenderingParams ()
 Returns reference to current rendering parameters and effect settings. More...
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor. More...
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing. More...
 
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter. More...
 
virtual ~Standard_Transient ()
 Destructor must be virtual. More...
 
virtual void Delete () const
 Memory deallocator for transient classes. More...
 
virtual const opencascade::handle< Standard_Type > & DynamicType () const
 Returns a type descriptor about this object. More...
 
Standard_Boolean IsInstance (const opencascade::handle< Standard_Type > &theType) const
 Returns a true value if this is an instance of Type. More...
 
Standard_Boolean IsInstance (const Standard_CString theTypeName) const
 Returns a true value if this is an instance of TypeName. More...
 
Standard_Boolean IsKind (const opencascade::handle< Standard_Type > &theType) const
 Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More...
 
Standard_Boolean IsKind (const Standard_CString theTypeName) const
 Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More...
 
Standard_TransientThis () const
 Returns non-const pointer to this object (like const_cast). For protection against creating handle to objects allocated in stack or call from constructor, it will raise exception Standard_ProgramError if reference counter is zero. More...
 
Standard_Integer GetRefCount () const
 Get the reference counter of this object. More...
 
void IncrementRefCounter () const
 Increments the reference counter of this object. More...
 
Standard_Integer DecrementRefCounter () const
 Decrements the reference counter of this object; returns the decremented value. More...
 

Protected Member Functions

Internal methods for managing GL resources
void initTextureEnv (const Handle< OpenGl_Context > &theContext)
 Initializes OpenGl resource for environment texture. More...
 
low-level redrawing sub-routines
virtual void redraw (const Graphic3d_Camera::Projection theProjection, OpenGl_FrameBuffer *theReadDrawFbo, OpenGl_FrameBuffer *theOitAccumFbo)
 Redraws view for the given monographic camera projection, or left/right eye. More...
 
virtual bool redrawImmediate (const Graphic3d_Camera::Projection theProjection, OpenGl_FrameBuffer *theReadFbo, OpenGl_FrameBuffer *theDrawFbo, OpenGl_FrameBuffer *theOitAccumFbo, const Standard_Boolean theIsPartialUpdate=Standard_False)
 Redraws view for the given monographic camera projection, or left/right eye. More...
 
bool blitBuffers (OpenGl_FrameBuffer *theReadFbo, OpenGl_FrameBuffer *theDrawFbo, const Standard_Boolean theToFlip=Standard_False)
 Blit image from/to specified buffers. More...
 
void bindDefaultFbo (OpenGl_FrameBuffer *theCustomFbo=NULL)
 Setup default FBO. More...
 
methods related to ray-tracing
Standard_Boolean updateRaytraceGeometry (const RaytraceUpdateMode theMode, const Standard_Integer theViewId, const Handle< OpenGl_Context > &theGlContext)
 Updates 3D scene geometry for ray-tracing. More...
 
Standard_Boolean updateRaytraceLightSources (const OpenGl_Mat4 &theInvModelView, const Handle< OpenGl_Context > &theGlContext)
 Updates 3D scene light sources for ray-tracing. More...
 
Standard_Boolean toUpdateStructure (const OpenGl_Structure *theStructure)
 Checks to see if the OpenGL structure is modified. More...
 
Standard_Boolean addRaytraceStructure (const OpenGl_Structure *theStructure, const Handle< OpenGl_Context > &theGlContext)
 Adds OpenGL structure to ray-traced scene geometry. More...
 
Standard_Boolean addRaytraceGroups (const OpenGl_Structure *theStructure, const OpenGl_RaytraceMaterial &theStructMat, const Handle< Geom_Transformation > &theTrsf, const Handle< OpenGl_Context > &theGlContext)
 Adds OpenGL groups to ray-traced scene geometry. More...
 
OpenGl_RaytraceMaterial convertMaterial (const OpenGl_AspectFace *theAspect, const Handle< OpenGl_Context > &theGlContext)
 Creates ray-tracing material properties. More...
 
Handle< OpenGl_TriangleSetaddRaytracePrimitiveArray (const OpenGl_PrimitiveArray *theArray, const Standard_Integer theMatID, const OpenGl_Mat4 *theTrans)
 Adds OpenGL primitive array to ray-traced scene geometry. More...
 
Standard_Boolean addRaytraceVertexIndices (OpenGl_TriangleSet &theSet, const Standard_Integer theMatID, const Standard_Integer theCount, const Standard_Integer theOffset, const OpenGl_PrimitiveArray &theArray)
 Adds vertex indices from OpenGL primitive array to ray-traced scene geometry. More...
 
Standard_Boolean addRaytraceTriangleArray (OpenGl_TriangleSet &theSet, const Standard_Integer theMatID, const Standard_Integer theCount, const Standard_Integer theOffset, const Handle< Graphic3d_IndexBuffer > &theIndices)
 Adds OpenGL triangle array to ray-traced scene geometry. More...
 
Standard_Boolean addRaytraceTriangleFanArray (OpenGl_TriangleSet &theSet, const Standard_Integer theMatID, const Standard_Integer theCount, const Standard_Integer theOffset, const Handle< Graphic3d_IndexBuffer > &theIndices)
 Adds OpenGL triangle fan array to ray-traced scene geometry. More...
 
Standard_Boolean addRaytraceTriangleStripArray (OpenGl_TriangleSet &theSet, const Standard_Integer theMatID, const Standard_Integer theCount, const Standard_Integer theOffset, const Handle< Graphic3d_IndexBuffer > &theIndices)
 Adds OpenGL triangle strip array to ray-traced scene geometry. More...
 
Standard_Boolean addRaytraceQuadrangleArray (OpenGl_TriangleSet &theSet, const Standard_Integer theMatID, const Standard_Integer theCount, const Standard_Integer theOffset, const Handle< Graphic3d_IndexBuffer > &theIndices)
 Adds OpenGL quadrangle array to ray-traced scene geometry. More...
 
Standard_Boolean addRaytraceQuadrangleStripArray (OpenGl_TriangleSet &theSet, const Standard_Integer theMatID, const Standard_Integer theCount, const Standard_Integer theOffset, const Handle< Graphic3d_IndexBuffer > &theIndices)
 Adds OpenGL quadrangle strip array to ray-traced scene geometry. More...
 
Standard_Boolean addRaytracePolygonArray (OpenGl_TriangleSet &theSet, const Standard_Integer theMatID, const Standard_Integer theCount, const Standard_Integer theOffset, const Handle< Graphic3d_IndexBuffer > &theIndices)
 Adds OpenGL polygon array to ray-traced scene geometry. More...
 
Standard_Boolean uploadRaytraceData (const Handle< OpenGl_Context > &theGlContext)
 Uploads ray-trace data to the GPU. More...
 
TCollection_AsciiString generateShaderPrefix (const Handle< OpenGl_Context > &theGlContext) const
 Generates shader prefix based on current ray-tracing options. More...
 
Standard_Boolean safeFailBack (const TCollection_ExtendedString &theMessage, const Handle< OpenGl_Context > &theGlContext)
 Performs safe exit when shaders initialization fails. More...
 
Handle< OpenGl_ShaderObjectinitShader (const GLenum theType, const ShaderSource &theSource, const Handle< OpenGl_Context > &theGlContext)
 Loads and compiles shader object from specified source. More...
 
Handle< OpenGl_ShaderPrograminitProgram (const Handle< OpenGl_Context > &theGlContext, const Handle< OpenGl_ShaderObject > &theVertShader, const Handle< OpenGl_ShaderObject > &theFragShader)
 Creates shader program from the given vertex and fragment shaders. More...
 
Standard_Boolean initRaytraceResources (const Handle< OpenGl_Context > &theGlContext)
 Initializes OpenGL/GLSL shader programs. More...
 
void releaseRaytraceResources (const Handle< OpenGl_Context > &theGlContext, const Standard_Boolean theToRebuild=Standard_False)
 Releases OpenGL/GLSL shader programs. More...
 
Standard_Boolean updateRaytraceBuffers (const Standard_Integer theSizeX, const Standard_Integer theSizeY, const Handle< OpenGl_Context > &theGlContext)
 Updates auxiliary OpenGL frame buffers. More...
 
void updateCamera (const OpenGl_Mat4 &theOrientation, const OpenGl_Mat4 &theViewMapping, OpenGl_Vec3 *theOrigins, OpenGl_Vec3 *theDirects, OpenGl_Mat4 &theView, OpenGl_Mat4 &theUnView)
 Generates viewing rays for corners of screen quad. (ray tracing; path tracing for orthographic camera) More...
 
void updatePerspCameraPT (const OpenGl_Mat4 &theOrientation, const OpenGl_Mat4 &theViewMapping, Graphic3d_Camera::Projection theProjection, OpenGl_Mat4 &theViewPr, OpenGl_Mat4 &theUnview, const int theWinSizeX, const int theWinSizeY)
 Generate viewing rays (path tracing, perspective camera). More...
 
void bindRaytraceTextures (const Handle< OpenGl_Context > &theGlContext)
 Binds ray-trace textures to corresponding texture units. More...
 
void unbindRaytraceTextures (const Handle< OpenGl_Context > &theGlContext)
 Unbinds ray-trace textures from corresponding texture unit. More...
 
Standard_Boolean setUniformState (const Standard_Integer theProgramId, const Standard_Integer theSizeX, const Standard_Integer theSizeY, Graphic3d_Camera::Projection theProjection, const Handle< OpenGl_Context > &theGlContext)
 Sets uniform state for the given ray-tracing shader program. More...
 
Standard_Boolean runRaytraceShaders (const Standard_Integer theSizeX, const Standard_Integer theSizeY, Graphic3d_Camera::Projection theProjection, OpenGl_FrameBuffer *theReadDrawFbo, const Handle< OpenGl_Context > &theGlContext)
 Runs ray-tracing shader programs. More...
 
Standard_Boolean runRaytrace (const Standard_Integer theSizeX, const Standard_Integer theSizeY, Graphic3d_Camera::Projection theProjection, OpenGl_FrameBuffer *theReadDrawFbo, const Handle< OpenGl_Context > &theGlContext)
 Runs classical (Whitted-style) ray-tracing kernel. More...
 
Standard_Boolean runPathtrace (const Standard_Integer theSizeX, const Standard_Integer theSizeY, Graphic3d_Camera::Projection theProjection, OpenGl_FrameBuffer *theReadDrawFbo, const Handle< OpenGl_Context > &theGlContext)
 Runs path tracing (global illumination) kernel. More...
 
Standard_Boolean raytrace (const Standard_Integer theSizeX, const Standard_Integer theSizeY, Graphic3d_Camera::Projection theProjection, OpenGl_FrameBuffer *theReadDrawFbo, const Handle< OpenGl_Context > &theGlContext)
 Redraws the window using OpenGL/GLSL ray-tracing or path tracing. More...
 
- Protected Member Functions inherited from Graphic3d_DataStructureManager
 Graphic3d_DataStructureManager ()
 Initializes the manager <me>. More...
 

Protected Attributes

Rendering properties
GLint myFboColorFormat
 Two framebuffers (left and right views) store cached main presentation of the view (without presentation of immediate layers). More...
 
GLint myFboDepthFormat
 sized format for depth-stencil attachments More...
 
OpenGl_ColorFormats myFboOitColorConfig
 selected color format configuration for OIT color attachments More...
 
Handle< OpenGl_FrameBuffermyMainSceneFbos [2]
 Two framebuffers (left and right views) store cached main presentation of the view (without presentation of immediate layers). More...
 
Handle< OpenGl_FrameBuffermyMainSceneFbosOit [2]
 Additional buffers for transparent draw of main layer. More...
 
Handle< OpenGl_FrameBuffermyImmediateSceneFbos [2]
 Additional buffers for immediate layer in stereo mode. More...
 
Handle< OpenGl_FrameBuffermyImmediateSceneFbosOit [2]
 Additional buffers for transparency draw of immediate layer. More...
 
OpenGl_VertexBuffer myFullScreenQuad
 Vertices for full-screen quad rendering. More...
 
OpenGl_VertexBuffer myFullScreenQuadFlip
 Two framebuffers (left and right views) store cached main presentation of the view (without presentation of immediate layers). More...
 
Standard_Boolean myToFlipOutput
 Flag to draw result image upside-down. More...
 
unsigned int myFrameCounter
 redraw counter, for debugging More...
 
Standard_Boolean myHasFboBlit
 disable FBOs on failure More...
 
Standard_Boolean myToDisableOIT
 disable OIT on failure More...
 
Standard_Boolean myToDisableOITMSAA
 disable OIT with MSAA on failure More...
 
Standard_Boolean myToDisableMSAA
 disable MSAA after failure More...
 
Standard_Boolean myTransientDrawToFront
 optimization flag for immediate mode (to render directly to the front buffer) More...
 
Standard_Boolean myBackBufferRestored
 Two framebuffers (left and right views) store cached main presentation of the view (without presentation of immediate layers). More...
 
Standard_Boolean myIsImmediateDrawn
 flag indicates that immediate mode buffer contains some data More...
 
Background parameters
OpenGl_AspectFacemyTextureParams
 Stores texture and its parameters for textured background. More...
 
OpenGl_BackgroundArraymyBgGradientArray
 Primitive array for gradient background. More...
 
OpenGl_BackgroundArraymyBgTextureArray
 Primitive array for texture background. More...
 
- Protected Attributes inherited from Graphic3d_CView
Standard_Integer myId
 
Graphic3d_RenderingParams myRenderParams
 
Handle< Graphic3d_StructureManagermyStructureManager
 
Graphic3d_SequenceOfStructure myStructsToCompute
 
Graphic3d_SequenceOfStructure myStructsComputed
 
Graphic3d_MapOfStructure myStructsDisplayed
 
Handle< Graphic3d_NMapOfTransientmyHiddenObjects
 
Standard_Boolean myIsInComputedMode
 
Standard_Boolean myIsActive
 
Standard_Boolean myIsRemoved
 
Graphic3d_TypeOfVisualization myVisualization
 

Rendering of GL graphics (with prepared drawing buffer).

typedef std::pair< Standard_Size, Standard_SizeStateInfo
 main list of displayed structure, sorted by layers More...
 
OpenGl_GraphicDrivermyDriver
 main list of displayed structure, sorted by layers More...
 
Handle< OpenGl_WindowmyWindow
 main list of displayed structure, sorted by layers More...
 
Handle< OpenGl_WorkspacemyWorkspace
 main list of displayed structure, sorted by layers More...
 
Handle< OpenGl_CapsmyCaps
 main list of displayed structure, sorted by layers More...
 
Standard_Boolean myWasRedrawnGL
 main list of displayed structure, sorted by layers More...
 
Standard_Boolean myCulling
 main list of displayed structure, sorted by layers More...
 
Graphic3d_TypeOfShadingModel myShadingModel
 main list of displayed structure, sorted by layers More...
 
Graphic3d_TypeOfBackfacingModel myBackfacing
 main list of displayed structure, sorted by layers More...
 
Quantity_ColorRGBA myBgColor
 main list of displayed structure, sorted by layers More...
 
Handle< Graphic3d_SequenceOfHClipPlanemyClipPlanes
 main list of displayed structure, sorted by layers More...
 
Handle< Graphic3d_CameramyCamera
 main list of displayed structure, sorted by layers More...
 
gp_XYZ myLocalOrigin
 main list of displayed structure, sorted by layers More...
 
Handle< OpenGl_FrameBuffermyFBO
 main list of displayed structure, sorted by layers More...
 
Standard_Boolean myToShowGradTrihedron
 main list of displayed structure, sorted by layers More...
 
TCollection_AsciiString myBackgroundImagePath
 main list of displayed structure, sorted by layers More...
 
Handle< Graphic3d_TextureEnvmyTextureEnvData
 main list of displayed structure, sorted by layers More...
 
Graphic3d_GraduatedTrihedron myGTrihedronData
 main list of displayed structure, sorted by layers More...
 
OpenGl_ListOfLight myNoShadingLight
 main list of displayed structure, sorted by layers More...
 
OpenGl_ListOfLight myLights
 main list of displayed structure, sorted by layers More...
 
OpenGl_LayerList myZLayers
 main list of displayed structure, sorted by layers More...
 
Graphic3d_WorldViewProjState myWorldViewProjState
 camera modification state More...
 
OpenGl_StateCountermyStateCounter
 main list of displayed structure, sorted by layers More...
 
Standard_Size myCurrLightSourceState
 main list of displayed structure, sorted by layers More...
 
StateInfo myLastOrientationState
 main list of displayed structure, sorted by layers More...
 
StateInfo myLastViewMappingState
 main list of displayed structure, sorted by layers More...
 
StateInfo myLastLightSourceState
 main list of displayed structure, sorted by layers More...
 
OpenGl_BVHTreeSelector myBVHSelector
 Is needed for selection of overlapping objects and storage of the current view volume. More...
 
OpenGl_GraduatedTrihedron myGraduatedTrihedron
 main list of displayed structure, sorted by layers More...
 
Handle< OpenGl_TextureSetmyTextureEnv
 main list of displayed structure, sorted by layers More...
 
Handle< OpenGl_FrameBuffermyOpenGlFBO
 Framebuffers for OpenGL output. More...
 
Handle< OpenGl_FrameBuffermyOpenGlFBO2
 main list of displayed structure, sorted by layers More...
 
virtual void render (Graphic3d_Camera::Projection theProjection, OpenGl_FrameBuffer *theReadDrawFbo, OpenGl_FrameBuffer *theOitAccumFbo, const Standard_Boolean theToDrawImmediate)
 Renders the graphical contents of the view into the preprepared window or framebuffer. More...
 
virtual void renderScene (Graphic3d_Camera::Projection theProjection, OpenGl_FrameBuffer *theReadDrawFbo, OpenGl_FrameBuffer *theOitAccumFbo, const Standard_Boolean theToDrawImmediate)
 Renders the graphical scene. More...
 
virtual void drawBackground (const Handle< OpenGl_Workspace > &theWorkspace)
 Draw background (gradient / image) More...
 
virtual void renderStructs (Graphic3d_Camera::Projection theProjection, OpenGl_FrameBuffer *theReadDrawFbo, OpenGl_FrameBuffer *theOitAccumFbo, const Standard_Boolean theToDrawImmediate)
 Render set of structures presented in the view. More...
 
void renderTrihedron (const Handle< OpenGl_Workspace > &theWorkspace)
 Renders trihedron. More...
 

data types related to ray-tracing

enum  RaytraceInitStatus { OpenGl_RT_NONE, OpenGl_RT_INIT, OpenGl_RT_FAIL }
 Result of OpenGL shaders initialization. More...
 
enum  RaytraceUpdateMode { OpenGl_GUM_CHECK, OpenGl_GUM_PREPARE, OpenGl_GUM_REBUILD }
 Describes update mode (state). More...
 
enum  ShaderVariableIndex {
  OpenGl_RT_aPosition, OpenGl_RT_uOriginLT, OpenGl_RT_uOriginLB, OpenGl_RT_uOriginRT,
  OpenGl_RT_uOriginRB, OpenGl_RT_uDirectLT, OpenGl_RT_uDirectLB, OpenGl_RT_uDirectRT,
  OpenGl_RT_uDirectRB, OpenGl_RT_uViewPrMat, OpenGl_RT_uUnviewMat, OpenGl_RT_uSceneRad,
  OpenGl_RT_uSceneEps, OpenGl_RT_uLightAmbnt, OpenGl_RT_uLightCount, OpenGl_RT_uBackColorTop,
  OpenGl_RT_uBackColorBot, OpenGl_RT_uShadowsEnabled, OpenGl_RT_uReflectEnabled, OpenGl_RT_uSphereMapEnabled,
  OpenGl_RT_uSphereMapForBack, OpenGl_RT_uTexSamplersArray, OpenGl_RT_uBlockedRngEnabled, OpenGl_RT_uWinSizeX,
  OpenGl_RT_uWinSizeY, OpenGl_RT_uAccumSamples, OpenGl_RT_uFrameRndSeed, OpenGl_RT_uOffsetX,
  OpenGl_RT_uOffsetY, OpenGl_RT_uSamples, OpenGl_RT_uRenderImage, OpenGl_RT_uOffsetImage,
  OpenGl_RT_uMaxRadiance, OpenGl_RT_NbVariables
}
 Defines frequently used shader variables. More...
 
enum  ShaderImageNames {
  OpenGl_RT_OutputImageLft = 0, OpenGl_RT_OutputImageRgh = 1, OpenGl_RT_VisualErrorImageLft = 2, OpenGl_RT_VisualErrorImageRgh = 3,
  OpenGl_RT_TileOffsetsImageLft = 4, OpenGl_RT_TileOffsetsImageRgh = 5
}
 Defines OpenGL image samplers. More...
 
static const Standard_Integer THE_DEFAULT_NB_BOUNCES = 3
 Default ray-tracing depth. More...
 
static const Standard_Integer THE_DEFAULT_STACK_SIZE = 10
 Default size of traversal stack. More...
 

fields related to ray-tracing

RaytraceInitStatus myRaytraceInitStatus
 Result of RT/PT shaders initialization. More...
 
Standard_Boolean myIsRaytraceDataValid
 Is ray-tracing geometry data valid? More...
 
Standard_Boolean myIsRaytraceWarnTextures
 True if warning about missing extension GL_ARB_bindless_texture has been displayed. More...
 
OpenGl_RaytraceGeometry myRaytraceGeometry
 3D scene geometry data for ray-tracing. More...
 
opencascade::handle< BVH_Builder< Standard_ShortReal, 3 > > myRaytraceBVHBuilder
 Builder for triangle set. More...
 
RaytracingParams myRaytraceParameters
 Compile-time ray-tracing parameters. More...
 
Standard_ShortReal myRaytraceSceneRadius
 Radius of bounding sphere of the scene. More...
 
Standard_ShortReal myRaytraceSceneEpsilon
 Scene epsilon to prevent self-intersections. More...
 
ShaderSource myRaytraceShaderSource
 OpenGL/GLSL source of ray-tracing fragment shader. More...
 
ShaderSource myPostFSAAShaderSource
 OpenGL/GLSL source of adaptive-AA fragment shader. More...
 
ShaderSource myOutImageShaderSource
 OpenGL/GLSL source of RT/PT display fragment shader. More...
 
Handle< OpenGl_ShaderObjectmyRaytraceShader
 OpenGL/GLSL ray-tracing fragment shader. More...
 
Handle< OpenGl_ShaderObjectmyPostFSAAShader
 OpenGL/GLSL adaptive-AA fragment shader. More...
 
Handle< OpenGl_ShaderObjectmyOutImageShader
 OpenGL/GLSL ray-tracing display fragment shader. More...
 
Handle< OpenGl_ShaderProgrammyRaytraceProgram
 OpenGL/GLSL ray-tracing shader program. More...
 
Handle< OpenGl_ShaderProgrammyPostFSAAProgram
 OpenGL/GLSL adaptive-AA shader program. More...
 
Handle< OpenGl_ShaderProgrammyOutImageProgram
 OpenGL/GLSL program for displaying texture. More...
 
Handle< OpenGl_TextureBufferArbmySceneNodeInfoTexture
 Texture buffer of data records of bottom-level BVH nodes. More...
 
Handle< OpenGl_TextureBufferArbmySceneMinPointTexture
 Texture buffer of minimum points of bottom-level BVH nodes. More...
 
Handle< OpenGl_TextureBufferArbmySceneMaxPointTexture
 Texture buffer of maximum points of bottom-level BVH nodes. More...
 
Handle< OpenGl_TextureBufferArbmySceneTransformTexture
 Texture buffer of transformations of high-level BVH nodes. More...
 
Handle< OpenGl_TextureBufferArbmyGeometryVertexTexture
 Texture buffer of vertex coords. More...
 
Handle< OpenGl_TextureBufferArbmyGeometryNormalTexture
 Texture buffer of vertex normals. More...
 
Handle< OpenGl_TextureBufferArbmyGeometryTexCrdTexture
 Texture buffer of vertex UV coords. More...
 
Handle< OpenGl_TextureBufferArbmyGeometryTriangTexture
 Texture buffer of triangle indices. More...
 
Handle< OpenGl_TextureBufferArbmyRaytraceMaterialTexture
 Texture buffer of material properties. More...
 
Handle< OpenGl_TextureBufferArbmyRaytraceLightSrcTexture
 Texture buffer of light source properties. More...
 
Handle< OpenGl_FrameBuffermyRaytraceFBO1 [2]
 1st framebuffer (FBO) to perform adaptive FSAA. Used in compatibility mode (no adaptive sampling). More...
 
Handle< OpenGl_FrameBuffermyRaytraceFBO2 [2]
 2nd framebuffer (FBO) to perform adaptive FSAA. Used in compatibility mode (no adaptive sampling). More...
 
Handle< OpenGl_TexturemyRaytraceOutputTexture [2]
 Output textures (2 textures are used in stereo mode). Used if adaptive screen sampling is activated. More...
 
Handle< OpenGl_TexturemyRaytraceVisualErrorTexture [2]
 Texture containing per-tile visual error estimation (2 textures are used in stereo mode). Used if adaptive screen sampling is activated. More...
 
Handle< OpenGl_TexturemyRaytraceTileOffsetsTexture [2]
 Texture containing offsets of sampled screen tiles (2 textures are used in stereo mode). Used if adaptive screen sampling is activated. More...
 
OpenGl_VertexBuffer myRaytraceScreenQuad
 Vertex buffer (VBO) for drawing dummy quad. More...
 
Standard_Integer myUniformLocations [2][OpenGl_RT_NbVariables]
 Cached locations of frequently used uniform variables. More...
 
std::map< const OpenGl_Structure *, StructStatemyStructureStates
 State of OpenGL structures reflected to ray-tracing. More...
 
std::map< Standard_Size, OpenGl_TriangleSet * > myArrayToTrianglesMap
 PrimitiveArray to TriangleSet map for scene partial update. More...
 
std::set< Standard_IntegermyNonRaytraceStructureIDs
 Set of IDs of non-raytracable elements (to detect updates). More...
 
Handle< OpenGl_RaytraceFiltermyRaytraceFilter
 Render filter to filter out all raytracable structures. More...
 
Standard_Boolean myToUpdateEnvironmentMap
 Marks if environment map should be updated. More...
 
Standard_Size myRaytraceLayerListState
 State of OpenGL layer list. More...
 
Standard_Integer myAccumFrames
 Number of accumulated frames (for progressive rendering). More...
 
OpenGl_Vec3 myPreviousOrigins [3]
 Stored ray origins used for detection of camera movements. More...
 
math_BullardGenerator myRNG
 Bullard RNG to produce random sequence. More...
 
OpenGl_TileSampler myTileSampler
 Tool object for sampling screen tiles in PT mode. More...
 
OpenGl_Vec3 myEyeOrig
 Camera position used for projective mode. More...
 
OpenGl_Vec3 myEyeView
 Camera view direction used for projective mode. More...
 
OpenGl_Vec3 myEyeVert
 Camera's screen vertical direction used for projective mode. More...
 
OpenGl_Vec3 myEyeSide
 Camera's screen horizontal direction used for projective mode. More...
 
OpenGl_Vec2 myEyeSize
 Camera's screen size used for projective mode. More...
 
float myPrevCameraApertureRadius
 Aperture radius of camera on previous frame used for depth-of-field (path tracing) More...
 
float myPrevCameraFocalPlaneDist
 Focal distance of camera on previous frame used for depth-of-field (path tracing) More...
 
 DEFINE_STANDARD_RTTIEXT (OpenGl_View, Graphic3d_CView) friend class OpenGl_GraphicDriver
 Result of RT/PT shaders initialization. More...
 

Additional Inherited Members

- Public Types inherited from Standard_Transient
typedef void base_type
 Returns a type descriptor about this object. More...
 
- Static Public Member Functions inherited from Standard_Transient
static const char * get_type_name ()
 Returns a type descriptor about this object. More...
 
static const opencascade::handle< Standard_Type > & get_type_descriptor ()
 Returns type descriptor of Standard_Transient class. More...
 

Detailed Description

Implementation of OpenGl view.

Member Typedef Documentation

◆ StateInfo

typedef std::pair<Standard_Size, Standard_Size> OpenGl_View::StateInfo
protected

main list of displayed structure, sorted by layers

Member Enumeration Documentation

◆ RaytraceInitStatus

Result of OpenGL shaders initialization.

Enumerator
OpenGl_RT_NONE 
OpenGl_RT_INIT 
OpenGl_RT_FAIL 

◆ RaytraceUpdateMode

Describes update mode (state).

Enumerator
OpenGl_GUM_CHECK 

check geometry state

OpenGl_GUM_PREPARE 

collect unchanged objects

OpenGl_GUM_REBUILD 

rebuild changed and new objects

◆ ShaderImageNames

Defines OpenGL image samplers.

Enumerator
OpenGl_RT_OutputImageLft 
OpenGl_RT_OutputImageRgh 
OpenGl_RT_VisualErrorImageLft 
OpenGl_RT_VisualErrorImageRgh 
OpenGl_RT_TileOffsetsImageLft 
OpenGl_RT_TileOffsetsImageRgh 

◆ ShaderVariableIndex

Defines frequently used shader variables.

Enumerator
OpenGl_RT_aPosition 
OpenGl_RT_uOriginLT 
OpenGl_RT_uOriginLB 
OpenGl_RT_uOriginRT 
OpenGl_RT_uOriginRB 
OpenGl_RT_uDirectLT 
OpenGl_RT_uDirectLB 
OpenGl_RT_uDirectRT 
OpenGl_RT_uDirectRB 
OpenGl_RT_uViewPrMat 
OpenGl_RT_uUnviewMat 
OpenGl_RT_uSceneRad 
OpenGl_RT_uSceneEps 
OpenGl_RT_uLightAmbnt 
OpenGl_RT_uLightCount 
OpenGl_RT_uBackColorTop 
OpenGl_RT_uBackColorBot 
OpenGl_RT_uShadowsEnabled 
OpenGl_RT_uReflectEnabled 
OpenGl_RT_uSphereMapEnabled 
OpenGl_RT_uSphereMapForBack 
OpenGl_RT_uTexSamplersArray 
OpenGl_RT_uBlockedRngEnabled 
OpenGl_RT_uWinSizeX 
OpenGl_RT_uWinSizeY 
OpenGl_RT_uAccumSamples 
OpenGl_RT_uFrameRndSeed 
OpenGl_RT_uOffsetX 
OpenGl_RT_uOffsetY 
OpenGl_RT_uSamples 
OpenGl_RT_uRenderImage 
OpenGl_RT_uOffsetImage 
OpenGl_RT_uMaxRadiance 
OpenGl_RT_NbVariables 

Constructor & Destructor Documentation

◆ OpenGl_View()

OpenGl_View::OpenGl_View ( const Handle< Graphic3d_StructureManager > &  theMgr,
const Handle< OpenGl_GraphicDriver > &  theDriver,
const Handle< OpenGl_Caps > &  theCaps,
OpenGl_StateCounter theCounter 
)

Constructor.

◆ ~OpenGl_View()

virtual OpenGl_View::~OpenGl_View ( )
virtual

Default destructor.

Member Function Documentation

◆ addRaytraceGroups()

Standard_Boolean OpenGl_View::addRaytraceGroups ( const OpenGl_Structure theStructure,
const OpenGl_RaytraceMaterial theStructMat,
const Handle< Geom_Transformation > &  theTrsf,
const Handle< OpenGl_Context > &  theGlContext 
)
protected

Adds OpenGL groups to ray-traced scene geometry.

◆ addRaytracePolygonArray()

Standard_Boolean OpenGl_View::addRaytracePolygonArray ( OpenGl_TriangleSet theSet,
const Standard_Integer  theMatID,
const Standard_Integer  theCount,
const Standard_Integer  theOffset,
const Handle< Graphic3d_IndexBuffer > &  theIndices 
)
protected

Adds OpenGL polygon array to ray-traced scene geometry.

◆ addRaytracePrimitiveArray()

Handle< OpenGl_TriangleSet > OpenGl_View::addRaytracePrimitiveArray ( const OpenGl_PrimitiveArray theArray,
const Standard_Integer  theMatID,
const OpenGl_Mat4 theTrans 
)
protected

Adds OpenGL primitive array to ray-traced scene geometry.

◆ addRaytraceQuadrangleArray()

Standard_Boolean OpenGl_View::addRaytraceQuadrangleArray ( OpenGl_TriangleSet theSet,
const Standard_Integer  theMatID,
const Standard_Integer  theCount,
const Standard_Integer  theOffset,
const Handle< Graphic3d_IndexBuffer > &  theIndices 
)
protected

Adds OpenGL quadrangle array to ray-traced scene geometry.

◆ addRaytraceQuadrangleStripArray()

Standard_Boolean OpenGl_View::addRaytraceQuadrangleStripArray ( OpenGl_TriangleSet theSet,
const Standard_Integer  theMatID,
const Standard_Integer  theCount,
const Standard_Integer  theOffset,
const Handle< Graphic3d_IndexBuffer > &  theIndices 
)
protected

Adds OpenGL quadrangle strip array to ray-traced scene geometry.

◆ addRaytraceStructure()

Standard_Boolean OpenGl_View::addRaytraceStructure ( const OpenGl_Structure theStructure,
const Handle< OpenGl_Context > &  theGlContext 
)
protected

Adds OpenGL structure to ray-traced scene geometry.

◆ addRaytraceTriangleArray()

Standard_Boolean OpenGl_View::addRaytraceTriangleArray ( OpenGl_TriangleSet theSet,
const Standard_Integer  theMatID,
const Standard_Integer  theCount,
const Standard_Integer  theOffset,
const Handle< Graphic3d_IndexBuffer > &  theIndices 
)
protected

Adds OpenGL triangle array to ray-traced scene geometry.

◆ addRaytraceTriangleFanArray()

Standard_Boolean OpenGl_View::addRaytraceTriangleFanArray ( OpenGl_TriangleSet theSet,
const Standard_Integer  theMatID,
const Standard_Integer  theCount,
const Standard_Integer  theOffset,
const Handle< Graphic3d_IndexBuffer > &  theIndices 
)
protected

Adds OpenGL triangle fan array to ray-traced scene geometry.

◆ addRaytraceTriangleStripArray()

Standard_Boolean OpenGl_View::addRaytraceTriangleStripArray ( OpenGl_TriangleSet theSet,
const Standard_Integer  theMatID,
const Standard_Integer  theCount,
const Standard_Integer  theOffset,
const Handle< Graphic3d_IndexBuffer > &  theIndices 
)
protected

Adds OpenGL triangle strip array to ray-traced scene geometry.

◆ addRaytraceVertexIndices()

Standard_Boolean OpenGl_View::addRaytraceVertexIndices ( OpenGl_TriangleSet theSet,
const Standard_Integer  theMatID,
const Standard_Integer  theCount,
const Standard_Integer  theOffset,
const OpenGl_PrimitiveArray theArray 
)
protected

Adds vertex indices from OpenGL primitive array to ray-traced scene geometry.

◆ AddZLayer()

virtual void OpenGl_View::AddZLayer ( const Graphic3d_ZLayerId  theLayerId)
overridevirtual

Insert a new top-level z layer with the given ID.

Implements Graphic3d_CView.

◆ BackfacingModel()

virtual Graphic3d_TypeOfBackfacingModel OpenGl_View::BackfacingModel ( ) const
inlineoverridevirtual

Return backfacing model used for the view.

Implements Graphic3d_CView.

◆ Background()

virtual Aspect_Background OpenGl_View::Background ( ) const
overridevirtual

Returns background fill color.

Implements Graphic3d_CView.

◆ BackgroundColor()

const Quantity_ColorRGBA& OpenGl_View::BackgroundColor ( ) const
inline

Returns background color.

◆ BackgroundImage()

virtual TCollection_AsciiString OpenGl_View::BackgroundImage ( )
inlineoverridevirtual

Returns background image texture file path.

Implements Graphic3d_CView.

◆ BackgroundImageStyle()

virtual Aspect_FillMethod OpenGl_View::BackgroundImageStyle ( ) const
overridevirtual

Returns background image fill style.

Implements Graphic3d_CView.

◆ bindDefaultFbo()

void OpenGl_View::bindDefaultFbo ( OpenGl_FrameBuffer theCustomFbo = NULL)
protected

Setup default FBO.

◆ bindRaytraceTextures()

void OpenGl_View::bindRaytraceTextures ( const Handle< OpenGl_Context > &  theGlContext)
protected

Binds ray-trace textures to corresponding texture units.

◆ blitBuffers()

bool OpenGl_View::blitBuffers ( OpenGl_FrameBuffer theReadFbo,
OpenGl_FrameBuffer theDrawFbo,
const Standard_Boolean  theToFlip = Standard_False 
)
protected

Blit image from/to specified buffers.

◆ BufferDump()

virtual Standard_Boolean OpenGl_View::BufferDump ( Image_PixMap theImage,
const Graphic3d_BufferType theBufferType 
)
overridevirtual

Dump active rendering buffer into specified memory buffer. In Ray-Tracing allow to get a raw HDR buffer using Graphic3d_BT_RGB_RayTraceHdrLeft buffer type, only Left view will be dumped ignoring stereoscopic parameter.

Implements Graphic3d_CView.

◆ BVHTreeSelector()

OpenGl_BVHTreeSelector& OpenGl_View::BVHTreeSelector ( )
inline

Returns selector for BVH tree, providing a possibility to store information about current view volume and to detect which objects are overlapping it.

◆ Camera()

virtual const Handle< Graphic3d_Camera >& OpenGl_View::Camera ( ) const
inlineoverridevirtual

Returns camera object of the view.

Implements Graphic3d_CView.

◆ ChangeGraduatedTrihedron()

OpenGl_GraduatedTrihedron& OpenGl_View::ChangeGraduatedTrihedron ( )
inline

Change graduated trihedron.

◆ ClipPlanes()

virtual const Handle< Graphic3d_SequenceOfHClipPlane >& OpenGl_View::ClipPlanes ( ) const
inlineoverridevirtual

Returns list of clip planes set for the view.

Implements Graphic3d_CView.

◆ convertMaterial()

OpenGl_RaytraceMaterial OpenGl_View::convertMaterial ( const OpenGl_AspectFace theAspect,
const Handle< OpenGl_Context > &  theGlContext 
)
protected

Creates ray-tracing material properties.

◆ DEFINE_STANDARD_RTTIEXT()

OpenGl_View::DEFINE_STANDARD_RTTIEXT ( OpenGl_View  ,
Graphic3d_CView   
)

Result of RT/PT shaders initialization.

◆ DiagnosticInformation()

virtual void OpenGl_View::DiagnosticInformation ( TColStd_IndexedDataMapOfStringString theDict,
Graphic3d_DiagnosticInfo  theFlags 
) const
overridevirtual

Fill in the dictionary with diagnostic info. Should be called within rendering thread.

This API should be used only for user output or for creating automated reports. The format of returned information (e.g. key-value layout) is NOT part of this API and can be changed at any time. Thus application should not parse returned information to weed out specific parameters.

Implements Graphic3d_CView.

◆ drawBackground()

virtual void OpenGl_View::drawBackground ( const Handle< OpenGl_Workspace > &  theWorkspace)
protectedvirtual

Draw background (gradient / image)

◆ Export()

virtual Standard_Boolean OpenGl_View::Export ( const Standard_CString  theFileName,
const Graphic3d_ExportFormat  theFormat,
const Graphic3d_SortType  theSortType = Graphic3d_ST_BSP_Tree 
)
overridevirtual

Export scene into the one of the Vector graphics formats (SVG, PS, PDF...). In contrast to Bitmaps, Vector graphics is scalable (so you may got quality benefits on printing to laser printer). Notice however that results may differ a lot and do not contain some elements.

Implements Graphic3d_CView.

◆ FBO()

virtual Handle< Standard_Transient > OpenGl_View::FBO ( ) const
overridevirtual

Returns pointer to an assigned framebuffer object.

Implements Graphic3d_CView.

◆ FBOChangeViewport()

virtual void OpenGl_View::FBOChangeViewport ( const Handle< Standard_Transient > &  theFbo,
const Standard_Integer  theWidth,
const Standard_Integer  theHeight 
)
overridevirtual

Change offscreen FBO viewport.

Implements Graphic3d_CView.

◆ FBOCreate()

virtual Handle< Standard_Transient > OpenGl_View::FBOCreate ( const Standard_Integer  theWidth,
const Standard_Integer  theHeight 
)
overridevirtual

Generate offscreen FBO in the graphic library. If not supported on hardware returns NULL.

Implements Graphic3d_CView.

◆ FBOGetDimensions()

virtual void OpenGl_View::FBOGetDimensions ( const Handle< Standard_Transient > &  theFbo,
Standard_Integer theWidth,
Standard_Integer theHeight,
Standard_Integer theWidthMax,
Standard_Integer theHeightMax 
)
overridevirtual

Read offscreen FBO configuration.

Implements Graphic3d_CView.

◆ FBORelease()

virtual void OpenGl_View::FBORelease ( Handle< Standard_Transient > &  theFbo)
overridevirtual

Remove offscreen FBO from the graphic library.

Implements Graphic3d_CView.

◆ generateShaderPrefix()

TCollection_AsciiString OpenGl_View::generateShaderPrefix ( const Handle< OpenGl_Context > &  theGlContext) const
protected

Generates shader prefix based on current ray-tracing options.

◆ GetGraduatedTrihedron()

const Graphic3d_GraduatedTrihedron& OpenGl_View::GetGraduatedTrihedron ( )
inlineoverridevirtual

Returns data of a graduated trihedron.

Implements Graphic3d_CView.

◆ GlTextureEnv()

const Handle< OpenGl_TextureSet >& OpenGl_View::GlTextureEnv ( ) const
inline

Returns OpenGL environment map.

◆ GlWindow()

const Handle< OpenGl_Window > OpenGl_View::GlWindow ( ) const
inline

Returns OpenGL window implementation.

◆ GradientBackground()

virtual Aspect_GradientBackground OpenGl_View::GradientBackground ( ) const
overridevirtual

Returns gradient background fill colors.

Implements Graphic3d_CView.

◆ GraduatedTrihedronDisplay()

virtual void OpenGl_View::GraduatedTrihedronDisplay ( const Graphic3d_GraduatedTrihedron theTrihedronData)
overridevirtual

Displays Graduated Trihedron.

Implements Graphic3d_CView.

◆ GraduatedTrihedronErase()

virtual void OpenGl_View::GraduatedTrihedronErase ( )
overridevirtual

Erases Graduated Trihedron.

Implements Graphic3d_CView.

◆ GraduatedTrihedronMinMaxValues()

virtual void OpenGl_View::GraduatedTrihedronMinMaxValues ( const Graphic3d_Vec3  theMin,
const Graphic3d_Vec3  theMax 
)
overridevirtual

Sets minimum and maximum points of scene bounding box for Graduated Trihedron stored in graphic view object.

Parameters
theMin[in] the minimum point of scene.
theMax[in] the maximum point of scene.

Implements Graphic3d_CView.

◆ HasImmediateStructures()

bool OpenGl_View::HasImmediateStructures ( ) const
inline

Returns true if there are immediate structures to display.

◆ initProgram()

Handle< OpenGl_ShaderProgram > OpenGl_View::initProgram ( const Handle< OpenGl_Context > &  theGlContext,
const Handle< OpenGl_ShaderObject > &  theVertShader,
const Handle< OpenGl_ShaderObject > &  theFragShader 
)
protected

Creates shader program from the given vertex and fragment shaders.

◆ initRaytraceResources()

Standard_Boolean OpenGl_View::initRaytraceResources ( const Handle< OpenGl_Context > &  theGlContext)
protected

Initializes OpenGL/GLSL shader programs.

◆ initShader()

Handle< OpenGl_ShaderObject > OpenGl_View::initShader ( const GLenum  theType,
const ShaderSource theSource,
const Handle< OpenGl_Context > &  theGlContext 
)
protected

Loads and compiles shader object from specified source.

◆ initTextureEnv()

void OpenGl_View::initTextureEnv ( const Handle< OpenGl_Context > &  theContext)
protected

Initializes OpenGl resource for environment texture.

◆ Invalidate()

virtual void OpenGl_View::Invalidate ( )
overridevirtual

Marks BVH tree for given priority list as dirty and marks primitive set for rebuild.

Implements Graphic3d_CView.

◆ InvalidateBVHData()

virtual void OpenGl_View::InvalidateBVHData ( const Standard_Integer  theLayerId)
overridevirtual

Marks BVH tree and the set of BVH primitives of correspondent priority list with id theLayerId as outdated.

Implements Graphic3d_CView.

◆ InvalidateZLayerBoundingBox()

virtual void OpenGl_View::InvalidateZLayerBoundingBox ( const Graphic3d_ZLayerId  theLayerId) const
overridevirtual

Returns the bounding box of all structures displayed in the Z layer. Never fails. If Z layer does not exist nothing happens.

Implements Graphic3d_CView.

◆ IsCullingEnabled()

virtual Standard_Boolean OpenGl_View::IsCullingEnabled ( ) const
inlineoverridevirtual

Returns the state of frustum culling optimization.

Implements Graphic3d_CView.

◆ IsDefined()

virtual Standard_Boolean OpenGl_View::IsDefined ( ) const
inlineoverridevirtual

Returns True if the window associated to the view is defined.

Implements Graphic3d_CView.

◆ IsInvalidated()

virtual Standard_Boolean OpenGl_View::IsInvalidated ( )
inlineoverridevirtual

Return true if view content cache has been invalidated.

Implements Graphic3d_CView.

◆ LayerList()

const OpenGl_LayerList& OpenGl_View::LayerList ( ) const
inline

Returns list of OpenGL Z-layers.

◆ LightList()

const OpenGl_ListOfLight& OpenGl_View::LightList ( ) const
inline

Returns list of openGL light sources.

◆ Lights()

virtual const Graphic3d_ListOfCLight& OpenGl_View::Lights ( ) const
inlineoverridevirtual

Returns list of lights of the view.

Implements Graphic3d_CView.

◆ LocalOrigin()

const gp_XYZ& OpenGl_View::LocalOrigin ( ) const
inline

Returns local camera origin currently set for rendering, might be modified during rendering.

◆ raytrace()

Standard_Boolean OpenGl_View::raytrace ( const Standard_Integer  theSizeX,
const Standard_Integer  theSizeY,
Graphic3d_Camera::Projection  theProjection,
OpenGl_FrameBuffer theReadDrawFbo,
const Handle< OpenGl_Context > &  theGlContext 
)
protected

Redraws the window using OpenGL/GLSL ray-tracing or path tracing.

◆ Redraw()

virtual void OpenGl_View::Redraw ( )
overridevirtual

Redraw content of the view.

Implements Graphic3d_CView.

◆ redraw()

virtual void OpenGl_View::redraw ( const Graphic3d_Camera::Projection  theProjection,
OpenGl_FrameBuffer theReadDrawFbo,
OpenGl_FrameBuffer theOitAccumFbo 
)
protectedvirtual

Redraws view for the given monographic camera projection, or left/right eye.

◆ RedrawImmediate()

virtual void OpenGl_View::RedrawImmediate ( )
overridevirtual

Redraw immediate content of the view.

Implements Graphic3d_CView.

◆ redrawImmediate()

virtual bool OpenGl_View::redrawImmediate ( const Graphic3d_Camera::Projection  theProjection,
OpenGl_FrameBuffer theReadFbo,
OpenGl_FrameBuffer theDrawFbo,
OpenGl_FrameBuffer theOitAccumFbo,
const Standard_Boolean  theIsPartialUpdate = Standard_False 
)
protectedvirtual

Redraws view for the given monographic camera projection, or left/right eye.

Method will blit snapshot containing main scene (myMainSceneFbos or BackBuffer) into presentation buffer (myMainSceneFbos -> offscreen FBO or myMainSceneFbos -> BackBuffer or BackBuffer -> FrontBuffer), and redraw immediate structures on top.

When scene caching is disabled (myTransientDrawToFront, no double buffer in window, etc.), the first step (blitting) will be skipped.

Returns
false if immediate structures has been rendered directly into FrontBuffer and Buffer Swap should not be called.

◆ ReleaseGlResources()

void OpenGl_View::ReleaseGlResources ( const Handle< OpenGl_Context > &  theCtx)

◆ releaseRaytraceResources()

void OpenGl_View::releaseRaytraceResources ( const Handle< OpenGl_Context > &  theGlContext,
const Standard_Boolean  theToRebuild = Standard_False 
)
protected

Releases OpenGL/GLSL shader programs.

◆ Remove()

virtual void OpenGl_View::Remove ( )
overridevirtual

Deletes and erases the view.

Reimplemented from Graphic3d_CView.

◆ RemoveZLayer()

virtual void OpenGl_View::RemoveZLayer ( const Graphic3d_ZLayerId  theLayerId)
overridevirtual

Remove a z layer with the given ID.

Implements Graphic3d_CView.

◆ render()

virtual void OpenGl_View::render ( Graphic3d_Camera::Projection  theProjection,
OpenGl_FrameBuffer theReadDrawFbo,
OpenGl_FrameBuffer theOitAccumFbo,
const Standard_Boolean  theToDrawImmediate 
)
protectedvirtual

Renders the graphical contents of the view into the preprepared window or framebuffer.

Parameters
theProjection[in] the projection that should be used for rendering.
theReadDrawFbo[in] the framebuffer for rendering graphics.
theOitAccumFbo[in] the framebuffer for accumulating color and coverage for OIT process.
theToDrawImmediate[in] the flag indicates whether the rendering performs in immediate mode.

◆ renderScene()

virtual void OpenGl_View::renderScene ( Graphic3d_Camera::Projection  theProjection,
OpenGl_FrameBuffer theReadDrawFbo,
OpenGl_FrameBuffer theOitAccumFbo,
const Standard_Boolean  theToDrawImmediate 
)
protectedvirtual

Renders the graphical scene.

Parameters
theProjection[in] the projection that is used for rendering.
theReadDrawFbo[in] the framebuffer for rendering graphics.
theOitAccumFbo[in] the framebuffer for accumulating color and coverage for OIT process.
theToDrawImmediate[in] the flag indicates whether the rendering performs in immediate mode.

◆ renderStructs()

virtual void OpenGl_View::renderStructs ( Graphic3d_Camera::Projection  theProjection,
OpenGl_FrameBuffer theReadDrawFbo,
OpenGl_FrameBuffer theOitAccumFbo,
const Standard_Boolean  theToDrawImmediate 
)
protectedvirtual

Render set of structures presented in the view.

Parameters
theProjection[in] the projection that is used for rendering.
theReadDrawFbo[in] the framebuffer for rendering graphics.
theOitAccumFbo[in] the framebuffer for accumulating color and coverage for OIT process.
theToDrawImmediate[in] the flag indicates whether the rendering performs in immediate mode.

◆ renderTrihedron()

void OpenGl_View::renderTrihedron ( const Handle< OpenGl_Workspace > &  theWorkspace)
protected

Renders trihedron.

◆ Resized()

virtual void OpenGl_View::Resized ( )
overridevirtual

Handle changing size of the rendering window.

Implements Graphic3d_CView.

◆ runPathtrace()

Standard_Boolean OpenGl_View::runPathtrace ( const Standard_Integer  theSizeX,
const Standard_Integer  theSizeY,
Graphic3d_Camera::Projection  theProjection,
OpenGl_FrameBuffer theReadDrawFbo,
const Handle< OpenGl_Context > &  theGlContext 
)
protected

Runs path tracing (global illumination) kernel.

◆ runRaytrace()

Standard_Boolean OpenGl_View::runRaytrace ( const Standard_Integer  theSizeX,
const Standard_Integer  theSizeY,
Graphic3d_Camera::Projection  theProjection,
OpenGl_FrameBuffer theReadDrawFbo,
const Handle< OpenGl_Context > &  theGlContext 
)
protected

Runs classical (Whitted-style) ray-tracing kernel.

◆ runRaytraceShaders()

Standard_Boolean OpenGl_View::runRaytraceShaders ( const Standard_Integer  theSizeX,
const Standard_Integer  theSizeY,
Graphic3d_Camera::Projection  theProjection,
OpenGl_FrameBuffer theReadDrawFbo,
const Handle< OpenGl_Context > &  theGlContext 
)
protected

Runs ray-tracing shader programs.

◆ safeFailBack()

Standard_Boolean OpenGl_View::safeFailBack ( const TCollection_ExtendedString theMessage,
const Handle< OpenGl_Context > &  theGlContext 
)
protected

Performs safe exit when shaders initialization fails.

◆ SetBackfacingModel()

virtual void OpenGl_View::SetBackfacingModel ( const Graphic3d_TypeOfBackfacingModel  theModel)
inlineoverridevirtual

Sets backfacing model for the view.

Implements Graphic3d_CView.

◆ SetBackground()

virtual void OpenGl_View::SetBackground ( const Aspect_Background theBackground)
overridevirtual

Sets background fill color.

Implements Graphic3d_CView.

◆ SetBackgroundGradient()

void OpenGl_View::SetBackgroundGradient ( const Quantity_Color AColor1,
const Quantity_Color AColor2,
const Aspect_GradientFillMethod  AType 
)

◆ SetBackgroundGradientType()

void OpenGl_View::SetBackgroundGradientType ( const Aspect_GradientFillMethod  AType)

◆ SetBackgroundImage()

virtual void OpenGl_View::SetBackgroundImage ( const TCollection_AsciiString theFilePath)
overridevirtual

Sets background image texture file path.

Implements Graphic3d_CView.

◆ SetBackgroundImageStyle()

virtual void OpenGl_View::SetBackgroundImageStyle ( const Aspect_FillMethod  theFillStyle)
overridevirtual

Sets background image fill style.

Implements Graphic3d_CView.

◆ SetBackgroundTextureStyle()

void OpenGl_View::SetBackgroundTextureStyle ( const Aspect_FillMethod  FillStyle)

◆ SetCamera()

virtual void OpenGl_View::SetCamera ( const Handle< Graphic3d_Camera > &  theCamera)
overridevirtual

Sets camera used by the view.

Implements Graphic3d_CView.

◆ SetClipPlanes()

virtual void OpenGl_View::SetClipPlanes ( const Handle< Graphic3d_SequenceOfHClipPlane > &  thePlanes)
inlineoverridevirtual

Sets list of clip planes for the view.

Implements Graphic3d_CView.

◆ SetCullingEnabled()

virtual void OpenGl_View::SetCullingEnabled ( const Standard_Boolean  theIsEnabled)
inlineoverridevirtual

Enables or disables frustum culling optimization.

Implements Graphic3d_CView.

◆ SetFBO()

virtual void OpenGl_View::SetFBO ( const Handle< Standard_Transient > &  theFbo)
overridevirtual

Sets framebuffer object for offscreen rendering.

Implements Graphic3d_CView.

◆ SetGradientBackground()

virtual void OpenGl_View::SetGradientBackground ( const Aspect_GradientBackground theBackground)
overridevirtual

Sets gradient background fill colors.

Implements Graphic3d_CView.

◆ SetImmediateModeDrawToFront()

Standard_Boolean OpenGl_View::SetImmediateModeDrawToFront ( const Standard_Boolean  theDrawToFrontBuffer)
overridevirtual
Parameters
theDrawToFrontBufferAdvanced option to modify rendering mode:
  1. TRUE. Drawing immediate mode structures directly to the front buffer over the scene image. Fast, so preferred for interactive work (used by default). However these extra drawings will be missed in image dump since it is performed from back buffer. Notice that since no pre-buffering used the V-Sync will be ignored and rendering could be seen in run-time (in case of slow hardware) and/or tearing may appear. So this is strongly recommended to draw only simple (fast) structures.
  2. FALSE. Drawing immediate mode structures to the back buffer. The complete scene is redrawn first, so this mode is slower if scene contains complex data and/or V-Sync is turned on. But it works in any case and is especially useful for view dump because the dump image is read from the back buffer.
Returns
previous mode.

Implements Graphic3d_CView.

◆ SetLights()

virtual void OpenGl_View::SetLights ( const Graphic3d_ListOfCLight theLights)
inlineoverridevirtual

Sets list of lights for the view.

Implements Graphic3d_CView.

◆ SetLocalOrigin()

void OpenGl_View::SetLocalOrigin ( const gp_XYZ theOrigin)

Setup local camera origin currently set for rendering.

◆ SetShadingModel()

virtual void OpenGl_View::SetShadingModel ( const Graphic3d_TypeOfShadingModel  theModel)
inlineoverridevirtual

Sets shading model of the view.

Implements Graphic3d_CView.

◆ SetTextureEnv() [1/2]

virtual void OpenGl_View::SetTextureEnv ( const Handle< Graphic3d_TextureEnv > &  theTextureEnv)
overridevirtual

Sets environment texture for the view.

Implements Graphic3d_CView.

◆ SetTextureEnv() [2/2]

void OpenGl_View::SetTextureEnv ( const Handle< OpenGl_Context > &  theCtx,
const Handle< Graphic3d_TextureEnv > &  theTexture 
)

◆ setUniformState()

Standard_Boolean OpenGl_View::setUniformState ( const Standard_Integer  theProgramId,
const Standard_Integer  theSizeX,
const Standard_Integer  theSizeY,
Graphic3d_Camera::Projection  theProjection,
const Handle< OpenGl_Context > &  theGlContext 
)
protected

Sets uniform state for the given ray-tracing shader program.

◆ SetWindow()

virtual void OpenGl_View::SetWindow ( const Handle< Aspect_Window > &  theWindow,
const Aspect_RenderingContext  theContext 
)
overridevirtual

Creates and maps rendering window to the view.

Parameters
theWindow[in] the window.
theContext[in] the rendering context. If NULL the context will be created internally.

Implements Graphic3d_CView.

◆ SetZLayerSettings()

virtual void OpenGl_View::SetZLayerSettings ( const Graphic3d_ZLayerId  theLayerId,
const Graphic3d_ZLayerSettings theSettings 
)
overridevirtual

Sets the settings for a single Z layer of specified view.

Implements Graphic3d_CView.

◆ ShadingModel()

virtual Graphic3d_TypeOfShadingModel OpenGl_View::ShadingModel ( ) const
inlineoverridevirtual

Returns shading model of the view.

Implements Graphic3d_CView.

◆ TextureEnv()

virtual Handle< Graphic3d_TextureEnv > OpenGl_View::TextureEnv ( ) const
inlineoverridevirtual

Returns environment texture set for the view.

Implements Graphic3d_CView.

◆ toUpdateStructure()

Standard_Boolean OpenGl_View::toUpdateStructure ( const OpenGl_Structure theStructure)
protected

Checks to see if the OpenGL structure is modified.

◆ unbindRaytraceTextures()

void OpenGl_View::unbindRaytraceTextures ( const Handle< OpenGl_Context > &  theGlContext)
protected

Unbinds ray-trace textures from corresponding texture unit.

◆ updateCamera()

void OpenGl_View::updateCamera ( const OpenGl_Mat4 theOrientation,
const OpenGl_Mat4 theViewMapping,
OpenGl_Vec3 theOrigins,
OpenGl_Vec3 theDirects,
OpenGl_Mat4 theView,
OpenGl_Mat4 theUnView 
)
protected

Generates viewing rays for corners of screen quad. (ray tracing; path tracing for orthographic camera)

◆ updatePerspCameraPT()

void OpenGl_View::updatePerspCameraPT ( const OpenGl_Mat4 theOrientation,
const OpenGl_Mat4 theViewMapping,
Graphic3d_Camera::Projection  theProjection,
OpenGl_Mat4 theViewPr,
OpenGl_Mat4 theUnview,
const int  theWinSizeX,
const int  theWinSizeY 
)
protected

Generate viewing rays (path tracing, perspective camera).

◆ updateRaytraceBuffers()

Standard_Boolean OpenGl_View::updateRaytraceBuffers ( const Standard_Integer  theSizeX,
const Standard_Integer  theSizeY,
const Handle< OpenGl_Context > &  theGlContext 
)
protected

Updates auxiliary OpenGL frame buffers.

◆ updateRaytraceGeometry()

Standard_Boolean OpenGl_View::updateRaytraceGeometry ( const RaytraceUpdateMode  theMode,
const Standard_Integer  theViewId,
const Handle< OpenGl_Context > &  theGlContext 
)
protected

Updates 3D scene geometry for ray-tracing.

◆ updateRaytraceLightSources()

Standard_Boolean OpenGl_View::updateRaytraceLightSources ( const OpenGl_Mat4 theInvModelView,
const Handle< OpenGl_Context > &  theGlContext 
)
protected

Updates 3D scene light sources for ray-tracing.

◆ uploadRaytraceData()

Standard_Boolean OpenGl_View::uploadRaytraceData ( const Handle< OpenGl_Context > &  theGlContext)
protected

Uploads ray-trace data to the GPU.

◆ Window()

virtual Handle< Aspect_Window > OpenGl_View::Window ( ) const
inlineoverridevirtual

Returns window associated with the view.

Implements Graphic3d_CView.

◆ ZLayerBoundingBox()

virtual Bnd_Box OpenGl_View::ZLayerBoundingBox ( const Graphic3d_ZLayerId  theLayerId,
const Handle< Graphic3d_Camera > &  theCamera,
const Standard_Integer  theWindowWidth,
const Standard_Integer  theWindowHeight,
const Standard_Boolean  theToIncludeAuxiliary 
) const
overridevirtual

Returns the bounding box of all structures displayed in the Z layer. If Z layer does not exist the empty box is returned.

Parameters
theLayerIdlayer identifier
theCameracamera definition
theWindowWidthviewport width (for applying transformation-persistence)
theWindowHeightviewport height (for applying transformation-persistence)
theToIncludeAuxiliaryconsider also auxiliary presentations (with infinite flag or with trihedron transformation persistence)
Returns
computed bounding box

Implements Graphic3d_CView.

◆ ZLayerMax()

virtual Standard_Integer OpenGl_View::ZLayerMax ( ) const
overridevirtual

Returns the maximum Z layer ID. First layer ID is Graphic3d_ZLayerId_Default, last ID is ZLayerMax().

Implements Graphic3d_CView.

Field Documentation

◆ myAccumFrames

Standard_Integer OpenGl_View::myAccumFrames
protected

Number of accumulated frames (for progressive rendering).

◆ myArrayToTrianglesMap

std::map<Standard_Size, OpenGl_TriangleSet*> OpenGl_View::myArrayToTrianglesMap
protected

PrimitiveArray to TriangleSet map for scene partial update.

◆ myBackBufferRestored

Standard_Boolean OpenGl_View::myBackBufferRestored
protected

Two framebuffers (left and right views) store cached main presentation of the view (without presentation of immediate layers).

sized format for color attachments

◆ myBackfacing

Graphic3d_TypeOfBackfacingModel OpenGl_View::myBackfacing
protected

main list of displayed structure, sorted by layers

◆ myBackgroundImagePath

TCollection_AsciiString OpenGl_View::myBackgroundImagePath
protected

main list of displayed structure, sorted by layers

◆ myBgColor

Quantity_ColorRGBA OpenGl_View::myBgColor
protected

main list of displayed structure, sorted by layers

◆ myBgGradientArray

OpenGl_BackgroundArray* OpenGl_View::myBgGradientArray
protected

Primitive array for gradient background.

◆ myBgTextureArray

OpenGl_BackgroundArray* OpenGl_View::myBgTextureArray
protected

Primitive array for texture background.

◆ myBVHSelector

OpenGl_BVHTreeSelector OpenGl_View::myBVHSelector
protected

Is needed for selection of overlapping objects and storage of the current view volume.

◆ myCamera

Handle< Graphic3d_Camera > OpenGl_View::myCamera
protected

main list of displayed structure, sorted by layers

◆ myCaps

Handle< OpenGl_Caps > OpenGl_View::myCaps
protected

main list of displayed structure, sorted by layers

◆ myClipPlanes

Handle< Graphic3d_SequenceOfHClipPlane > OpenGl_View::myClipPlanes
protected

main list of displayed structure, sorted by layers

◆ myCulling

Standard_Boolean OpenGl_View::myCulling
protected

main list of displayed structure, sorted by layers

◆ myCurrLightSourceState

Standard_Size OpenGl_View::myCurrLightSourceState
protected

main list of displayed structure, sorted by layers

◆ myDriver

OpenGl_GraphicDriver* OpenGl_View::myDriver
protected

main list of displayed structure, sorted by layers

◆ myEyeOrig

OpenGl_Vec3 OpenGl_View::myEyeOrig
protected

Camera position used for projective mode.

◆ myEyeSide

OpenGl_Vec3 OpenGl_View::myEyeSide
protected

Camera's screen horizontal direction used for projective mode.

◆ myEyeSize

OpenGl_Vec2 OpenGl_View::myEyeSize
protected

Camera's screen size used for projective mode.

◆ myEyeVert

OpenGl_Vec3 OpenGl_View::myEyeVert
protected

Camera's screen vertical direction used for projective mode.

◆ myEyeView

OpenGl_Vec3 OpenGl_View::myEyeView
protected

Camera view direction used for projective mode.

◆ myFBO

Handle< OpenGl_FrameBuffer > OpenGl_View::myFBO
protected

main list of displayed structure, sorted by layers

◆ myFboColorFormat

GLint OpenGl_View::myFboColorFormat
protected

Two framebuffers (left and right views) store cached main presentation of the view (without presentation of immediate layers).

sized format for color attachments

◆ myFboDepthFormat

GLint OpenGl_View::myFboDepthFormat
protected

sized format for depth-stencil attachments

◆ myFboOitColorConfig

OpenGl_ColorFormats OpenGl_View::myFboOitColorConfig
protected

selected color format configuration for OIT color attachments

◆ myFrameCounter

unsigned int OpenGl_View::myFrameCounter
protected

redraw counter, for debugging

◆ myFullScreenQuad

OpenGl_VertexBuffer OpenGl_View::myFullScreenQuad
protected

Vertices for full-screen quad rendering.

◆ myFullScreenQuadFlip

OpenGl_VertexBuffer OpenGl_View::myFullScreenQuadFlip
protected

Two framebuffers (left and right views) store cached main presentation of the view (without presentation of immediate layers).

sized format for color attachments

◆ myGeometryNormalTexture

Handle< OpenGl_TextureBufferArb > OpenGl_View::myGeometryNormalTexture
protected

Texture buffer of vertex normals.

◆ myGeometryTexCrdTexture

Handle< OpenGl_TextureBufferArb > OpenGl_View::myGeometryTexCrdTexture
protected

Texture buffer of vertex UV coords.

◆ myGeometryTriangTexture

Handle< OpenGl_TextureBufferArb > OpenGl_View::myGeometryTriangTexture
protected

Texture buffer of triangle indices.

◆ myGeometryVertexTexture

Handle< OpenGl_TextureBufferArb > OpenGl_View::myGeometryVertexTexture
protected

Texture buffer of vertex coords.

◆ myGraduatedTrihedron

OpenGl_GraduatedTrihedron OpenGl_View::myGraduatedTrihedron
protected

main list of displayed structure, sorted by layers

◆ myGTrihedronData

Graphic3d_GraduatedTrihedron OpenGl_View::myGTrihedronData
protected

main list of displayed structure, sorted by layers

◆ myHasFboBlit

Standard_Boolean OpenGl_View::myHasFboBlit
protected

disable FBOs on failure

◆ myImmediateSceneFbos

Handle< OpenGl_FrameBuffer > OpenGl_View::myImmediateSceneFbos[2]
protected

Additional buffers for immediate layer in stereo mode.

◆ myImmediateSceneFbosOit

Handle< OpenGl_FrameBuffer > OpenGl_View::myImmediateSceneFbosOit[2]
protected

Additional buffers for transparency draw of immediate layer.

◆ myIsImmediateDrawn

Standard_Boolean OpenGl_View::myIsImmediateDrawn
protected

flag indicates that immediate mode buffer contains some data

◆ myIsRaytraceDataValid

Standard_Boolean OpenGl_View::myIsRaytraceDataValid
protected

Is ray-tracing geometry data valid?

◆ myIsRaytraceWarnTextures

Standard_Boolean OpenGl_View::myIsRaytraceWarnTextures
protected

True if warning about missing extension GL_ARB_bindless_texture has been displayed.

◆ myLastLightSourceState

StateInfo OpenGl_View::myLastLightSourceState
protected

main list of displayed structure, sorted by layers

◆ myLastOrientationState

StateInfo OpenGl_View::myLastOrientationState
protected

main list of displayed structure, sorted by layers

◆ myLastViewMappingState

StateInfo OpenGl_View::myLastViewMappingState
protected

main list of displayed structure, sorted by layers

◆ myLights

OpenGl_ListOfLight OpenGl_View::myLights
protected

main list of displayed structure, sorted by layers

◆ myLocalOrigin

gp_XYZ OpenGl_View::myLocalOrigin
protected

main list of displayed structure, sorted by layers

◆ myMainSceneFbos

Handle< OpenGl_FrameBuffer > OpenGl_View::myMainSceneFbos[2]
protected

Two framebuffers (left and right views) store cached main presentation of the view (without presentation of immediate layers).

sized format for color attachments

◆ myMainSceneFbosOit

Handle< OpenGl_FrameBuffer > OpenGl_View::myMainSceneFbosOit[2]
protected

Additional buffers for transparent draw of main layer.

◆ myNonRaytraceStructureIDs

std::set<Standard_Integer> OpenGl_View::myNonRaytraceStructureIDs
protected

Set of IDs of non-raytracable elements (to detect updates).

◆ myNoShadingLight

OpenGl_ListOfLight OpenGl_View::myNoShadingLight
protected

main list of displayed structure, sorted by layers

◆ myOpenGlFBO

Handle< OpenGl_FrameBuffer > OpenGl_View::myOpenGlFBO
protected

Framebuffers for OpenGL output.

◆ myOpenGlFBO2

Handle< OpenGl_FrameBuffer > OpenGl_View::myOpenGlFBO2
protected

main list of displayed structure, sorted by layers

◆ myOutImageProgram

Handle< OpenGl_ShaderProgram > OpenGl_View::myOutImageProgram
protected

OpenGL/GLSL program for displaying texture.

◆ myOutImageShader

Handle< OpenGl_ShaderObject > OpenGl_View::myOutImageShader
protected

OpenGL/GLSL ray-tracing display fragment shader.

◆ myOutImageShaderSource

ShaderSource OpenGl_View::myOutImageShaderSource
protected

OpenGL/GLSL source of RT/PT display fragment shader.

◆ myPostFSAAProgram

Handle< OpenGl_ShaderProgram > OpenGl_View::myPostFSAAProgram
protected

OpenGL/GLSL adaptive-AA shader program.

◆ myPostFSAAShader

Handle< OpenGl_ShaderObject > OpenGl_View::myPostFSAAShader
protected

OpenGL/GLSL adaptive-AA fragment shader.

◆ myPostFSAAShaderSource

ShaderSource OpenGl_View::myPostFSAAShaderSource
protected

OpenGL/GLSL source of adaptive-AA fragment shader.

◆ myPrevCameraApertureRadius

float OpenGl_View::myPrevCameraApertureRadius
protected

Aperture radius of camera on previous frame used for depth-of-field (path tracing)

◆ myPrevCameraFocalPlaneDist

float OpenGl_View::myPrevCameraFocalPlaneDist
protected

Focal distance of camera on previous frame used for depth-of-field (path tracing)

◆ myPreviousOrigins

OpenGl_Vec3 OpenGl_View::myPreviousOrigins[3]
protected

Stored ray origins used for detection of camera movements.

◆ myRaytraceBVHBuilder

opencascade::handle<BVH_Builder<Standard_ShortReal, 3> > OpenGl_View::myRaytraceBVHBuilder
protected

Builder for triangle set.

◆ myRaytraceFBO1

Handle< OpenGl_FrameBuffer > OpenGl_View::myRaytraceFBO1[2]
protected

1st framebuffer (FBO) to perform adaptive FSAA. Used in compatibility mode (no adaptive sampling).

◆ myRaytraceFBO2

Handle< OpenGl_FrameBuffer > OpenGl_View::myRaytraceFBO2[2]
protected

2nd framebuffer (FBO) to perform adaptive FSAA. Used in compatibility mode (no adaptive sampling).

◆ myRaytraceFilter

Handle< OpenGl_RaytraceFilter > OpenGl_View::myRaytraceFilter
protected

Render filter to filter out all raytracable structures.

◆ myRaytraceGeometry

OpenGl_RaytraceGeometry OpenGl_View::myRaytraceGeometry
protected

3D scene geometry data for ray-tracing.

◆ myRaytraceInitStatus

RaytraceInitStatus OpenGl_View::myRaytraceInitStatus
protected

Result of RT/PT shaders initialization.

◆ myRaytraceLayerListState

Standard_Size OpenGl_View::myRaytraceLayerListState
protected

State of OpenGL layer list.

◆ myRaytraceLightSrcTexture

Handle< OpenGl_TextureBufferArb > OpenGl_View::myRaytraceLightSrcTexture
protected

Texture buffer of light source properties.

◆ myRaytraceMaterialTexture

Handle< OpenGl_TextureBufferArb > OpenGl_View::myRaytraceMaterialTexture
protected

Texture buffer of material properties.

◆ myRaytraceOutputTexture

Handle< OpenGl_Texture > OpenGl_View::myRaytraceOutputTexture[2]
protected

Output textures (2 textures are used in stereo mode). Used if adaptive screen sampling is activated.

◆ myRaytraceParameters

RaytracingParams OpenGl_View::myRaytraceParameters
protected

Compile-time ray-tracing parameters.

◆ myRaytraceProgram

Handle< OpenGl_ShaderProgram > OpenGl_View::myRaytraceProgram
protected

OpenGL/GLSL ray-tracing shader program.

◆ myRaytraceSceneEpsilon

Standard_ShortReal OpenGl_View::myRaytraceSceneEpsilon
protected

Scene epsilon to prevent self-intersections.

◆ myRaytraceSceneRadius

Standard_ShortReal OpenGl_View::myRaytraceSceneRadius
protected

Radius of bounding sphere of the scene.

◆ myRaytraceScreenQuad

OpenGl_VertexBuffer OpenGl_View::myRaytraceScreenQuad
protected

Vertex buffer (VBO) for drawing dummy quad.

◆ myRaytraceShader

Handle< OpenGl_ShaderObject > OpenGl_View::myRaytraceShader
protected

OpenGL/GLSL ray-tracing fragment shader.

◆ myRaytraceShaderSource

ShaderSource OpenGl_View::myRaytraceShaderSource
protected

OpenGL/GLSL source of ray-tracing fragment shader.

◆ myRaytraceTileOffsetsTexture

Handle< OpenGl_Texture > OpenGl_View::myRaytraceTileOffsetsTexture[2]
protected

Texture containing offsets of sampled screen tiles (2 textures are used in stereo mode). Used if adaptive screen sampling is activated.

◆ myRaytraceVisualErrorTexture

Handle< OpenGl_Texture > OpenGl_View::myRaytraceVisualErrorTexture[2]
protected

Texture containing per-tile visual error estimation (2 textures are used in stereo mode). Used if adaptive screen sampling is activated.

◆ myRNG

math_BullardGenerator OpenGl_View::myRNG
protected

Bullard RNG to produce random sequence.

◆ mySceneMaxPointTexture

Handle< OpenGl_TextureBufferArb > OpenGl_View::mySceneMaxPointTexture
protected

Texture buffer of maximum points of bottom-level BVH nodes.

◆ mySceneMinPointTexture

Handle< OpenGl_TextureBufferArb > OpenGl_View::mySceneMinPointTexture
protected

Texture buffer of minimum points of bottom-level BVH nodes.

◆ mySceneNodeInfoTexture

Handle< OpenGl_TextureBufferArb > OpenGl_View::mySceneNodeInfoTexture
protected

Texture buffer of data records of bottom-level BVH nodes.

◆ mySceneTransformTexture

Handle< OpenGl_TextureBufferArb > OpenGl_View::mySceneTransformTexture
protected

Texture buffer of transformations of high-level BVH nodes.

◆ myShadingModel

Graphic3d_TypeOfShadingModel OpenGl_View::myShadingModel
protected

main list of displayed structure, sorted by layers

◆ myStateCounter

OpenGl_StateCounter* OpenGl_View::myStateCounter
protected

main list of displayed structure, sorted by layers

◆ myStructureStates

std::map<const OpenGl_Structure*, StructState> OpenGl_View::myStructureStates
protected

State of OpenGL structures reflected to ray-tracing.

◆ myTextureEnv

Handle< OpenGl_TextureSet > OpenGl_View::myTextureEnv
protected

main list of displayed structure, sorted by layers

◆ myTextureEnvData

Handle< Graphic3d_TextureEnv > OpenGl_View::myTextureEnvData
protected

main list of displayed structure, sorted by layers

◆ myTextureParams

OpenGl_AspectFace* OpenGl_View::myTextureParams
protected

Stores texture and its parameters for textured background.

◆ myTileSampler

OpenGl_TileSampler OpenGl_View::myTileSampler
protected

Tool object for sampling screen tiles in PT mode.

◆ myToDisableMSAA

Standard_Boolean OpenGl_View::myToDisableMSAA
protected

disable MSAA after failure

◆ myToDisableOIT

Standard_Boolean OpenGl_View::myToDisableOIT
protected

disable OIT on failure

◆ myToDisableOITMSAA

Standard_Boolean OpenGl_View::myToDisableOITMSAA
protected

disable OIT with MSAA on failure

◆ myToFlipOutput

Standard_Boolean OpenGl_View::myToFlipOutput
protected

Flag to draw result image upside-down.

◆ myToShowGradTrihedron

Standard_Boolean OpenGl_View::myToShowGradTrihedron
protected

main list of displayed structure, sorted by layers

◆ myToUpdateEnvironmentMap

Standard_Boolean OpenGl_View::myToUpdateEnvironmentMap
protected

Marks if environment map should be updated.

◆ myTransientDrawToFront

Standard_Boolean OpenGl_View::myTransientDrawToFront
protected

optimization flag for immediate mode (to render directly to the front buffer)

◆ myUniformLocations

Standard_Integer OpenGl_View::myUniformLocations[2][OpenGl_RT_NbVariables]
protected

Cached locations of frequently used uniform variables.

◆ myWasRedrawnGL

Standard_Boolean OpenGl_View::myWasRedrawnGL
protected

main list of displayed structure, sorted by layers

◆ myWindow

Handle< OpenGl_Window > OpenGl_View::myWindow
protected

main list of displayed structure, sorted by layers

◆ myWorkspace

Handle< OpenGl_Workspace > OpenGl_View::myWorkspace
protected

main list of displayed structure, sorted by layers

◆ myWorldViewProjState

Graphic3d_WorldViewProjState OpenGl_View::myWorldViewProjState
protected

camera modification state

◆ myZLayers

OpenGl_LayerList OpenGl_View::myZLayers
protected

main list of displayed structure, sorted by layers

◆ THE_DEFAULT_NB_BOUNCES

const Standard_Integer OpenGl_View::THE_DEFAULT_NB_BOUNCES = 3
staticprotected

Default ray-tracing depth.

◆ THE_DEFAULT_STACK_SIZE

const Standard_Integer OpenGl_View::THE_DEFAULT_STACK_SIZE = 10
staticprotected

Default size of traversal stack.


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