Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:04:21

0001 // Created on: 2021-01-15
0002 // Copyright (c) 2021 OPEN CASCADE SAS
0003 //
0004 // This file is part of Open CASCADE Technology software library.
0005 //
0006 // This library is free software; you can redistribute it and/or modify it under
0007 // the terms of the GNU Lesser General Public License version 2.1 as published
0008 // by the Free Software Foundation, with special exception defined in the file
0009 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0010 // distribution for complete text of the license and disclaimer of any warranty.
0011 //
0012 // Alternatively, this file may be used under the terms of Open CASCADE
0013 // commercial license or contractual agreement.
0014 
0015 #ifndef _OpenGl_DepthPeeling_HeaderFile
0016 #define _OpenGl_DepthPeeling_HeaderFile
0017 
0018 #include <OpenGl_FrameBuffer.hxx>
0019 #include <OpenGl_NamedResource.hxx>
0020 
0021 //! Class provides FBOs for dual depth peeling.
0022 class OpenGl_DepthPeeling : public OpenGl_NamedResource
0023 {
0024   DEFINE_STANDARD_RTTIEXT(OpenGl_DepthPeeling, OpenGl_NamedResource)
0025 public:
0026 
0027   //! Constructor.
0028   Standard_EXPORT OpenGl_DepthPeeling();
0029 
0030   //! Destructor.
0031   Standard_EXPORT virtual ~OpenGl_DepthPeeling();
0032 
0033   //! Release OpenGL resources
0034   Standard_EXPORT virtual void Release (OpenGl_Context* theGlCtx) Standard_OVERRIDE;
0035 
0036   //! Returns estimated GPU memory usage for holding data without considering overheads and allocation alignment rules.
0037   Standard_EXPORT virtual Standard_Size EstimatedDataSize() const Standard_OVERRIDE;
0038 
0039   //! Attach a texture image.
0040   //! Resets the active FBO to 0.
0041   Standard_EXPORT void AttachDepthTexture (const Handle(OpenGl_Context)& theCtx,
0042                                            const Handle(OpenGl_Texture)& theDepthStencilTexture);
0043 
0044   //! Detach a texture image.
0045   //! Resets the active FBO to 0.
0046   Standard_EXPORT void DetachDepthTexture (const Handle(OpenGl_Context)& theCtx);
0047 
0048   //! Returns additional buffers for ping-pong
0049   const Handle(OpenGl_FrameBuffer)* DepthPeelFbosOit() const { return myDepthPeelFbosOit; }
0050 
0051   //! Returns additional buffers for ping-pong
0052   const Handle(OpenGl_FrameBuffer)* FrontBackColorFbosOit() const { return myFrontBackColorFbosOit; }
0053 
0054   //! Returns additional FBO for depth peeling
0055   const Handle(OpenGl_FrameBuffer)& BlendBackFboOit() const { return myBlendBackFboOit; }
0056 
0057 private:
0058 
0059   Handle(OpenGl_FrameBuffer) myDepthPeelFbosOit[2];      //!< depth + front color + back color
0060   Handle(OpenGl_FrameBuffer) myFrontBackColorFbosOit[2]; //!< front color + back color
0061   Handle(OpenGl_FrameBuffer) myBlendBackFboOit;
0062 
0063 };
0064 
0065 #endif // _OpenGl_DepthPeeling_HeaderFile