VTK
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
vtkOpenGLFramebufferObject Class Reference

Internal class which encapsulates OpenGL FramebufferObject. More...

#include <vtkOpenGLFramebufferObject.h>

Inheritance diagram for vtkOpenGLFramebufferObject:
[legend]
Collaboration diagram for vtkOpenGLFramebufferObject:
[legend]

Public Types

typedef vtkFrameBufferObjectBase Superclass
 
- Public Types inherited from vtkFrameBufferObjectBase
typedef vtkObject Superclass
 

Public Member Functions

virtual vtkTypeBool IsA (const char *type)
 Return 1 if this class is the same type of (or a subclass of) the named class. More...
 
vtkOpenGLFramebufferObjectNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent) override
 Methods invoked by print to print information about the object including superclasses. More...
 
void SetContext (vtkRenderWindow *context)
 Get/Set the context. More...
 
vtkOpenGLRenderWindowGetContext ()
 
void Bind ()
 Make the draw frame buffer active. More...
 
void Bind (unsigned int mode)
 
void UnBind ()
 Unbind this buffer. More...
 
void UnBind (unsigned int mode)
 
void SaveCurrentBindingsAndBuffers ()
 Store/Restore the current framebuffer bindings and buffers. More...
 
void SaveCurrentBindingsAndBuffers (unsigned int mode)
 
void RestorePreviousBindingsAndBuffers ()
 
void RestorePreviousBindingsAndBuffers (unsigned int mode)
 
bool Start (int width, int height)
 User must take care that width/height match the dimensions of the user defined texture attachments. More...
 
bool StartNonOrtho (int width, int height)
 
void InitializeViewport (int width, int height)
 Set up ortho viewport with scissor, lighting, blend, and depth disabled. More...
 
void ActivateDrawBuffers (unsigned int n)
 
void ActivateDrawBuffers (unsigned int *ids, int n)
 
void ActivateDrawBuffer (unsigned int id)
 
void ActivateReadBuffer (unsigned int id)
 
void ActivateBuffer (unsigned int id)
 
void DeactivateDrawBuffers ()
 
void DeactivateReadBuffer ()
 
virtual unsigned int GetActiveReadBuffer ()
 
unsigned int GetActiveDrawBuffer (unsigned int id)
 
void RenderQuad (int minX, int maxX, int minY, int maxY, vtkShaderProgram *program, vtkOpenGLVertexArrayObject *vao)
 Renders a quad at the given location with pixel coordinates. More...
 
void AddColorAttachment (unsigned int attId, vtkTextureObject *tex, unsigned int zslice=0, unsigned int format=0, unsigned int mipmapLevel=0)
 Directly assign/remove a texture to color attachments. More...
 
void AddColorAttachment (unsigned int attId, vtkRenderbuffer *tex)
 
void RemoveColorAttachment (unsigned int index)
 
void RemoveColorAttachments (unsigned int num)
 
int GetNumberOfColorAttachments ()
 Return the number of color attachments for the given mode. More...
 
void AddDepthAttachment ()
 Directly assign/remove a texture/renderbuffer to depth attachments. More...
 
void AddDepthAttachment (vtkTextureObject *tex)
 
void AddDepthAttachment (vtkRenderbuffer *tex)
 
void RemoveDepthAttachment ()
 
bool PopulateFramebuffer (int width, int height)
 Convenience method to populate a framebuffer with attachments created as well. More...
 
bool PopulateFramebuffer (int width, int height, bool useTextures, int numberOfColorAttachments, int colorDataType, bool wantDepthAttachment, int depthBitplanes, int multisamples, bool wantStencilAttachment=false)
 
unsigned int GetMaximumNumberOfActiveTargets ()
 Returns the maximum number of targets that can be rendered to at one time. More...
 
unsigned int GetMaximumNumberOfRenderTargets ()
 Returns the maximum number of render targets available. More...
 
int * GetLastSize () override
 Dimensions in pixels of the framebuffer. More...
 
void GetLastSize (int &_arg1, int &_arg2) override
 
void GetLastSize (int _arg[2]) override
 
int CheckFrameBufferStatus (unsigned int mode)
 Validate the current FBO configuration (attachments, formats, etc) prints detected errors to vtkErrorMacro. More...
 
virtual void ReleaseGraphicsResources (vtkWindow *win)
 Deactivate and UnBind. More...
 
