Open CASCADE Technology 7.8.2.dev
|
Implementation of OpenGl view. More...
#include <OpenGl_View.hxx>
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. | |
virtual | ~OpenGl_View () |
Default destructor. | |
virtual void | ReleaseGlResources (const Handle< OpenGl_Context > &theCtx) |
Release OpenGL resources. | |
virtual void | Remove () override |
Deletes and erases the view. | |
Standard_Boolean | SetImmediateModeDrawToFront (const Standard_Boolean theDrawToFrontBuffer) override |
virtual void | SetWindow (const Handle< Graphic3d_CView > &theParentVIew, const Handle< Aspect_Window > &theWindow, const Aspect_RenderingContext theContext) override |
Creates and maps rendering window to the view. | |
virtual Handle< Aspect_Window > | Window () const override |
Returns window associated with the view. | |
virtual Standard_Boolean | IsDefined () const override |
Returns True if the window associated to the view is defined. | |
virtual void | Resized () override |
Handle changing size of the rendering window. | |
virtual void | Redraw () override |
Redraw content of the view. | |
virtual void | RedrawImmediate () override |
Redraw immediate content of the view. | |
virtual void | Invalidate () override |
Marks BVH tree for given priority list as dirty and marks primitive set for rebuild. | |
virtual Standard_Boolean | IsInvalidated () override |
Return true if view content cache has been invalidated. | |
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. | |
virtual Standard_Boolean | ShadowMapDump (Image_PixMap &theImage, const TCollection_AsciiString &theLightName) override |
Dumps the graphical contents of a shadowmap framebuffer into an image. | |
virtual void | InvalidateBVHData (const Graphic3d_ZLayerId theLayerId) override |
Marks BVH tree and the set of BVH primitives of correspondent priority list with id theLayerId as outdated. | |
virtual void | InsertLayerBefore (const Graphic3d_ZLayerId theLayerId, const Graphic3d_ZLayerSettings &theSettings, const Graphic3d_ZLayerId theLayerAfter) override |
Add a layer to the view. | |
virtual void | InsertLayerAfter (const Graphic3d_ZLayerId theNewLayerId, const Graphic3d_ZLayerSettings &theSettings, const Graphic3d_ZLayerId theLayerBefore) override |
Add a layer to the view. | |
virtual void | RemoveZLayer (const Graphic3d_ZLayerId theLayerId) override |
Remove a z layer with the given ID. | |
virtual void | SetZLayerSettings (const Graphic3d_ZLayerId theLayerId, const Graphic3d_ZLayerSettings &theSettings) override |
Sets the settings for a single Z layer of specified view. | |
virtual Standard_Integer | ZLayerMax () const override |
Returns the maximum Z layer ID. First layer ID is Graphic3d_ZLayerId_Default, last ID is ZLayerMax(). | |
virtual const NCollection_List< Handle< Graphic3d_Layer > > & | Layers () const override |
Returns the list of layers. | |
virtual Handle< Graphic3d_Layer > | Layer (const Graphic3d_ZLayerId theLayerId) const override |
Returns layer with given ID or NULL if undefined. | |
virtual Bnd_Box | MinMaxValues (const Standard_Boolean theToIncludeAuxiliary) const override |
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. | |
virtual Handle< Standard_Transient > | FBO () const override |
Returns pointer to an assigned framebuffer object. | |
virtual void | SetFBO (const Handle< Standard_Transient > &theFbo) override |
Sets framebuffer object for offscreen rendering. | |
virtual Handle< Standard_Transient > | FBOCreate (const Standard_Integer theWidth, const Standard_Integer theHeight) override |
Generate offscreen FBO in the graphic library. If not supported on hardware returns NULL. | |
virtual void | FBORelease (Handle< Standard_Transient > &theFbo) override |
Remove offscreen FBO from the graphic library. | |
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. | |
virtual void | FBOChangeViewport (const Handle< Standard_Transient > &theFbo, const Standard_Integer theWidth, const Standard_Integer theHeight) override |
Change offscreen FBO viewport. | |
const Handle< OpenGl_DepthPeeling > & | DepthPeelingFbos () const |
Returns additional buffers for depth peeling OIT. | |
virtual Aspect_GradientBackground | GradientBackground () const override |
Returns gradient background fill colors. | |
virtual void | SetGradientBackground (const Aspect_GradientBackground &theBackground) override |
Sets gradient background fill colors. | |
virtual void | SetBackgroundImage (const Handle< Graphic3d_TextureMap > &theTextureMap, Standard_Boolean theToUpdatePBREnv=Standard_True) override |
Sets image texture or environment cubemap as background. | |
virtual void | SetTextureEnv (const Handle< Graphic3d_TextureEnv > &theTextureEnv) override |
Sets environment texture for the view. | |
virtual Aspect_FillMethod | BackgroundImageStyle () const override |
Returns background image fill style. | |
virtual void | SetBackgroundImageStyle (const Aspect_FillMethod theFillStyle) override |
Sets background image fill style. | |
virtual void | SetImageBasedLighting (Standard_Boolean theToEnableIBL) override |
Enables or disables IBL (Image Based Lighting) from background cubemap. Has no effect if PBR is not used. | |
unsigned int | SpecIBLMapLevels () const |
Returns number of mipmap levels used in specular IBL map. 0 if PBR environment is not created. | |
const gp_XYZ & | LocalOrigin () const |
Returns local camera origin currently set for rendering, might be modified during rendering. | |
void | SetLocalOrigin (const gp_XYZ &theOrigin) |
Setup local camera origin currently set for rendering. | |
virtual const Handle< Graphic3d_LightSet > & | Lights () const override |
Returns list of lights of the view. | |
virtual void | SetLights (const Handle< Graphic3d_LightSet > &theLights) override |
Sets list of lights for the view. | |
virtual const Handle< Graphic3d_SequenceOfHClipPlane > & | ClipPlanes () const override |
Returns list of clip planes set for the view. | |
virtual void | SetClipPlanes (const Handle< Graphic3d_SequenceOfHClipPlane > &thePlanes) override |
Sets list of clip planes for the view. | |
virtual void | DiagnosticInformation (TColStd_IndexedDataMapOfStringString &theDict, Graphic3d_DiagnosticInfo theFlags) const override |
Fill in the dictionary with diagnostic info. Should be called within rendering thread. | |
virtual TCollection_AsciiString | StatisticInformation () const override |
Returns string with statistic performance info. | |
virtual void | StatisticInformation (TColStd_IndexedDataMapOfStringString &theDict) const override |
Fills in the dictionary with statistic performance info. | |
const Quantity_ColorRGBA & | BackgroundColor () const |
Returns background color. | |
OpenGl_GraduatedTrihedron & | ChangeGraduatedTrihedron () |
Change graduated trihedron. | |
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_LayerList & | LayerList () const |
Returns list of OpenGL Z-layers. | |
const Handle< OpenGl_Window > & | GlWindow () const |
Returns OpenGL window implementation. | |
const Handle< OpenGl_TextureSet > & | GlTextureEnv () const |
Returns OpenGL environment map. | |
const Graphic3d_CullingTool & | BVHTreeSelector () const |
Returns selector for BVH tree, providing a possibility to store information about current view volume and to detect which objects are overlapping it. | |
bool | HasImmediateStructures () const |
Returns true if there are immediate structures to display. | |
obsolete Graduated Trihedron functionality | |
virtual void | GraduatedTrihedronDisplay (const Graphic3d_GraduatedTrihedron &theTrihedronData) override |
Displays Graduated Trihedron. | |
virtual void | GraduatedTrihedronErase () override |
Erases Graduated Trihedron. | |
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. | |
Public Member Functions inherited from Graphic3d_CView | |
Graphic3d_CView (const Handle< Graphic3d_StructureManager > &theMgr) | |
Constructor. | |
virtual | ~Graphic3d_CView () |
Destructor. | |
Standard_Integer | Identification () const |
Returns the identification number of the view. | |
virtual void | Activate () |
Activates the view. Maps presentations defined within structure manager onto this view. | |
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(). | |
Standard_Boolean | IsActive () const |
Returns the activity flag of the view. | |
Standard_Boolean | IsRemoved () const |
Returns true if the view was removed. | |
virtual const Handle< Graphic3d_Camera > & | Camera () const override |
Returns camera object of the view. | |
virtual void | SetCamera (const Handle< Graphic3d_Camera > &theCamera) |
Sets camera used by the view. | |
Graphic3d_TypeOfShadingModel | ShadingModel () const |
Returns default Shading Model of the view; Graphic3d_TypeOfShadingModel_Phong by default. | |
void | SetShadingModel (Graphic3d_TypeOfShadingModel theModel) |
Sets default Shading Model of the view. Will throw an exception on attempt to set Graphic3d_TypeOfShadingModel_DEFAULT. | |
Graphic3d_TypeOfBackfacingModel | BackfacingModel () const |
Return backfacing model used for the view; Graphic3d_TypeOfBackfacingModel_Auto by default, which means that backface culling is defined by each presentation. | |
void | SetBackfacingModel (const Graphic3d_TypeOfBackfacingModel theModel) |
Sets backfacing model for the view. | |
Graphic3d_TypeOfVisualization | VisualizationType () const |
Returns visualization type of the view. | |
void | SetVisualizationType (const Graphic3d_TypeOfVisualization theType) |
Sets visualization type of the view. | |
Graphic3d_ZLayerId | ZLayerTarget () const |
Returns ZLayerId target. | |
void | SetZLayerTarget (const Graphic3d_ZLayerId theTarget) |
Sets ZLayerId target. | |
Standard_Boolean | ZLayerRedrawMode () const |
Returns ZLayerId redraw mode. | |
void | SetZLayerRedrawMode (const Standard_Boolean theMode) |
Sets ZLayerId redraw mode. | |
void | SetComputedMode (const Standard_Boolean theMode) |
Switches computed HLR mode in the view. | |
Standard_Boolean | ComputedMode () const |
Returns the computed HLR mode state. | |
void | ReCompute (const Handle< Graphic3d_Structure > &theStructure) |
Computes the new presentation of the structure displayed in this view with the type Graphic3d_TOS_COMPUTED. | |
void | Update (const Graphic3d_ZLayerId theLayerId=Graphic3d_ZLayerId_UNKNOWN) |
Invalidates bounding box of specified ZLayerId. | |
void | Compute () |
Computes the new presentation of the structures displayed in this view with the type Graphic3d_TOS_COMPUTED. | |
void | DisplayedStructures (Graphic3d_MapOfStructure &theStructures) const |
Returns the set of structures displayed in this view. | |
virtual Standard_Integer | NumberOfDisplayedStructures () const |
Returns number of displayed structures in the view. | |
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>. | |
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. | |
const Handle< Graphic3d_StructureManager > & | StructureManager () const |
Returns the structure manager handle which manage structures associated with this view. | |
virtual void | InvalidateZLayerBoundingBox (const Graphic3d_ZLayerId theLayerId) |
Returns the bounding box of all structures displayed in the Z layer. | |
Standard_Real | ConsiderZoomPersistenceObjects () |
Returns zoom-scale factor. | |
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. | |
const Graphic3d_RenderingParams & | RenderingParams () const |
Returns current rendering parameters and effect settings. | |
Graphic3d_RenderingParams & | ChangeRenderingParams () |
Returns reference to current rendering parameters and effect settings. | |
virtual Aspect_Background | Background () const |
Returns background fill color. | |
virtual void | SetBackground (const Aspect_Background &theBackground) |
Sets background fill color. | |
const Handle< Graphic3d_TextureMap > & | BackgroundImage () |
Returns background image texture map. | |
const Handle< Graphic3d_CubeMap > & | BackgroundCubeMap () const |
Returns cubemap being set last time on background. | |
const Handle< Graphic3d_CubeMap > & | IBLCubeMap () const |
Returns cubemap being set last time on background. | |
Graphic3d_TypeOfBackground | BackgroundType () const |
Returns background type. | |
void | SetBackgroundType (Graphic3d_TypeOfBackground theType) |
Sets background type. | |
const Aspect_SkydomeBackground & | BackgroundSkydome () const |
Returns skydome aspect;. | |
void | SetBackgroundSkydome (const Aspect_SkydomeBackground &theAspect, Standard_Boolean theToUpdatePBREnv=Standard_True) |
Sets skydome aspect. | |
const Handle< Graphic3d_TextureEnv > & | TextureEnv () const |
Returns environment texture set for the view. | |
Standard_Real | UnitFactor () const |
Return unit scale factor defined as scale factor for m (meters); 1.0 by default. Normally, view definition is unitless, however some operations like VR input requires proper units mapping. | |
void | SetUnitFactor (Standard_Real theFactor) |
Set unit scale factor. | |
const Handle< Aspect_XRSession > & | XRSession () const |
Return XR session. | |
void | SetXRSession (const Handle< Aspect_XRSession > &theSession) |
Set XR session. | |
bool | IsActiveXR () const |
Return TRUE if there is active XR session. | |
virtual bool | InitXR () |
Initialize XR session. | |
virtual void | ReleaseXR () |
Release XR session. | |
virtual void | ProcessXRInput () |
Process input. | |
void | SetupXRPosedCamera () |
Compute PosedXRCamera() based on current XR head pose and make it active. | |
void | UnsetXRPosedCamera () |
Set current camera back to BaseXRCamera() and copy temporary modifications of PosedXRCamera(). Calls SynchronizeXRPosedToBaseCamera() beforehand. | |
const Handle< Graphic3d_Camera > & | PosedXRCamera () const |
Returns transient XR camera position with tracked head orientation applied. | |
void | SetPosedXRCamera (const Handle< Graphic3d_Camera > &theCamera) |
Sets transient XR camera position with tracked head orientation applied. | |
const Handle< Graphic3d_Camera > & | BaseXRCamera () const |
Returns anchor camera definition (without tracked head orientation). | |
void | SetBaseXRCamera (const Handle< Graphic3d_Camera > &theCamera) |
Sets anchor camera definition. | |
gp_Trsf | PoseXRToWorld (const gp_Trsf &thePoseXR) const |
Convert XR pose to world space. | |
gp_Ax1 | ViewAxisInWorld (const gp_Trsf &thePoseXR) const |
Returns view direction in the world space based on XR pose. | |
void | SynchronizeXRBaseToPosedCamera () |
Recomputes PosedXRCamera() based on BaseXRCamera() and head orientation. | |
void | SynchronizeXRPosedToBaseCamera () |
Checks if PosedXRCamera() has been modified since SetupXRPosedCamera() and copies these modifications to BaseXRCamera(). | |
void | ComputeXRPosedCameraFromBase (Graphic3d_Camera &theCam, const gp_Trsf &theXRTrsf) const |
Compute camera position based on XR pose. | |
void | ComputeXRBaseCameraFromPosed (const Graphic3d_Camera &theCamPosed, const gp_Trsf &thePoseTrsf) |
Update based camera from posed camera by applying reversed transformation. | |
void | TurnViewXRCamera (const gp_Trsf &theTrsfTurn) |
Turn XR camera direction using current (head) eye position as anchor. | |
virtual const Graphic3d_GraduatedTrihedron & | GetGraduatedTrihedron () |
Returns data of a graduated trihedron. | |
virtual void | DumpJson (Standard_OStream &theOStream, Standard_Integer theDepth=-1) const override |
Dumps the content of me into the stream. | |
bool | IsSubview () const |
Return TRUE if this is a subview of another view. | |
Graphic3d_CView * | ParentView () |
Return parent View or NULL if this is not a subview. | |
bool | IsSubviewComposer () const |
Return TRUE if this is view performs rendering of subviews and nothing else; FALSE by default. By default, view with subviews will render main scene and blit subviews on top of it. Rendering of main scene might become redundant in case if subviews cover entire window of parent view. This flag allows to disable rendering of the main scene in such scenarios without creation of a dedicated V3d_Viewer instance just for composing subviews. | |
void | SetSubviewComposer (bool theIsComposer) |
Set if this view should perform composing of subviews and nothing else. | |
const NCollection_Sequence< Handle< Graphic3d_CView > > & | Subviews () const |
Return subview list. | |
void | AddSubview (const Handle< Graphic3d_CView > &theView) |
Add subview to the list. | |
bool | RemoveSubview (const Graphic3d_CView *theView) |
Remove subview from the list. | |
Aspect_TypeOfTriedronPosition | SubviewCorner () const |
Return subview position within parent view; Aspect_TOTP_LEFT_UPPER by default. | |
void | SetSubviewCorner (Aspect_TypeOfTriedronPosition thePos) |
Set subview position within parent view. | |
const Graphic3d_Vec2i & | SubviewTopLeft () const |
Return subview top-left position relative to parent view in pixels. | |
bool | IsSubViewRelativeSize () const |
Return TRUE if subview size is set as proportions relative to parent view. | |
const Graphic3d_Vec2d & | SubviewSize () const |
Return subview dimensions; (1.0, 1.0) by default. Values >= 2 define size in pixels; Values <= 1.0 define size as fraction of parent view. | |
void | SetSubviewSize (const Graphic3d_Vec2d &theSize) |
Set subview size relative to parent view. | |
const Graphic3d_Vec2d & | SubviewOffset () const |
Return corner offset within parent view; (0.0,0.0) by default. Values >= 2 define offset in pixels; Values <= 1.0 define offset as fraction of parent view dimensions. | |
void | SetSubviewOffset (const Graphic3d_Vec2d &theOffset) |
Set corner offset within parent view. | |
const Graphic3d_Vec2i & | SubviewMargins () const |
Return subview margins in pixels; (0,0) by default. | |
void | SetSubviewMargins (const Graphic3d_Vec2i &theMargins) |
Set subview margins in pixels. | |
void | SubviewResized (const Handle< Aspect_NeutralWindow > &theWindow) |
Update subview position and dimensions. | |
Public Member Functions inherited from Standard_Transient | |
Standard_Transient () | |
Empty constructor. | |
Standard_Transient (const Standard_Transient &) | |
Copy constructor – does nothing. | |
Standard_Transient & | operator= (const Standard_Transient &) |
Assignment operator, needed to avoid copying reference counter. | |
virtual | ~Standard_Transient () |
Destructor must be virtual. | |
virtual const opencascade::handle< Standard_Type > & | DynamicType () const |
Returns a type descriptor about this object. | |
Standard_Boolean | IsInstance (const opencascade::handle< Standard_Type > &theType) const |
Returns a true value if this is an instance of Type. | |
Standard_Boolean | IsInstance (const Standard_CString theTypeName) const |
Returns a true value if this is an instance of TypeName. | |
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. | |
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. | |
Standard_Transient * | This () 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. | |
Standard_Integer | GetRefCount () const noexcept |
Get the reference counter of this object. | |
void | IncrementRefCounter () noexcept |
Increments the reference counter of this object. | |
Standard_Integer | DecrementRefCounter () noexcept |
Decrements the reference counter of this object; returns the decremented value. | |
virtual void | Delete () const |
Memory deallocator for transient classes. | |
Protected Member Functions | |
Internal methods for managing GL resources | |
void | initTextureEnv (const Handle< OpenGl_Context > &theContext) |
Initializes OpenGl resource for environment texture. | |
low-level redrawing sub-routines | |
virtual bool | prepareFrameBuffers (Graphic3d_Camera::Projection &theProj) |
Prepare frame buffers for rendering. | |
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. | |
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. | |
bool | blitSubviews (const Graphic3d_Camera::Projection theProjection, OpenGl_FrameBuffer *theDrawFbo) |
Blit subviews into this view. | |
bool | blitBuffers (OpenGl_FrameBuffer *theReadFbo, OpenGl_FrameBuffer *theDrawFbo, const Standard_Boolean theToFlip=Standard_False) |
Blit image from/to specified buffers. | |
void | bindDefaultFbo (OpenGl_FrameBuffer *theCustomFbo=NULL) |
Setup default FBO. | |
methods related to skydome background | |
void | updateSkydomeBg (const Handle< OpenGl_Context > &theCtx) |
Generates skydome cubemap. | |
methods related to PBR | |
Standard_Boolean | checkPBRAvailability () const |
Checks whether PBR is available. | |
void | updatePBREnvironment (const Handle< OpenGl_Context > &theCtx) |
Generates IBL maps used in PBR pipeline. If background cubemap is not set clears all IBL maps. | |
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. | |
Standard_Boolean | updateRaytraceLightSources (const OpenGl_Mat4 &theInvModelView, const Handle< OpenGl_Context > &theGlContext) |
Updates 3D scene light sources for ray-tracing. | |
Standard_Boolean | toUpdateStructure (const OpenGl_Structure *theStructure) |
Checks to see if the OpenGL structure is modified. | |
Standard_Boolean | addRaytraceStructure (const OpenGl_Structure *theStructure, const Handle< OpenGl_Context > &theGlContext) |
Adds OpenGL structure to ray-traced scene geometry. | |
Standard_Boolean | addRaytraceGroups (const OpenGl_Structure *theStructure, const OpenGl_RaytraceMaterial &theStructMat, const Handle< TopLoc_Datum3D > &theTrsf, const Handle< OpenGl_Context > &theGlContext) |
Adds OpenGL groups to ray-traced scene geometry. | |
OpenGl_RaytraceMaterial | convertMaterial (const OpenGl_Aspects *theAspect, const Handle< OpenGl_Context > &theGlContext) |
Creates ray-tracing material properties. | |
Handle< OpenGl_TriangleSet > | addRaytracePrimitiveArray (const OpenGl_PrimitiveArray *theArray, const Standard_Integer theMatID, const OpenGl_Mat4 *theTrans) |
Adds OpenGL primitive array to ray-traced scene geometry. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
Standard_Boolean | uploadRaytraceData (const Handle< OpenGl_Context > &theGlContext) |
Uploads ray-trace data to the GPU. | |
TCollection_AsciiString | generateShaderPrefix (const Handle< OpenGl_Context > &theGlContext) const |
Generates shader prefix based on current ray-tracing options. | |
Standard_Boolean | safeFailBack (const TCollection_ExtendedString &theMessage, const Handle< OpenGl_Context > &theGlContext) |
Performs safe exit when shaders initialization fails. | |
Handle< OpenGl_ShaderObject > | initShader (const GLenum theType, const ShaderSource &theSource, const Handle< OpenGl_Context > &theGlContext) |
Loads and compiles shader object from specified source. | |
Handle< OpenGl_ShaderProgram > | initProgram (const Handle< OpenGl_Context > &theGlContext, const Handle< OpenGl_ShaderObject > &theVertShader, const Handle< OpenGl_ShaderObject > &theFragShader, const TCollection_AsciiString &theName) |
Creates shader program from the given vertex and fragment shaders. | |
Standard_Boolean | initRaytraceResources (const Standard_Integer theSizeX, const Standard_Integer theSizeY, const Handle< OpenGl_Context > &theGlContext) |
Initializes OpenGL/GLSL shader programs. | |
void | releaseRaytraceResources (const Handle< OpenGl_Context > &theGlContext, const Standard_Boolean theToRebuild=Standard_False) |
Releases OpenGL/GLSL shader programs. | |
Standard_Boolean | updateRaytraceBuffers (const Standard_Integer theSizeX, const Standard_Integer theSizeY, const Handle< OpenGl_Context > &theGlContext) |
Updates auxiliary OpenGL frame buffers. | |
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) | |
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). | |
void | bindRaytraceTextures (const Handle< OpenGl_Context > &theGlContext, int theStereoView) |
Binds ray-trace textures to corresponding texture units. | |
void | unbindRaytraceTextures (const Handle< OpenGl_Context > &theGlContext) |
Unbinds ray-trace textures from corresponding texture unit. | |
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. | |
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. | |
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. | |
Standard_Boolean | runPathtrace (const Standard_Integer theSizeX, const Standard_Integer theSizeY, Graphic3d_Camera::Projection theProjection, const Handle< OpenGl_Context > &theGlContext) |
Runs path tracing (global illumination) kernel. | |
Standard_Boolean | runPathtraceOut (Graphic3d_Camera::Projection theProjection, OpenGl_FrameBuffer *theReadDrawFbo, const Handle< OpenGl_Context > &theGlContext) |
Runs path tracing (global illumination) kernel. | |
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. | |
Protected Member Functions inherited from Graphic3d_DataStructureManager | |
Graphic3d_DataStructureManager () | |
Initializes the manager <me>. | |
Protected Attributes | |
Rendering properties | |
Standard_Integer | mySRgbState |
Two framebuffers (left and right views) store cached main presentation of the view (without presentation of immediate layers). | |
GLint | myFboColorFormat |
sized format for color attachments | |
GLint | myFboDepthFormat |
sized format for depth-stencil attachments | |
OpenGl_ColorFormats | myFboOitColorConfig |
selected color format configuration for OIT color attachments | |
Handle< OpenGl_FrameBuffer > | myMainSceneFbos [2] |
Two framebuffers (left and right views) store cached main presentation of the view (without presentation of immediate layers). | |
Handle< OpenGl_FrameBuffer > | myMainSceneFbosOit [2] |
Additional buffers for transparent draw of main layer. | |
Handle< OpenGl_FrameBuffer > | myImmediateSceneFbos [2] |
Additional buffers for immediate layer in stereo mode. | |
Handle< OpenGl_FrameBuffer > | myImmediateSceneFbosOit [2] |
Additional buffers for transparency draw of immediate layer. | |
Handle< OpenGl_FrameBuffer > | myXrSceneFbo |
additional FBO (without MSAA) for submitting to XR | |
Handle< OpenGl_DepthPeeling > | myDepthPeelingFbos |
additional buffers for depth peeling | |
Handle< OpenGl_ShadowMapArray > | myShadowMaps |
additional FBOs for shadow map rendering | |
OpenGl_VertexBuffer | myFullScreenQuad |
Vertices for full-screen quad rendering. | |
OpenGl_VertexBuffer | myFullScreenQuadFlip |
Two framebuffers (left and right views) store cached main presentation of the view (without presentation of immediate layers). | |
Standard_Boolean | myToFlipOutput |
Flag to draw result image upside-down. | |
unsigned int | myFrameCounter |
redraw counter, for debugging | |
Standard_Boolean | myHasFboBlit |
disable FBOs on failure | |
Standard_Boolean | myToDisableOIT |
disable OIT on failure | |
Standard_Boolean | myToDisableOITMSAA |
disable OIT with MSAA on failure | |
Standard_Boolean | myToDisableMSAA |
disable MSAA after failure | |
Standard_Boolean | myTransientDrawToFront |
optimization flag for immediate mode (to render directly to the front buffer) | |
Standard_Boolean | myBackBufferRestored |
Two framebuffers (left and right views) store cached main presentation of the view (without presentation of immediate layers). | |
Standard_Boolean | myIsImmediateDrawn |
flag indicates that immediate mode buffer contains some data | |
Background parameters | |
OpenGl_Aspects * | myTextureParams |
Stores texture and its parameters for textured background. | |
OpenGl_Aspects * | myCubeMapParams |
Stores cubemap and its parameters for cubemap background. | |
OpenGl_Aspects * | myColoredQuadParams |
Stores parameters for gradient (corner mode) background. | |
OpenGl_BackgroundArray * | myBackgrounds [Graphic3d_TypeOfBackground_NB] |
Array of primitive arrays of different background types. | |
Handle< OpenGl_TextureSet > | myTextureEnv |
Stores texture and its parameters for textured background. | |
Handle< OpenGl_Texture > | mySkydomeTexture |
Stores texture and its parameters for textured background. | |
Protected Attributes inherited from Graphic3d_CView | |
Standard_Integer | myId |
list of child views | |
Graphic3d_RenderingParams | myRenderParams |
list of child views | |
NCollection_Sequence< Handle< Graphic3d_CView > > | mySubviews |
list of child views | |
Graphic3d_CView * | myParentView |
back-pointer to the parent view | |
Standard_Boolean | myIsSubviewComposer |
flag to skip rendering of viewer contents | |
Aspect_TypeOfTriedronPosition | mySubviewCorner |
position within parent view | |
Graphic3d_Vec2i | mySubviewTopLeft |
subview top-left position relative to parent view | |
Graphic3d_Vec2i | mySubviewMargins |
subview margins in pixels | |
Graphic3d_Vec2d | mySubviewSize |
subview size | |
Graphic3d_Vec2d | mySubviewOffset |
subview corner offset within parent view | |
Handle< Graphic3d_StructureManager > | myStructureManager |
list of child views | |
Handle< Graphic3d_Camera > | myCamera |
list of child views | |
Graphic3d_SequenceOfStructure | myStructsToCompute |
list of child views | |
Graphic3d_SequenceOfStructure | myStructsComputed |
list of child views | |
Graphic3d_MapOfStructure | myStructsDisplayed |
list of child views | |
Standard_Boolean | myIsInComputedMode |
list of child views | |
Standard_Boolean | myIsActive |
list of child views | |
Standard_Boolean | myIsRemoved |
list of child views | |
Graphic3d_TypeOfBackfacingModel | myBackfacing |
list of child views | |
Graphic3d_TypeOfVisualization | myVisualization |
list of child views | |
Graphic3d_ZLayerId | myZLayerTarget |
ZLayerId for redrawing the content of specific zlayers. | |
Standard_Boolean | myZLayerRedrawMode |
If true redraws single layer, otherwise redraws group of layers. | |
Quantity_ColorRGBA | myBgColor |
list of child views | |
Handle< Graphic3d_TextureMap > | myBackgroundImage |
list of child views | |
Handle< Graphic3d_CubeMap > | myCubeMapBackground |
Cubemap displayed at background. | |
Handle< Graphic3d_CubeMap > | myCubeMapIBL |
Cubemap used for environment lighting. | |
Handle< Graphic3d_TextureEnv > | myTextureEnvData |
list of child views | |
Graphic3d_GraduatedTrihedron | myGTrihedronData |
list of child views | |
Graphic3d_TypeOfBackground | myBackgroundType |
Current type of background. | |
Aspect_SkydomeBackground | mySkydomeAspect |
list of child views | |
Standard_Boolean | myToUpdateSkydome |
list of child views | |
Handle< Aspect_XRSession > | myXRSession |
list of child views | |
Handle< Graphic3d_Camera > | myBackXRCamera |
camera projection parameters to restore after closing XR session (FOV, aspect and similar) | |
Handle< Graphic3d_Camera > | myBaseXRCamera |
neutral camera orientation defining coordinate system in which head tracking is defined | |
Handle< Graphic3d_Camera > | myPosedXRCamera |
transient XR camera orientation with tracked head orientation applied (based on myBaseXRCamera) | |
Handle< Graphic3d_Camera > | myPosedXRCameraCopy |
neutral camera orientation copy at the beginning of processing input | |
Standard_Real | myUnitFactor |
unit scale factor defined as scale factor for m (meters) | |
fields and types related to PBR | |
enum | PBREnvironmentState { OpenGl_PBREnvState_NONEXISTENT , OpenGl_PBREnvState_UNAVAILABLE , OpenGl_PBREnvState_CREATED } |
State of PBR environment. More... | |
Handle< OpenGl_PBREnvironment > | myPBREnvironment |
manager of IBL maps used in PBR pipeline | |
PBREnvironmentState | myPBREnvState |
state of PBR environment | |
Standard_Boolean | myPBREnvRequest |
update PBR environment | |
Rendering of GL graphics (with prepared drawing buffer). | |
typedef std::pair< Standard_Size, Standard_Size > | StateInfo |
main list of displayed structure, sorted by layers | |
OpenGl_GraphicDriver * | myDriver |
main list of displayed structure, sorted by layers | |
Handle< OpenGl_Window > | myWindow |
main list of displayed structure, sorted by layers | |
Handle< OpenGl_Workspace > | myWorkspace |
main list of displayed structure, sorted by layers | |
Handle< OpenGl_Caps > | myCaps |
main list of displayed structure, sorted by layers | |
Standard_Boolean | myWasRedrawnGL |
main list of displayed structure, sorted by layers | |
Handle< Graphic3d_SequenceOfHClipPlane > | myClipPlanes |
main list of displayed structure, sorted by layers | |
gp_XYZ | myLocalOrigin |
main list of displayed structure, sorted by layers | |
Handle< OpenGl_FrameBuffer > | myFBO |
main list of displayed structure, sorted by layers | |
Standard_Boolean | myToShowGradTrihedron |
main list of displayed structure, sorted by layers | |
Graphic3d_GraduatedTrihedron | myGTrihedronData |
main list of displayed structure, sorted by layers | |
Handle< Graphic3d_LightSet > | myNoShadingLight |
main list of displayed structure, sorted by layers | |
Handle< Graphic3d_LightSet > | myLights |
main list of displayed structure, sorted by layers | |
OpenGl_LayerList | myZLayers |
main list of displayed structure, sorted by layers | |
Graphic3d_WorldViewProjState | myWorldViewProjState |
camera modification state | |
OpenGl_StateCounter * | myStateCounter |
main list of displayed structure, sorted by layers | |
Standard_Size | myCurrLightSourceState |
main list of displayed structure, sorted by layers | |
Standard_Size | myLightsRevision |
main list of displayed structure, sorted by layers | |
StateInfo | myLastOrientationState |
main list of displayed structure, sorted by layers | |
StateInfo | myLastViewMappingState |
main list of displayed structure, sorted by layers | |
StateInfo | myLastLightSourceState |
main list of displayed structure, sorted by layers | |
Graphic3d_CullingTool | myBVHSelector |
Is needed for selection of overlapping objects and storage of the current view volume. | |
OpenGl_GraduatedTrihedron | myGraduatedTrihedron |
main list of displayed structure, sorted by layers | |
OpenGl_FrameStatsPrs | myFrameStatsPrs |
main list of displayed structure, sorted by layers | |
Handle< OpenGl_FrameBuffer > | myOpenGlFBO |
Framebuffers for OpenGL output. | |
Handle< OpenGl_FrameBuffer > | myOpenGlFBO2 |
main list of displayed structure, sorted by layers | |
virtual void | renderShadowMap (const Handle< OpenGl_ShadowMap > &theShadowMap) |
Renders the graphical contents of the view into the prepared shadowmap framebuffer. | |
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 prepared window or framebuffer. | |
virtual void | renderScene (Graphic3d_Camera::Projection theProjection, OpenGl_FrameBuffer *theReadDrawFbo, OpenGl_FrameBuffer *theOitAccumFbo, const Standard_Boolean theToDrawImmediate) |
Renders the graphical scene. | |
virtual void | drawBackground (const Handle< OpenGl_Workspace > &theWorkspace, Graphic3d_Camera::Projection theProjection) |
Draw background (gradient / image / cubemap) | |
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. | |
void | renderTrihedron (const Handle< OpenGl_Workspace > &theWorkspace) |
Renders trihedron. | |
void | renderFrameStats () |
Renders frame statistics. | |
fields related to ray-tracing | |
RaytraceInitStatus | myRaytraceInitStatus |
Result of RT/PT shaders initialization. | |
Standard_Boolean | myIsRaytraceDataValid |
Is ray-tracing geometry data valid? | |
Standard_Boolean | myIsRaytraceWarnTextures |
True if warning about missing extension GL_ARB_bindless_texture has been displayed. | |
OpenGl_RaytraceGeometry | myRaytraceGeometry |
3D scene geometry data for ray-tracing. | |
opencascade::handle< BVH_Builder< Standard_ShortReal, 3 > > | myRaytraceBVHBuilder |
Builder for triangle set. | |
RaytracingParams | myRaytraceParameters |
Compile-time ray-tracing parameters. | |
Standard_ShortReal | myRaytraceSceneRadius |
Radius of bounding sphere of the scene. | |
Standard_ShortReal | myRaytraceSceneEpsilon |
Scene epsilon to prevent self-intersections. | |
ShaderSource | myRaytraceShaderSource |
OpenGL/GLSL source of ray-tracing fragment shader. | |
ShaderSource | myPostFSAAShaderSource |
OpenGL/GLSL source of adaptive-AA fragment shader. | |
ShaderSource | myOutImageShaderSource |
OpenGL/GLSL source of RT/PT display fragment shader. | |
Handle< OpenGl_ShaderObject > | myRaytraceShader |
OpenGL/GLSL ray-tracing fragment shader. | |
Handle< OpenGl_ShaderObject > | myPostFSAAShader |
OpenGL/GLSL adaptive-AA fragment shader. | |
Handle< OpenGl_ShaderObject > | myOutImageShader |
OpenGL/GLSL ray-tracing display fragment shader. | |
Handle< OpenGl_ShaderProgram > | myRaytraceProgram |
OpenGL/GLSL ray-tracing shader program. | |
Handle< OpenGl_ShaderProgram > | myPostFSAAProgram |
OpenGL/GLSL adaptive-AA shader program. | |
Handle< OpenGl_ShaderProgram > | myOutImageProgram |
OpenGL/GLSL program for displaying texture. | |
Handle< OpenGl_TextureBuffer > | mySceneNodeInfoTexture |
Texture buffer of data records of bottom-level BVH nodes. | |
Handle< OpenGl_TextureBuffer > | mySceneMinPointTexture |
Texture buffer of minimum points of bottom-level BVH nodes. | |
Handle< OpenGl_TextureBuffer > | mySceneMaxPointTexture |
Texture buffer of maximum points of bottom-level BVH nodes. | |
Handle< OpenGl_TextureBuffer > | mySceneTransformTexture |
Texture buffer of transformations of high-level BVH nodes. | |
Handle< OpenGl_TextureBuffer > | myGeometryVertexTexture |
Texture buffer of vertex coords. | |
Handle< OpenGl_TextureBuffer > | myGeometryNormalTexture |
Texture buffer of vertex normals. | |
Handle< OpenGl_TextureBuffer > | myGeometryTexCrdTexture |
Texture buffer of vertex UV coords. | |
Handle< OpenGl_TextureBuffer > | myGeometryTriangTexture |
Texture buffer of triangle indices. | |
Handle< OpenGl_TextureBuffer > | myRaytraceMaterialTexture |
Texture buffer of material properties. | |
Handle< OpenGl_TextureBuffer > | myRaytraceLightSrcTexture |
Texture buffer of light source properties. | |
Handle< OpenGl_FrameBuffer > | myRaytraceFBO1 [2] |
1st framebuffer (FBO) to perform adaptive FSAA. Used in compatibility mode (no adaptive sampling). | |
Handle< OpenGl_FrameBuffer > | myRaytraceFBO2 [2] |
2nd framebuffer (FBO) to perform adaptive FSAA. Used in compatibility mode (no adaptive sampling). | |
Handle< OpenGl_Texture > | myRaytraceOutputTexture [2] |
Output textures (2 textures are used in stereo mode). Used if adaptive screen sampling is activated. | |
Handle< OpenGl_Texture > | myRaytraceVisualErrorTexture [2] |
Texture containing per-tile visual error estimation (2 textures are used in stereo mode). Used if adaptive screen sampling is activated. | |
Handle< OpenGl_Texture > | myRaytraceTileOffsetsTexture [2] |
Texture containing offsets of sampled screen tiles (2 textures are used in stereo mode). Used if adaptive screen sampling is activated. | |
Handle< OpenGl_Texture > | myRaytraceTileSamplesTexture [2] |
Texture containing amount of extra per-tile samples (2 textures are used in stereo mode). Used if adaptive screen sampling is activated. | |
OpenGl_VertexBuffer | myRaytraceScreenQuad |
Vertex buffer (VBO) for drawing dummy quad. | |
Standard_Integer | myUniformLocations [2][OpenGl_RT_NbVariables] |
Cached locations of frequently used uniform variables. | |
std::map< const OpenGl_Structure *, StructState > | myStructureStates |
State of OpenGL structures reflected to ray-tracing. | |
std::map< Standard_Size, OpenGl_TriangleSet * > | myArrayToTrianglesMap |
PrimitiveArray to TriangleSet map for scene partial update. | |
std::set< Standard_Integer > | myNonRaytraceStructureIDs |
Set of IDs of non-raytracable elements (to detect updates). | |
Standard_Boolean | myToUpdateEnvironmentMap |
Marks if environment map should be updated. | |
Standard_Size | myRaytraceLayerListState |
State of OpenGL layer list. | |
Standard_Integer | myAccumFrames |
Number of accumulated frames (for progressive rendering). | |
OpenGl_Vec3 | myPreviousOrigins [3] |
Stored ray origins used for detection of camera movements. | |
math_BullardGenerator | myRNG |
Bullard RNG to produce random sequence. | |
OpenGl_TileSampler | myTileSampler |
Tool object for sampling screen tiles in PT mode. | |
OpenGl_Vec3 | myEyeOrig |
Camera position used for projective mode. | |
OpenGl_Vec3 | myEyeView |
Camera view direction used for projective mode. | |
OpenGl_Vec3 | myEyeVert |
Camera's screen vertical direction used for projective mode. | |
OpenGl_Vec3 | myEyeSide |
Camera's screen horizontal direction used for projective mode. | |
OpenGl_Vec2 | myEyeSize |
Camera's screen size used for projective mode. | |
float | myPrevCameraApertureRadius |
Aperture radius of camera on previous frame used for depth-of-field (path tracing) | |
float | myPrevCameraFocalPlaneDist |
Focal distance of camera on previous frame used for depth-of-field (path tracing) | |
Additional Inherited Members | |
Public Types inherited from Standard_Transient | |
typedef void | base_type |
Returns a type descriptor about this object. | |
Static Public Member Functions inherited from Standard_Transient | |
static constexpr const char * | get_type_name () |
Returns a type descriptor about this object. | |
static const opencascade::handle< Standard_Type > & | get_type_descriptor () |
Returns type descriptor of Standard_Transient class. | |
Implementation of OpenGl view.
|
protected |
main list of displayed structure, sorted by layers
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Defines frequently used shader variables.
OpenGl_View::OpenGl_View | ( | const Handle< Graphic3d_StructureManager > & | theMgr, |
const Handle< OpenGl_GraphicDriver > & | theDriver, | ||
const Handle< OpenGl_Caps > & | theCaps, | ||
OpenGl_StateCounter * | theCounter ) |
Constructor.
|
virtual |
Default destructor.
|
protected |
Adds OpenGL groups to ray-traced scene geometry.
|
protected |
Adds OpenGL polygon array to ray-traced scene geometry.
|
protected |
Adds OpenGL primitive array to ray-traced scene geometry.
|
protected |
Adds OpenGL quadrangle array to ray-traced scene geometry.
|
protected |
Adds OpenGL quadrangle strip array to ray-traced scene geometry.
|
protected |
Adds OpenGL structure to ray-traced scene geometry.
|
protected |
Adds OpenGL triangle array to ray-traced scene geometry.
|
protected |
Adds OpenGL triangle fan array to ray-traced scene geometry.
|
protected |
Adds OpenGL triangle strip array to ray-traced scene geometry.
|
protected |
Adds vertex indices from OpenGL primitive array to ray-traced scene geometry.
|
inline |
Returns background color.
|
overridevirtual |
Returns background image fill style.
Implements Graphic3d_CView.
|
protected |
Setup default FBO.
|
protected |
Binds ray-trace textures to corresponding texture units.
|
protected |
Blit image from/to specified buffers.
|
protected |
Blit subviews into this view.
|
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.
|
inline |
Returns selector for BVH tree, providing a possibility to store information about current view volume and to detect which objects are overlapping it.
|
inline |
Change graduated trihedron.
|
protected |
Checks whether PBR is available.
|
inlineoverridevirtual |
Returns list of clip planes set for the view.
Implements Graphic3d_CView.
|
protected |
Creates ray-tracing material properties.
|
inline |
Returns additional buffers for depth peeling OIT.
|
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.
Reimplemented in D3DHost_View.
|
protectedvirtual |
Draw background (gradient / image / cubemap)
|
overridevirtual |
Returns pointer to an assigned framebuffer object.
Implements Graphic3d_CView.
|
overridevirtual |
Change offscreen FBO viewport.
Implements Graphic3d_CView.
|
overridevirtual |
Generate offscreen FBO in the graphic library. If not supported on hardware returns NULL.
Implements Graphic3d_CView.
|
overridevirtual |
Read offscreen FBO configuration.
Implements Graphic3d_CView.
|
overridevirtual |
Remove offscreen FBO from the graphic library.
Implements Graphic3d_CView.
|
protected |
Generates shader prefix based on current ray-tracing options.
|
inline |
Returns OpenGL environment map.
|
inline |
Returns OpenGL window implementation.
|
overridevirtual |
Returns gradient background fill colors.
Implements Graphic3d_CView.
|
overridevirtual |
Displays Graduated Trihedron.
Reimplemented from Graphic3d_CView.
|
overridevirtual |
Erases Graduated Trihedron.
Reimplemented from Graphic3d_CView.
|
overridevirtual |
Sets minimum and maximum points of scene bounding box for Graduated Trihedron stored in graphic view object.
theMin | [in] the minimum point of scene. |
theMax | [in] the maximum point of scene. |
Reimplemented from Graphic3d_CView.
|
inline |
Returns true if there are immediate structures to display.
|
protected |
Creates shader program from the given vertex and fragment shaders.
|
protected |
Initializes OpenGL/GLSL shader programs.
|
protected |
Loads and compiles shader object from specified source.
|
protected |
Initializes OpenGl resource for environment texture.
|
overridevirtual |
Add a layer to the view.
theNewLayerId | [in] id of new layer, should be > 0 (negative values are reserved for default layers). |
theSettings | [in] new layer settings |
theLayerBefore | [in] id of layer to append new layer after |
Implements Graphic3d_CView.
|
overridevirtual |
Add a layer to the view.
theNewLayerId | [in] id of new layer, should be > 0 (negative values are reserved for default layers). |
theSettings | [in] new layer settings |
theLayerAfter | [in] id of layer to append new layer before |
Implements Graphic3d_CView.
|
overridevirtual |
Marks BVH tree for given priority list as dirty and marks primitive set for rebuild.
Implements Graphic3d_CView.
|
overridevirtual |
Marks BVH tree and the set of BVH primitives of correspondent priority list with id theLayerId as outdated.
Implements Graphic3d_CView.
|
inlineoverridevirtual |
Returns True if the window associated to the view is defined.
Implements Graphic3d_CView.
|
inlineoverridevirtual |
Return true if view content cache has been invalidated.
Implements Graphic3d_CView.
|
overridevirtual |
Returns layer with given ID or NULL if undefined.
Implements Graphic3d_CView.
|
inline |
Returns list of OpenGL Z-layers.
|
overridevirtual |
Returns the list of layers.
Implements Graphic3d_CView.
|
inlineoverridevirtual |
Returns list of lights of the view.
Implements Graphic3d_CView.
|
inline |
Returns local camera origin currently set for rendering, might be modified during rendering.
|
overridevirtual |
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.
theToIncludeAuxiliary | consider also auxiliary presentations (with infinite flag or with trihedron transformation persistence) |
Reimplemented from Graphic3d_CView.
|
protectedvirtual |
Prepare frame buffers for rendering.
|
protected |
Redraws the window using OpenGL/GLSL ray-tracing or path tracing.
|
overridevirtual |
|
protectedvirtual |
Redraws view for the given monographic camera projection, or left/right eye.
|
overridevirtual |
|
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.
|
virtual |
Release OpenGL resources.
Reimplemented in D3DHost_View.
|
protected |
Releases OpenGL/GLSL shader programs.
|
overridevirtual |
Deletes and erases the view.
Reimplemented from Graphic3d_CView.
|
overridevirtual |
Remove a z layer with the given ID.
Implements Graphic3d_CView.
|
protectedvirtual |
Renders the graphical contents of the view into the prepared window or framebuffer.
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. |
|
protected |
Renders frame statistics.
|
protectedvirtual |
Renders the graphical scene.
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. |
|
protectedvirtual |
Renders the graphical contents of the view into the prepared shadowmap framebuffer.
theShadowMap | [in] the framebuffer for rendering shadowmap. |
|
protectedvirtual |
Render set of structures presented in the view.
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. |
|
protected |
Renders trihedron.
|
overridevirtual |
Handle changing size of the rendering window.
Implements Graphic3d_CView.
Reimplemented in D3DHost_View.
|
protected |
Runs path tracing (global illumination) kernel.
|
protected |
Runs path tracing (global illumination) kernel.
|
protected |
Runs classical (Whitted-style) ray-tracing kernel.
|
protected |
Runs ray-tracing shader programs.
|
protected |
Performs safe exit when shaders initialization fails.
void OpenGl_View::SetBackgroundGradient | ( | const Quantity_Color & | AColor1, |
const Quantity_Color & | AColor2, | ||
const Aspect_GradientFillMethod | AType ) |
void OpenGl_View::SetBackgroundGradientType | ( | const Aspect_GradientFillMethod | AType | ) |
|
overridevirtual |
Sets image texture or environment cubemap as background.
theTextureMap | [in] source to set a background; should be either Graphic3d_Texture2D or Graphic3d_CubeMap |
theToUpdatePBREnv | [in] defines whether IBL maps will be generated or not (see GeneratePBREnvironment()) |
Implements Graphic3d_CView.
|
overridevirtual |
Sets background image fill style.
Implements Graphic3d_CView.
void OpenGl_View::SetBackgroundTextureStyle | ( | const Aspect_FillMethod | FillStyle | ) |
|
inlineoverridevirtual |
Sets list of clip planes for the view.
Implements Graphic3d_CView.
|
overridevirtual |
Sets framebuffer object for offscreen rendering.
Implements Graphic3d_CView.
|
overridevirtual |
Sets gradient background fill colors.
Implements Graphic3d_CView.
|
overridevirtual |
Enables or disables IBL (Image Based Lighting) from background cubemap. Has no effect if PBR is not used.
[in] | theToEnableIBL | enable or disable IBL from background cubemap |
[in] | theToUpdate | redraw the view |
Implements Graphic3d_CView.
|
overridevirtual |
theDrawToFrontBuffer | Advanced option to modify rendering mode:
|
Implements Graphic3d_CView.
|
inlineoverridevirtual |
Sets list of lights for the view.
Implements Graphic3d_CView.
void OpenGl_View::SetLocalOrigin | ( | const gp_XYZ & | theOrigin | ) |
Setup local camera origin currently set for rendering.
|
overridevirtual |
Sets environment texture for the view.
Implements Graphic3d_CView.
void OpenGl_View::SetTextureEnv | ( | const Handle< OpenGl_Context > & | theCtx, |
const Handle< Graphic3d_TextureEnv > & | theTexture ) |
|
protected |
Sets uniform state for the given ray-tracing shader program.
|
overridevirtual |
Creates and maps rendering window to the view.
Implements Graphic3d_CView.
Reimplemented in D3DHost_View.
|
overridevirtual |
Sets the settings for a single Z layer of specified view.
Implements Graphic3d_CView.
|
overridevirtual |
Dumps the graphical contents of a shadowmap framebuffer into an image.
theImage | the image to store the shadow map. |
theLightName | [in] name of the light used to generate the shadow map. |
Implements Graphic3d_CView.
unsigned int OpenGl_View::SpecIBLMapLevels | ( | ) | const |
Returns number of mipmap levels used in specular IBL map. 0 if PBR environment is not created.
|
overridevirtual |
Returns string with statistic performance info.
Implements Graphic3d_CView.
|
overridevirtual |
Fills in the dictionary with statistic performance info.
Implements Graphic3d_CView.
|
protected |
Checks to see if the OpenGL structure is modified.
|
protected |
Unbinds ray-trace textures from corresponding texture unit.
|
protected |
Generates viewing rays for corners of screen quad. (ray tracing; path tracing for orthographic camera)
|
protected |
Generates IBL maps used in PBR pipeline. If background cubemap is not set clears all IBL maps.
|
protected |
Generate viewing rays (path tracing, perspective camera).
|
protected |
Updates auxiliary OpenGL frame buffers.
|
protected |
Updates 3D scene geometry for ray-tracing.
|
protected |
Updates 3D scene light sources for ray-tracing.
|
protected |
Generates skydome cubemap.
|
protected |
Uploads ray-trace data to the GPU.
|
overridevirtual |
Returns window associated with the view.
Implements Graphic3d_CView.
|
overridevirtual |
Returns the maximum Z layer ID. First layer ID is Graphic3d_ZLayerId_Default, last ID is ZLayerMax().
Implements Graphic3d_CView.
|
protected |
Number of accumulated frames (for progressive rendering).
|
protected |
PrimitiveArray to TriangleSet map for scene partial update.
|
protected |
Two framebuffers (left and right views) store cached main presentation of the view (without presentation of immediate layers).
track sRGB state
|
protected |
Array of primitive arrays of different background types.
|
protected |
Is needed for selection of overlapping objects and storage of the current view volume.
|
protected |
main list of displayed structure, sorted by layers
|
protected |
main list of displayed structure, sorted by layers
|
protected |
Stores parameters for gradient (corner mode) background.
|
protected |
Stores cubemap and its parameters for cubemap background.
|
protected |
main list of displayed structure, sorted by layers
|
protected |
additional buffers for depth peeling
|
protected |
main list of displayed structure, sorted by layers
|
protected |
Camera position used for projective mode.
|
protected |
Camera's screen horizontal direction used for projective mode.
|
protected |
Camera's screen size used for projective mode.
|
protected |
Camera's screen vertical direction used for projective mode.
|
protected |
Camera view direction used for projective mode.
|
protected |
main list of displayed structure, sorted by layers
|
protected |
sized format for color attachments
|
protected |
sized format for depth-stencil attachments
|
protected |
selected color format configuration for OIT color attachments
|
protected |
redraw counter, for debugging
|
protected |
main list of displayed structure, sorted by layers
|
protected |
Vertices for full-screen quad rendering.
|
protected |
Two framebuffers (left and right views) store cached main presentation of the view (without presentation of immediate layers).
track sRGB state
|
protected |
Texture buffer of vertex normals.
|
protected |
Texture buffer of vertex UV coords.
|
protected |
Texture buffer of triangle indices.
|
protected |
Texture buffer of vertex coords.
|
protected |
main list of displayed structure, sorted by layers
|
protected |
main list of displayed structure, sorted by layers
|
protected |
disable FBOs on failure
|
protected |
Additional buffers for immediate layer in stereo mode.
|
protected |
Additional buffers for transparency draw of immediate layer.
|
protected |
flag indicates that immediate mode buffer contains some data
|
protected |
Is ray-tracing geometry data valid?
|
protected |
True if warning about missing extension GL_ARB_bindless_texture has been displayed.
|
protected |
main list of displayed structure, sorted by layers
|
protected |
main list of displayed structure, sorted by layers
|
protected |
main list of displayed structure, sorted by layers
|
protected |
main list of displayed structure, sorted by layers
|
protected |
main list of displayed structure, sorted by layers
|
protected |
main list of displayed structure, sorted by layers
|
protected |
Two framebuffers (left and right views) store cached main presentation of the view (without presentation of immediate layers).
track sRGB state
|
protected |
Additional buffers for transparent draw of main layer.
|
protected |
Set of IDs of non-raytracable elements (to detect updates).
|
protected |
main list of displayed structure, sorted by layers
|
protected |
Framebuffers for OpenGL output.
|
protected |
main list of displayed structure, sorted by layers
|
protected |
OpenGL/GLSL program for displaying texture.
|
protected |
OpenGL/GLSL ray-tracing display fragment shader.
|
protected |
OpenGL/GLSL source of RT/PT display fragment shader.
|
protected |
manager of IBL maps used in PBR pipeline
|
protected |
update PBR environment
|
protected |
state of PBR environment
|
protected |
OpenGL/GLSL adaptive-AA shader program.
|
protected |
OpenGL/GLSL adaptive-AA fragment shader.
|
protected |
OpenGL/GLSL source of adaptive-AA fragment shader.
|
protected |
Aperture radius of camera on previous frame used for depth-of-field (path tracing)
|
protected |
Focal distance of camera on previous frame used for depth-of-field (path tracing)
|
protected |
Stored ray origins used for detection of camera movements.
|
protected |
Builder for triangle set.
|
protected |
1st framebuffer (FBO) to perform adaptive FSAA. Used in compatibility mode (no adaptive sampling).
|
protected |
2nd framebuffer (FBO) to perform adaptive FSAA. Used in compatibility mode (no adaptive sampling).
|
protected |
3D scene geometry data for ray-tracing.
|
protected |
Result of RT/PT shaders initialization.
|
protected |
State of OpenGL layer list.
|
protected |
Texture buffer of light source properties.
|
protected |
Texture buffer of material properties.
|
protected |
Output textures (2 textures are used in stereo mode). Used if adaptive screen sampling is activated.
|
protected |
Compile-time ray-tracing parameters.
|
protected |
OpenGL/GLSL ray-tracing shader program.
|
protected |
Scene epsilon to prevent self-intersections.
|
protected |
Radius of bounding sphere of the scene.
|
protected |
Vertex buffer (VBO) for drawing dummy quad.
|
protected |
OpenGL/GLSL ray-tracing fragment shader.
|
protected |
OpenGL/GLSL source of ray-tracing fragment shader.
|
protected |
Texture containing offsets of sampled screen tiles (2 textures are used in stereo mode). Used if adaptive screen sampling is activated.
|
protected |
Texture containing amount of extra per-tile samples (2 textures are used in stereo mode). Used if adaptive screen sampling is activated.
|
protected |
Texture containing per-tile visual error estimation (2 textures are used in stereo mode). Used if adaptive screen sampling is activated.
|
protected |
Bullard RNG to produce random sequence.
|
protected |
Texture buffer of maximum points of bottom-level BVH nodes.
|
protected |
Texture buffer of minimum points of bottom-level BVH nodes.
|
protected |
Texture buffer of data records of bottom-level BVH nodes.
|
protected |
Texture buffer of transformations of high-level BVH nodes.
|
protected |
additional FBOs for shadow map rendering
|
protected |
Stores texture and its parameters for textured background.
|
protected |
Two framebuffers (left and right views) store cached main presentation of the view (without presentation of immediate layers).
track sRGB state
|
protected |
main list of displayed structure, sorted by layers
|
protected |
State of OpenGL structures reflected to ray-tracing.
|
protected |
Stores texture and its parameters for textured background.
|
protected |
Stores texture and its parameters for textured background.
|
protected |
Tool object for sampling screen tiles in PT mode.
|
protected |
disable MSAA after failure
|
protected |
disable OIT on failure
|
protected |
disable OIT with MSAA on failure
|
protected |
Flag to draw result image upside-down.
|
protected |
main list of displayed structure, sorted by layers
|
protected |
Marks if environment map should be updated.
|
protected |
optimization flag for immediate mode (to render directly to the front buffer)
|
protected |
Cached locations of frequently used uniform variables.
|
protected |
main list of displayed structure, sorted by layers
|
protected |
main list of displayed structure, sorted by layers
|
protected |
main list of displayed structure, sorted by layers
|
protected |
camera modification state
|
protected |
additional FBO (without MSAA) for submitting to XR
|
protected |
main list of displayed structure, sorted by layers
|
staticprotected |
Default ray-tracing depth.
|
staticprotected |
Default size of traversal stack.