virtual unsigned int GetFBOIndex ()
 
vtkPixelBufferObjectDownloadColor1 (int extent[4], int vtkType, int channel)
 Download data from the read color attachment of the currently bound FBO into the returned PBO. More...
 
vtkPixelBufferObjectDownloadColor3 (int extent[4], int vtkType)
 
vtkPixelBufferObjectDownloadColor4 (int extent[4], int vtkType)
 
vtkPixelBufferObjectDownloadDepth (int extent[4], int vtkType)
 Download data from the depth attachment of the currently bound FBO. More...
 
vtkPixelBufferObjectDownload (int extent[4], int vtkType, int nComps, int oglType, int oglFormat)
 Download data from the read buffer of the current FBO. More...
 
void Resize (int width, int height)
 Resize all FO attachments. More...
 
- Public Member Functions inherited from vtkFrameBufferObjectBase
vtkFrameBufferObjectBaseNewInstance () const
 
- Public Member Functions inherited from vtkObject
 vtkBaseTypeMacro (vtkObject, vtkObjectBase)
 
virtual void DebugOn ()
 Turn debugging output on. More...
 
virtual void DebugOff ()
 Turn debugging output off. More...
 
bool GetDebug ()
 Get the value of the debug flag. More...
 
void SetDebug (bool debugFlag)
 Set the value of the debug flag. More...
 
virtual void Modified ()
 Update the modification time for this object. More...
 
virtual vtkMTimeType GetMTime ()
 Return this object's modified time. More...
 
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
 
vtkCommandGetCommand (unsigned long tag)
 
void RemoveObserver (vtkCommand *)
 
void RemoveObservers (unsigned long event, vtkCommand *)
 
void RemoveObservers (const char *event, vtkCommand *)
 
vtkTypeBool HasObserver (unsigned long event, vtkCommand *)
 
vtkTypeBool HasObserver (const char *event, vtkCommand *)
 
void RemoveObserver (unsigned long tag)
 
void RemoveObservers (unsigned long event)
 
void RemoveObservers (const char *event)
 
void RemoveAllObservers ()
 
vtkTypeBool HasObserver (unsigned long event)
 
vtkTypeBool HasObserver (const char *event)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f)
 Overloads to AddObserver that allow developers to add class member functions as callbacks for events. More...
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 Allow user to set the AbortFlagOn() with the return value of the callback method. More...
 
int InvokeEvent (unsigned long event, void *callData)
 This method invokes an event and return whether the event was aborted or not. More...
 
int InvokeEvent (const char *event, void *callData)
 
int InvokeEvent (unsigned long event)
 
int InvokeEvent (const char *event)
 
- Public Member Functions inherited from vtkObjectBase
const char * GetClassName () const
 Return the class name as a string. More...
 
virtual void Delete ()
 Delete a VTK object. More...
 
virtual void FastDelete ()
 Delete a reference to this object. More...
 
void InitializeObjectBase ()
 
void Print (ostream &os)
 Print an object to an ostream. More...
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 
virtual void Register (vtkObjectBase *o)
 Increase the reference count (mark as used by another object). More...
 
virtual void UnRegister (vtkObjectBase *o)
 Decrease the reference count (release by another object). More...
 
int GetReferenceCount ()
 Return the current reference count of this object. More...
 
void SetReferenceCount (int)
 Sets the reference count. More...
 
void PrintRevisions (ostream &)
 Legacy. More...
 

Static Public Member Functions

static vtkOpenGLFramebufferObjectNew ()
 
static vtkTypeBool IsTypeOf (const char *type)
 
static vtkOpenGLFramebufferObjectSafeDownCast (vtkObjectBase *o)
 
static bool IsSupported (vtkOpenGLRenderWindow *)
 Returns if the context supports the required extensions. More...
 
static bool GetFrameBufferStatus (unsigned int mode, const char *&desc)
 Validate the current FBO configuration (attachments, formats, etc) return false if the FBO is incomplete. More...
 
static int Blit (const int srcExt[4], const int destExt[4], unsigned int bits, unsigned int mapping)
 Copy from the currently bound READ FBO to the currently bound DRAW FBO. More...
 
static void Download (int extent[4], int vtkType, int nComps, int oglType, int oglFormat, vtkPixelBufferObject *pbo)
 
static unsigned int GetDrawMode ()
 
static unsigned int GetReadMode ()
 
static unsigned int GetBothMode ()
 
- Static Public Member Functions inherited from vtkFrameBufferObjectBase
static vtkTypeBool IsTypeOf (const char *type)
 
static vtkFrameBufferObjectBaseSafeDownCast (vtkObjectBase *o)
 
- Static Public Member Functions inherited from vtkObject
static vtkObjectNew ()
 Create an object with Debug turned off, modified time initialized to zero, and reference counting on. More...
 
static void BreakOnError ()
 This method is called when vtkErrorMacro executes. More...
 
static void SetGlobalWarningDisplay (int val)
 This is a global flag that controls whether any debug, warning or error messages are displayed. More...
 
static void GlobalWarningDisplayOn ()
 
static void GlobalWarningDisplayOff ()
 
static int GetGlobalWarningDisplay ()
 
- Static Public Member Functions inherited from vtkObjectBase
static vtkTypeBool IsTypeOf (const char *name)
 Return 1 if this class type is the same type of (or a subclass of) the named class. More...
 
static vtkObjectBaseNew ()
 Create an object with Debug turned off, modified time initialized to zero, and reference counting on. More...
 

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 
void AttachColorBuffer (unsigned int index)
 Attach a specific buffer. More...
 
void AttachDepthBuffer ()
 
void CreateFBO ()
 
void DestroyFBO ()
 
void DestroyDepthBuffer (vtkWindow *win)
 
void DestroyColorBuffers (vtkWindow *win)
 
void ActivateBuffers ()
 
void UpdateSize ()
 
void DisplayFrameBufferAttachments ()
 Display all the attachments of the current framebuffer object. More...
 
void DisplayFrameBufferAttachment (unsigned int uattachment)
 Display a given attachment for the current framebuffer object. More...
 
void DisplayDrawBuffers ()
 Display the draw buffers. More...
 
void DisplayReadBuffer ()
 Display the read buffer. More...
 
void DisplayBuffer (int value)
 Display any buffer (convert value into string). More...
 
int GetOpenGLType (int vtkType)
 Given a vtk type get a compatible open gl type. More...
 
 vtkOpenGLFramebufferObject ()
 
 ~vtkOpenGLFramebufferObject () override
 
- Protected Member Functions inherited from vtkFrameBufferObjectBase
 vtkFrameBufferObjectBase ()
 
 ~vtkFrameBufferObjectBase () override
 
- Protected Member Functions inherited from vtkObject
 vtkObject ()
 
 ~vtkObject () override
 
void RegisterInternal (vtkObjectBase *, vtkTypeBool check) override
 
void UnRegisterInternal (vtkObjectBase *, vtkTypeBool check) override
 
void InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=nullptr)
 These methods allow a command to exclusively grab all events. More...
 
void InternalReleaseFocus ()
 
- Protected Member Functions inherited from vtkObjectBase
 vtkObjectBase ()
 
virtual ~vtkObjectBase ()
 
virtual void CollectRevisions (ostream &)
 
virtual void ReportReferences (vtkGarbageCollector *)
 
 vtkObjectBase (const vtkObjectBase &)
 
void operator= (const vtkObjectBase &)
 

Static Protected Member Functions

static bool LoadRequiredExtensions (vtkOpenGLRenderWindow *)
 Load all necessary extensions. More...
 

Protected Attributes

vtkGenericOpenGLResourceFreeCallbackResourceCallback
 
vtkWeakPointer< vtkOpenGLRenderWindowContext
 
unsigned int FBOIndex
 
bool DrawBindingSaved
 
bool ReadBindingSaved
 
bool DrawBufferSaved
 
bool ReadBufferSaved
 
int LastSize [2]
 
std::vector< unsigned int > ActiveBuffers
 
unsigned int ActiveReadBuffer
 
vtkFOInfo * DepthBuffer
 
std::map< unsigned int, vtkFOInfo * > ColorBuffers
 
- Protected Attributes inherited from vtkObject
bool Debug
 
vtkTimeStamp MTime
 
vtkSubjectHelper * SubjectHelper
 
- Protected Attributes inherited from vtkObjectBase
std::atomic< int32_t > ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 

Detailed Description

Internal class which encapsulates OpenGL FramebufferObject.

Before delving into this class it is best to have some background in some OpenGL terms. OpenGL has a notion of a currently bound Framebuffers for drawing and reading. It can be the default framebuffer such as created with a standard window/context or it can be a user created Framebuffer objects. When draw and read commands are invoked, they apply to the current draw and/or read frambuffers.

A framebuffer consists of color buffers and an optional depth buffer. The FramebufferObject does not hold the memory for these buffers, it just keeps track of what buffers are attached to it. The buffers themselves hold the storage for the pixels/depths.

In the context of this discussion a buffer can be either a vtkTextureObject (both 2D or a slice of a 3D texture) or a vtkRenderbuffer. In some cases a renderbuffer may be faster or more lightweight but you cannot pass a renderbuffer into a shader for sampling in a later pass like you can a texture.

You attach these buffers to the Framebuffer using methods such as AddColorAttachment or AddDepthAttachment In normal usage a buffer is Attached to a FramebufferObject and then some or all of the attached buffers are activated for drawing or reading.

When you have a framebuffer bound along with some buffers attached to it you can then activate specific buffers for drawing or reading. So you have draw and read framebuffer objects (bindings) and then for the currently bound FramebufferObjects you have active draw and read buffers.

A single FramebufferObject can be bound to both Draw and Read. You cannot assign and activate a TextureObject for drawing on the FO and at the same time pass it in as a Texture to the shader program. That type of operation is very common and must be done in two steps.

Typical use cases: The simplest example

fbo->SetContext(renWin);
fbo->SaveCurrentBindingsAndBuffers();
fbo->PopulateFramebuffer(width, height);
...
fbo->RestorePreviousBindingsAndBuffers();

If you wish to use a texture you created

fbo->SetContext(renWin);
fbo->SaveCurrentBindingsAndBuffers();
fbo->Bind();
fbo->AddColorAttachment(0, vtkTextureObj);
fbo->AddDepthAttachment(); // auto create depth buffer
fbo->ActivateBuffer(0);
...
fbo->RestorePreviousBindingsAndBuffers();

If you will be using a FO repeatedly then it is best to create it attach the buffers and then use as needed for example

Typical use case:

// setup the FBO once
fbo->SetContext(renWin);
fbo->SaveCurrentBindingsAndBuffers();
fbo->AddColorAttachment(0, vtkTextureObj);
fbo->AddDepthAttachment(); // auto create depth buffer
fbo->RestorePreviousBindingsAndBuffers();
// use it many times
fbo->SaveCurrentBindingsAndBuffers();
fbo->Bind();
fbo->ActivateBuffer(0);
... // render here etc
fbo->RestorePreviousBindingsAndBuffers();

If you with to only bind the framebuffer for drawing or reading there are mode specific versions of some methods that only apply to the mode specified Draw/Read/Both. The mode argument uses OpenGL constants so this class provides convenience methods to return them named GetDrawMode() GetReadMode() and GetBothMode() so that your code does not need to be polluted with OpenGL headers/constants.

This class replaces both vtkFrameBufferObject and vtkFrameBufferObject2 and contins methods from both of them. Most methods from FO2 should work with this class. Just rename FBO2 to FBO and make sure to Save and Restore the bindings and buffers. If you have been using the old FO class, which had comments in the header saying not to use it. Then you are in for a bit more of a conversion but generally it should still be easy. Use the code samples above (or any of the classes in OpenGL2 that currently use FBOs) to guide you. They have all been converted to this class. Where previously a DepthBuffer was automatically created for you, you now need to do it explicitly using AddDepthAttachment().

Note the capitalization of FramebufferObject

See also
vtkTextureObject, vtkRenderbufferObject

Definition at line 182 of file vtkOpenGLFramebufferObject.h.

Member Typedef Documentation

◆ Superclass

Definition at line 186 of file vtkOpenGLFramebufferObject.h.

Constructor & Destructor Documentation

◆ vtkOpenGLFramebufferObject()

vtkOpenGLFramebufferObject::vtkOpenGLFramebufferObject ( )
protected

◆ ~vtkOpenGLFramebufferObject()

vtkOpenGLFramebufferObject::~vtkOpenGLFramebufferObject ( )
overrideprotected

Member Function Documentation

◆ New()

static vtkOpenGLFramebufferObject* vtkOpenGLFramebufferObject::New ( )
static

◆ IsTypeOf()

static vtkTypeBool vtkOpenGLFramebufferObject::IsTypeOf ( const char *  type)
static

◆ IsA()

virtual vtkTypeBool vtkOpenGLFramebufferObject::IsA ( const char *  name)
virtual

Return 1 if this class is the same type of (or a subclass of) the named class.

Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkFrameBufferObjectBase.

◆ SafeDownCast()

static vtkOpenGLFramebufferObject* vtkOpenGLFramebufferObject::SafeDownCast ( vtkObjectBase o)
static

◆ NewInstanceInternal()

virtual vtkObjectBase* vtkOpenGLFramebufferObject::NewInstanceInternal ( ) const
protectedvirtual

Reimplemented from vtkFrameBufferObjectBase.

◆ NewInstance()

vtkOpenGLFramebufferObject* vtkOpenGLFramebufferObject::NewInstance ( ) const

◆ PrintSelf()

void vtkOpenGLFramebufferObject::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
overridevirtual

Methods invoked by print to print information about the object including superclasses.

Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from vtkFrameBufferObjectBase.

◆ SetContext()

void vtkOpenGLFramebufferObject::SetContext ( vtkRenderWindow context)

Get/Set the context.

Context must be a vtkOpenGLRenderWindow. This does not increase the reference count of the context to avoid reference loops. SetContext() may raise an error is the OpenGL context does not support the required OpenGL extensions.

◆ GetContext()

vtkOpenGLRenderWindow* vtkOpenGLFramebufferObject::GetContext ( )

◆ Bind() [1/2]

void vtkOpenGLFramebufferObject::Bind ( )

Make the draw frame buffer active.

◆ Bind() [2/2]

void vtkOpenGLFramebufferObject::Bind ( unsigned int  mode)

◆ UnBind() [1/2]

void vtkOpenGLFramebufferObject::UnBind ( )

Unbind this buffer.

◆ UnBind() [2/2]

void vtkOpenGLFramebufferObject::UnBind ( unsigned int  mode)

◆ SaveCurrentBindingsAndBuffers() [1/2]

void vtkOpenGLFramebufferObject::SaveCurrentBindingsAndBuffers ( )

Store/Restore the current framebuffer bindings and buffers.

◆ SaveCurrentBindingsAndBuffers() [2/2]

void vtkOpenGLFramebufferObject::SaveCurrentBindingsAndBuffers ( unsigned int  mode)

◆ RestorePreviousBindingsAndBuffers() [1/2]

void vtkOpenGLFramebufferObject::RestorePreviousBindingsAndBuffers ( )

◆ RestorePreviousBindingsAndBuffers() [2/2]

void vtkOpenGLFramebufferObject::RestorePreviousBindingsAndBuffers ( unsigned int  mode)

◆ Start()

bool vtkOpenGLFramebufferObject::Start ( int  width,
int  height 
)

User must take care that width/height match the dimensions of the user defined texture attachments.

This method makes the "active buffers" the buffers that will get drawn into by subsequent drawing calls. Note that this does not clear the render buffers i.e. no glClear() calls are made by either of these methods. It's up to the caller to clear the buffers if needed.

◆ StartNonOrtho()

bool vtkOpenGLFramebufferObject::StartNonOrtho ( int  width,
int  height 
)

◆ InitializeViewport()

void vtkOpenGLFramebufferObject::InitializeViewport ( int  width,
int  height 
)

Set up ortho viewport with scissor, lighting, blend, and depth disabled.

The method affects the current bound FBO.

◆ ActivateDrawBuffers() [1/2]

void vtkOpenGLFramebufferObject::ActivateDrawBuffers ( unsigned int  n)

◆ ActivateDrawBuffers() [2/2]

void vtkOpenGLFramebufferObject::ActivateDrawBuffers ( unsigned int *  ids,
int  n 
)

◆ ActivateDrawBuffer()

void vtkOpenGLFramebufferObject::ActivateDrawBuffer ( unsigned int  id)

◆ ActivateReadBuffer()

void vtkOpenGLFramebufferObject::ActivateReadBuffer ( unsigned int  id)

◆ ActivateBuffer()

void vtkOpenGLFramebufferObject::ActivateBuffer ( unsigned int  id)
inline

Definition at line 249 of file vtkOpenGLFramebufferObject.h.

◆ DeactivateDrawBuffers()

void vtkOpenGLFramebufferObject::DeactivateDrawBuffers ( )

◆ DeactivateReadBuffer()

void vtkOpenGLFramebufferObject::DeactivateReadBuffer ( )

◆ GetActiveReadBuffer()

virtual unsigned int vtkOpenGLFramebufferObject::GetActiveReadBuffer ( )
virtual

◆ GetActiveDrawBuffer()

unsigned int vtkOpenGLFramebufferObject::GetActiveDrawBuffer ( unsigned int  id)

◆ RenderQuad()

void vtkOpenGLFramebufferObject::RenderQuad ( int  minX,
int  maxX,
int  minY,
int  maxY,
vtkShaderProgram program,
vtkOpenGLVertexArrayObject vao 
)

Renders a quad at the given location with pixel coordinates.

This method is provided as a convenience, since we often render quads in a FBO.

Precondition
positive_minX: minX>=0
increasing_x: minX<=maxX
valid_maxX: maxX<LastSize[0]
positive_minY: minY>=0
increasing_y: minY<=maxY
valid_maxY: maxY<LastSize[1]

◆ AddColorAttachment() [1/2]

void vtkOpenGLFramebufferObject::AddColorAttachment ( unsigned int  attId,
vtkTextureObject tex,
unsigned int  zslice = 0,
unsigned int  format = 0,
unsigned int  mipmapLevel = 0 
)

Directly assign/remove a texture to color attachments.

◆ AddColorAttachment() [2/2]

void vtkOpenGLFramebufferObject::AddColorAttachment ( unsigned int  attId,
vtkRenderbuffer tex 
)

◆ RemoveColorAttachment()

void vtkOpenGLFramebufferObject::RemoveColorAttachment ( unsigned int  index)

◆ RemoveColorAttachments()

void vtkOpenGLFramebufferObject::RemoveColorAttachments ( unsigned int  num)

◆ GetNumberOfColorAttachments()

int vtkOpenGLFramebufferObject::GetNumberOfColorAttachments ( )

Return the number of color attachments for the given mode.

◆ AddDepthAttachment() [1/3]

void vtkOpenGLFramebufferObject::AddDepthAttachment ( )

Directly assign/remove a texture/renderbuffer to depth attachments.

◆ AddDepthAttachment() [2/3]

void vtkOpenGLFramebufferObject::AddDepthAttachment ( vtkTextureObject tex)

◆ AddDepthAttachment() [3/3]

void vtkOpenGLFramebufferObject::AddDepthAttachment ( vtkRenderbuffer tex)

◆ RemoveDepthAttachment()

void vtkOpenGLFramebufferObject::RemoveDepthAttachment ( )

◆ PopulateFramebuffer() [1/2]

bool vtkOpenGLFramebufferObject::PopulateFramebuffer ( int  width,
int  height 
)

Convenience method to populate a framebuffer with attachments created as well.

Returns true if a complete valid Framebuffer was created

◆ PopulateFramebuffer() [2/2]

bool vtkOpenGLFramebufferObject::PopulateFramebuffer ( int  width,
int  height,
bool  useTextures,
int  numberOfColorAttachments,
int  colorDataType,
bool  wantDepthAttachment,
int  depthBitplanes,
int  multisamples,
bool  wantStencilAttachment = false 
)

◆ GetMaximumNumberOfActiveTargets()

unsigned int vtkOpenGLFramebufferObject::GetMaximumNumberOfActiveTargets ( )

Returns the maximum number of targets that can be rendered to at one time.

This limits the active targets set by SetActiveTargets(). The return value is valid only if GetContext is non-null.

◆ GetMaximumNumberOfRenderTargets()

unsigned int vtkOpenGLFramebufferObject::GetMaximumNumberOfRenderTargets ( )

Returns the maximum number of render targets available.

This limits the available attachment points for SetColorAttachment(). The return value is valid only if GetContext is non-null.

◆ GetLastSize() [1/3]

int* vtkOpenGLFramebufferObject::GetLastSize ( )
inlineoverridevirtual

Dimensions in pixels of the framebuffer.

Implements vtkFrameBufferObjectBase.

Definition at line 330 of file vtkOpenGLFramebufferObject.h.

◆ GetLastSize() [2/3]

void vtkOpenGLFramebufferObject::GetLastSize ( int &  _arg1,
int &  _arg2 
)
inlineoverridevirtual

Implements vtkFrameBufferObjectBase.

Definition at line 336 of file vtkOpenGLFramebufferObject.h.

◆ GetLastSize() [3/3]

void vtkOpenGLFramebufferObject::GetLastSize ( int  _arg[2])
inlineoverridevirtual

Implements vtkFrameBufferObjectBase.

Definition at line 343 of file vtkOpenGLFramebufferObject.h.

◆ IsSupported()

static bool vtkOpenGLFramebufferObject::IsSupported ( vtkOpenGLRenderWindow *   )
inlinestatic

Returns if the context supports the required extensions.

Extension will be loaded when the context is set.

Definition at line 350 of file vtkOpenGLFramebufferObject.h.

◆ CheckFrameBufferStatus()

int vtkOpenGLFramebufferObject::CheckFrameBufferStatus ( unsigned int  mode)

Validate the current FBO configuration (attachments, formats, etc) prints detected errors to vtkErrorMacro.

◆ ReleaseGraphicsResources()

virtual void vtkOpenGLFramebufferObject::ReleaseGraphicsResources ( vtkWindow win)
virtual

Deactivate and UnBind.

◆ GetFrameBufferStatus()

static bool vtkOpenGLFramebufferObject::GetFrameBufferStatus ( unsigned int  mode,
const char *&  desc 
)
static

Validate the current FBO configuration (attachments, formats, etc) return false if the FBO is incomplete.

Assigns description a literal containing a description of the status. Low level api.

◆ GetFBOIndex()

virtual unsigned int vtkOpenGLFramebufferObject::GetFBOIndex ( )
virtual

◆ Blit()

static int vtkOpenGLFramebufferObject::Blit ( const int  srcExt[4],
const int  destExt[4],
unsigned int  bits,
unsigned int  mapping 
)
static

Copy from the currently bound READ FBO to the currently bound DRAW FBO.

The method is static so that one doesn't need to ccreate an instance when transferring between attachments in the default FBO.

◆ DownloadColor1()

vtkPixelBufferObject* vtkOpenGLFramebufferObject::DownloadColor1 ( int  extent[4],
int  vtkType,
int  channel 
)

Download data from the read color attachment of the currently bound FBO into the returned PBO.

The PBO must be free'd when you are finished with it. The number of components in the PBO is the same as in the name of the specific download function. When downloading a single color channel, the channel must be identified by index, 1->red, 2->green, 3-> blue.

◆ DownloadColor3()

vtkPixelBufferObject* vtkOpenGLFramebufferObject::DownloadColor3 ( int  extent[4],
int  vtkType 
)

◆ DownloadColor4()

vtkPixelBufferObject* vtkOpenGLFramebufferObject::DownloadColor4 ( int  extent[4],
int  vtkType 
)

◆ DownloadDepth()

vtkPixelBufferObject* vtkOpenGLFramebufferObject::DownloadDepth ( int  extent[4],
int  vtkType 
)

Download data from the depth attachment of the currently bound FBO.

The returned PBO must be Delete'd by the caller. The returned PBO has one component.

◆ Download() [1/2]

vtkPixelBufferObject* vtkOpenGLFramebufferObject::Download ( int  extent[4],
int  vtkType,
int  nComps,
int  oglType,
int  oglFormat 
)

Download data from the read buffer of the current FBO.

These are low level meothds. In the static variant a PBO must be passed in since we don't have access to a context. The static method is provided so that one may download from the default FBO.

◆ Download() [2/2]

static void vtkOpenGLFramebufferObject::Download ( int  extent[4],
int  vtkType,
int  nComps,
int  oglType,
int  oglFormat,
vtkPixelBufferObject pbo 
)
static

◆ GetDrawMode()

static unsigned int vtkOpenGLFramebufferObject::GetDrawMode ( )
static

◆ GetReadMode()

static unsigned int vtkOpenGLFramebufferObject::GetReadMode ( )
static

◆ GetBothMode()

static unsigned int vtkOpenGLFramebufferObject::GetBothMode ( )
static

◆ Resize()

void vtkOpenGLFramebufferObject::Resize ( int  width,
int  height 
)

Resize all FO attachments.

◆ AttachColorBuffer()

void vtkOpenGLFramebufferObject::AttachColorBuffer ( unsigned int  index)
protected

Attach a specific buffer.

◆ AttachDepthBuffer()

void vtkOpenGLFramebufferObject::AttachDepthBuffer ( )
protected

◆ LoadRequiredExtensions()

static bool vtkOpenGLFramebufferObject::LoadRequiredExtensions ( vtkOpenGLRenderWindow )
inlinestaticprotected

Load all necessary extensions.

Definition at line 438 of file vtkOpenGLFramebufferObject.h.

◆ CreateFBO()

void vtkOpenGLFramebufferObject::CreateFBO ( )
protected

◆ DestroyFBO()

void vtkOpenGLFramebufferObject::DestroyFBO ( )
protected

◆ DestroyDepthBuffer()

void vtkOpenGLFramebufferObject::DestroyDepthBuffer ( vtkWindow win)
protected

◆ DestroyColorBuffers()

void vtkOpenGLFramebufferObject::DestroyColorBuffers ( vtkWindow win)
protected

◆ ActivateBuffers()

void vtkOpenGLFramebufferObject::ActivateBuffers ( )
protected

◆ UpdateSize()

void vtkOpenGLFramebufferObject::UpdateSize ( )
protected

◆ DisplayFrameBufferAttachments()

void vtkOpenGLFramebufferObject::DisplayFrameBufferAttachments ( )
protected

Display all the attachments of the current framebuffer object.

◆ DisplayFrameBufferAttachment()

void vtkOpenGLFramebufferObject::DisplayFrameBufferAttachment ( unsigned int  uattachment)
protected

Display a given attachment for the current framebuffer object.

◆ DisplayDrawBuffers()

void vtkOpenGLFramebufferObject::DisplayDrawBuffers ( )
protected

Display the draw buffers.

◆ DisplayReadBuffer()

void vtkOpenGLFramebufferObject::DisplayReadBuffer ( )
protected

Display the read buffer.

◆ DisplayBuffer()

void vtkOpenGLFramebufferObject::DisplayBuffer ( int  value)
protected

Display any buffer (convert value into string).

◆ GetOpenGLType()

int vtkOpenGLFramebufferObject::GetOpenGLType ( int  vtkType)
protected

Given a vtk type get a compatible open gl type.

Member Data Documentation

◆ ResourceCallback

vtkGenericOpenGLResourceFreeCallback* vtkOpenGLFramebufferObject::ResourceCallback
protected

Definition at line 440 of file vtkOpenGLFramebufferObject.h.

◆ Context

vtkWeakPointer<vtkOpenGLRenderWindow> vtkOpenGLFramebufferObject::Context
protected

Definition at line 491 of file vtkOpenGLFramebufferObject.h.

◆ FBOIndex

unsigned int vtkOpenGLFramebufferObject::FBOIndex
protected

Definition at line 493 of file vtkOpenGLFramebufferObject.h.

◆ DrawBindingSaved

bool vtkOpenGLFramebufferObject::DrawBindingSaved
protected

Definition at line 495 of file vtkOpenGLFramebufferObject.h.

◆ ReadBindingSaved

bool vtkOpenGLFramebufferObject::ReadBindingSaved
protected

Definition at line 496 of file vtkOpenGLFramebufferObject.h.

◆ DrawBufferSaved

bool vtkOpenGLFramebufferObject::DrawBufferSaved
protected

Definition at line 497 of file vtkOpenGLFramebufferObject.h.

◆ ReadBufferSaved

bool vtkOpenGLFramebufferObject::ReadBufferSaved
protected

Definition at line 498 of file vtkOpenGLFramebufferObject.h.

◆ LastSize

int vtkOpenGLFramebufferObject::LastSize[2]
protected

Definition at line 500 of file vtkOpenGLFramebufferObject.h.

◆ ActiveBuffers

std::vector<unsigned int> vtkOpenGLFramebufferObject::ActiveBuffers
protected

Definition at line 501 of file vtkOpenGLFramebufferObject.h.

◆ ActiveReadBuffer

unsigned int vtkOpenGLFramebufferObject::ActiveReadBuffer
protected

Definition at line 502 of file vtkOpenGLFramebufferObject.h.

◆ DepthBuffer

vtkFOInfo* vtkOpenGLFramebufferObject::DepthBuffer
protected

Definition at line 504 of file vtkOpenGLFramebufferObject.h.

◆ ColorBuffers

std::map<unsigned int, vtkFOInfo*> vtkOpenGLFramebufferObject::ColorBuffers
protected

Definition at line 505 of file vtkOpenGLFramebufferObject.h.


The documentation for this class was generated from the following file:
vtkX3D::height
Definition: vtkX3D.h:260