VTK
|
Internal class which encapsulates OpenGL FramebufferObject. More...
#include <vtkOpenGLFramebufferObject.h>
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... | |
vtkOpenGLFramebufferObject * | NewInstance () const |
void | PrintSelf (ostream &os, vtkIndent indent) override |
Methods invoked by print to print information about the object including superclasses. More... | |
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 | InitializeViewport (int width, int height) |
Set up ortho viewport with scissor, lighting, blend, and depth disabled. More... | |
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... | |
int | GetNumberOfColorAttachments (unsigned int mode) |
Return the number of color attachments for the given mode. More... | |
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 | 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... | |
vtkPixelBufferObject * | DownloadColor1 (int extent[4], int vtkType, int channel) |
Download data from the read color attachment of the currently bound FBO into the returned PBO. More... | |
vtkPixelBufferObject * | DownloadColor3 (int extent[4], int vtkType) |
vtkPixelBufferObject * | DownloadColor4 (int extent[4], int vtkType) |
vtkPixelBufferObject * | DownloadDepth (int extent[4], int vtkType) |
Download data from the depth attachment of the currently bound FBO. More... | |
vtkPixelBufferObject * | Download (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... | |
void | RemoveTexColorAttachments (unsigned int mode, unsigned int num) |
void | RemoveTexColorAttachment (unsigned int mode, unsigned int attId) |
void | RemoveRenDepthAttachment (unsigned int mode) |
void | RemoveTexDepthAttachment (unsigned int mode) |
void | SetContext (vtkRenderWindow *context) |
Get/Set the context. More... | |
vtkOpenGLRenderWindow * | GetContext () |
Get/Set the context. More... | |
void | SaveCurrentBindings () |
Store/Restore the current framebuffer bindings and buffers. More... | |
void | SaveCurrentBindings (unsigned int mode) |
Store/Restore the current framebuffer bindings and buffers. More... | |
void | SaveCurrentBindingsAndBuffers () |
Store/Restore the current framebuffer bindings and buffers. More... | |
void | SaveCurrentBindingsAndBuffers (unsigned int mode) |
Store/Restore the current framebuffer bindings and buffers. More... | |
void | RestorePreviousBindings () |
Store/Restore the current framebuffer bindings and buffers. More... | |
void | RestorePreviousBindings (unsigned int mode) |
Store/Restore the current framebuffer bindings and buffers. More... | |
void | RestorePreviousBindingsAndBuffers () |
Store/Restore the current framebuffer bindings and buffers. More... | |
void | RestorePreviousBindingsAndBuffers (unsigned int mode) |
Store/Restore the current framebuffer bindings and buffers. More... | |
void | SaveCurrentBuffers () |
Store the current draw and read buffers. More... | |
void | SaveCurrentBuffers (unsigned int mode) |
Store the current draw and read buffers. More... | |
void | RestorePreviousBuffers () |
Store the current draw and read buffers. More... | |
void | RestorePreviousBuffers (unsigned int mode) |
Store the current draw and read buffers. More... | |
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) |
User must take care that width/height match the dimensions of the user defined texture attachments. 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 () |
void | AddColorAttachment (unsigned int mode, 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 mode, unsigned int attId, vtkRenderbuffer *tex) |
Directly assign/remove a texture to color attachments. More... | |
void | RemoveColorAttachment (unsigned int mode, unsigned int index) |
Directly assign/remove a texture to color attachments. More... | |
void | RemoveColorAttachments (unsigned int mode, unsigned int num) |
Directly assign/remove a texture to color attachments. More... | |
void | AddDepthAttachment () |
Directly assign/remove a texture/renderbuffer to depth attachments. More... | |
void | AddDepthAttachment (unsigned int mode) |
Directly assign/remove a texture/renderbuffer to depth attachments. More... | |
void | AddDepthAttachment (unsigned int mode, vtkTextureObject *tex) |
Directly assign/remove a texture/renderbuffer to depth attachments. More... | |
void | AddDepthAttachment (unsigned int mode, vtkRenderbuffer *tex) |
Directly assign/remove a texture/renderbuffer to depth attachments. More... | |
void | RemoveDepthAttachment (unsigned int mode) |
Directly assign/remove a texture/renderbuffer to depth attachments. More... | |
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) |
Convenience method to populate a framebuffer with attachments created as well. More... | |
int * | GetLastSize () override |
Dimensions in pixels of the framebuffer. More... | |
void | GetLastSize (int &_arg1, int &_arg2) override |
Dimensions in pixels of the framebuffer. More... | |
void | GetLastSize (int _arg[2]) override |
Dimensions in pixels of the framebuffer. More... | |
Public Member Functions inherited from vtkFrameBufferObjectBase | |
vtkFrameBufferObjectBase * | NewInstance () 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... | |
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) |
int | InvokeEvent (unsigned long event) |
int | InvokeEvent (const char *event) |
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) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. More... | |
vtkCommand * | GetCommand (unsigned long tag) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. More... | |
void | RemoveObserver (vtkCommand *) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. More... | |
void | RemoveObservers (unsigned long event, vtkCommand *) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. More... | |
void | RemoveObservers (const char *event, vtkCommand *) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. More... | |
vtkTypeBool | HasObserver (unsigned long event, vtkCommand *) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. More... | |
vtkTypeBool | HasObserver (const char *event, vtkCommand *) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. More... | |
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) |
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, 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) |
This method invokes an event and return whether the event was aborted or not. More... | |
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 | 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... | |
virtual void | PrintHeader (ostream &os, vtkIndent indent) |
Methods invoked by print to print information about the object including superclasses. More... | |
virtual void | PrintTrailer (ostream &os, vtkIndent indent) |
Methods invoked by print to print information about the object including superclasses. More... | |
Static Public Member Functions | |
static vtkOpenGLFramebufferObject * | New () |
static vtkTypeBool | IsTypeOf (const char *type) |
static vtkOpenGLFramebufferObject * | SafeDownCast (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 vtkFrameBufferObjectBase * | SafeDownCast (vtkObjectBase *o) |
Static Public Member Functions inherited from vtkObject | |
static vtkObject * | New () |
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 () |
This is a global flag that controls whether any debug, warning or error messages are displayed. More... | |
static void | GlobalWarningDisplayOff () |
This is a global flag that controls whether any debug, warning or error messages are displayed. More... | |
static int | GetGlobalWarningDisplay () |
This is a global flag that controls whether any debug, warning or error messages are displayed. More... | |
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 vtkObjectBase * | New () |
Create an object with Debug turned off, modified time initialized to zero, and reference counting on. More... | |
Protected Member Functions | |
virtual vtkObjectBase * | NewInstanceInternal () const |
void | SetColorBuffer (unsigned int mode, unsigned int index, vtkTextureObject *texture, unsigned int zslice=0, unsigned int format=0, unsigned int mipmapLevel=0) |
void | SetColorBuffer (unsigned int mode, unsigned int index, vtkRenderbuffer *rb) |
void | SetDepthBuffer (unsigned int mode, vtkTextureObject *depthTexture) |
void | SetDepthBuffer (unsigned int mode, vtkRenderbuffer *depthBuffer) |
void | Attach () |
Attach all buffers to the FO if not already done so. More... | |
void | AttachColorBuffer (unsigned int mode, unsigned int index) |
Attach a specific buffer. More... | |
void | AttachDepthBuffer (unsigned int mode) |
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 () |
These methods allow a command to exclusively grab all events. More... | |
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 | |
vtkGenericOpenGLResourceFreeCallback * | ResourceCallback |
vtkWeakPointer< vtkOpenGLRenderWindow > | Context |
unsigned int | FBOIndex |
unsigned int | PreviousDrawFBO |
unsigned int | PreviousReadFBO |
bool | DrawBindingSaved |
bool | ReadBindingSaved |
unsigned int | PreviousDrawBuffer |
unsigned int | PreviousReadBuffer |
bool | DrawBufferSaved |
bool | ReadBufferSaved |
int | LastSize [2] |
std::vector< unsigned int > | ActiveBuffers |
vtkFOInfo * | DrawDepthBuffer |
vtkFOInfo * | ReadDepthBuffer |
std::map< unsigned int, vtkFOInfo * > | DrawColorBuffers |
std::map< unsigned int, vtkFOInfo * > | ReadColorBuffers |
Protected Attributes inherited from vtkObject | |
bool | Debug |
vtkTimeStamp | MTime |
vtkSubjectHelper * | SubjectHelper |
Protected Attributes inherited from vtkObjectBase | |
vtkAtomicInt32 | ReferenceCount |
vtkWeakPointerBase ** | WeakPointers |
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. Likewise a single buffer can be activated for both draw and read operations. 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
If you wish to use a texture you created
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:
If you with to only bind/attach the draw buffers or read buffers there are mode specific versions of most 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().
This class should be named vtkOpenGLFramebufferObject (FO) Note the capitalization of FramebufferObject
Definition at line 182 of file vtkOpenGLFramebufferObject.h.
Definition at line 186 of file vtkOpenGLFramebufferObject.h.
|
protected |
|
overrideprotected |
|
static |
|
static |
|
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.
|
static |
|
protectedvirtual |
Reimplemented from vtkFrameBufferObjectBase.
vtkOpenGLFramebufferObject* vtkOpenGLFramebufferObject::NewInstance | ( | ) | const |
|
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.
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.
vtkOpenGLRenderWindow* vtkOpenGLFramebufferObject::GetContext | ( | ) |
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.
void vtkOpenGLFramebufferObject::Bind | ( | ) |
Make the draw frame buffer active.
void vtkOpenGLFramebufferObject::Bind | ( | unsigned int | mode | ) |
void vtkOpenGLFramebufferObject::UnBind | ( | ) |
Unbind this buffer.
void vtkOpenGLFramebufferObject::UnBind | ( | unsigned int | mode | ) |
void vtkOpenGLFramebufferObject::SaveCurrentBindings | ( | ) |
Store/Restore the current framebuffer bindings and buffers.
void vtkOpenGLFramebufferObject::SaveCurrentBindings | ( | unsigned int | mode | ) |
Store/Restore the current framebuffer bindings and buffers.
|
inline |
Store/Restore the current framebuffer bindings and buffers.
Definition at line 219 of file vtkOpenGLFramebufferObject.h.
|
inline |
Store/Restore the current framebuffer bindings and buffers.
Definition at line 223 of file vtkOpenGLFramebufferObject.h.
void vtkOpenGLFramebufferObject::RestorePreviousBindings | ( | ) |
Store/Restore the current framebuffer bindings and buffers.
void vtkOpenGLFramebufferObject::RestorePreviousBindings | ( | unsigned int | mode | ) |
Store/Restore the current framebuffer bindings and buffers.
|
inline |
Store/Restore the current framebuffer bindings and buffers.
Definition at line 229 of file vtkOpenGLFramebufferObject.h.
|
inline |
Store/Restore the current framebuffer bindings and buffers.
Definition at line 233 of file vtkOpenGLFramebufferObject.h.
void vtkOpenGLFramebufferObject::SaveCurrentBuffers | ( | ) |
Store the current draw and read buffers.
When restored only the buffers matching mode are modified. GetDrawMode() -> glDrawBuffer GetReadMode() -> glReadBuffer GetBothMode() -> both
void vtkOpenGLFramebufferObject::SaveCurrentBuffers | ( | unsigned int | mode | ) |
Store the current draw and read buffers.
When restored only the buffers matching mode are modified. GetDrawMode() -> glDrawBuffer GetReadMode() -> glReadBuffer GetBothMode() -> both
void vtkOpenGLFramebufferObject::RestorePreviousBuffers | ( | ) |
Store the current draw and read buffers.
When restored only the buffers matching mode are modified. GetDrawMode() -> glDrawBuffer GetReadMode() -> glReadBuffer GetBothMode() -> both
void vtkOpenGLFramebufferObject::RestorePreviousBuffers | ( | unsigned int | mode | ) |
Store the current draw and read buffers.
When restored only the buffers matching mode are modified. GetDrawMode() -> glDrawBuffer GetReadMode() -> glReadBuffer GetBothMode() -> both
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.
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.
Set up ortho viewport with scissor, lighting, blend, and depth disabled.
The method affects the current bound FBO.
void vtkOpenGLFramebufferObject::ActivateDrawBuffers | ( | unsigned int | n | ) |
void vtkOpenGLFramebufferObject::ActivateDrawBuffer | ( | unsigned int | id | ) |
void vtkOpenGLFramebufferObject::ActivateReadBuffer | ( | unsigned int | id | ) |
|
inline |
Definition at line 279 of file vtkOpenGLFramebufferObject.h.
void vtkOpenGLFramebufferObject::DeactivateDrawBuffers | ( | ) |
void vtkOpenGLFramebufferObject::DeactivateReadBuffer | ( | ) |
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.
void vtkOpenGLFramebufferObject::AddColorAttachment | ( | unsigned int | mode, |
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.
Same as the Set methods but also does an attach call so the FO has to be bound when called.
void vtkOpenGLFramebufferObject::AddColorAttachment | ( | unsigned int | mode, |
unsigned int | attId, | ||
vtkRenderbuffer * | tex | ||
) |
Directly assign/remove a texture to color attachments.
Same as the Set methods but also does an attach call so the FO has to be bound when called.
Directly assign/remove a texture to color attachments.
Same as the Set methods but also does an attach call so the FO has to be bound when called.
Directly assign/remove a texture to color attachments.
Same as the Set methods but also does an attach call so the FO has to be bound when called.
Return the number of color attachments for the given mode.
|
inline |
Directly assign/remove a texture/renderbuffer to depth attachments.
Definition at line 329 of file vtkOpenGLFramebufferObject.h.
void vtkOpenGLFramebufferObject::AddDepthAttachment | ( | unsigned int | mode | ) |
Directly assign/remove a texture/renderbuffer to depth attachments.
void vtkOpenGLFramebufferObject::AddDepthAttachment | ( | unsigned int | mode, |
vtkTextureObject * | tex | ||
) |
Directly assign/remove a texture/renderbuffer to depth attachments.
void vtkOpenGLFramebufferObject::AddDepthAttachment | ( | unsigned int | mode, |
vtkRenderbuffer * | tex | ||
) |
Directly assign/remove a texture/renderbuffer to depth attachments.
void vtkOpenGLFramebufferObject::RemoveDepthAttachment | ( | unsigned int | mode | ) |
Directly assign/remove a texture/renderbuffer to depth attachments.
Convenience method to populate a framebuffer with attachments created as well.
Returns true if a complete valid Framebuffer was created
bool vtkOpenGLFramebufferObject::PopulateFramebuffer | ( | int | width, |
int | height, | ||
bool | useTextures, | ||
int | numberOfColorAttachments, | ||
int | colorDataType, | ||
bool | wantDepthAttachment, | ||
int | depthBitplanes, | ||
int | multisamples | ||
) |
Convenience method to populate a framebuffer with attachments created as well.
Returns true if a complete valid Framebuffer was created
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.
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.
|
inlineoverridevirtual |
Dimensions in pixels of the framebuffer.
Implements vtkFrameBufferObjectBase.
Definition at line 373 of file vtkOpenGLFramebufferObject.h.
Dimensions in pixels of the framebuffer.
Implements vtkFrameBufferObjectBase.
Definition at line 378 of file vtkOpenGLFramebufferObject.h.
|
inlineoverridevirtual |
Dimensions in pixels of the framebuffer.
Implements vtkFrameBufferObjectBase.
Definition at line 384 of file vtkOpenGLFramebufferObject.h.
|
inlinestatic |
Returns if the context supports the required extensions.
Extension will be loaded when the context is set.
Definition at line 394 of file vtkOpenGLFramebufferObject.h.
Validate the current FBO configuration (attachments, formats, etc) prints detected errors to vtkErrorMacro.
|
virtual |
Deactivate and UnBind.
|
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.
|
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.
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.
vtkPixelBufferObject* vtkOpenGLFramebufferObject::DownloadColor3 | ( | int | extent[4], |
int | vtkType | ||
) |
vtkPixelBufferObject* vtkOpenGLFramebufferObject::DownloadColor4 | ( | int | extent[4], |
int | vtkType | ||
) |
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.
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.
|
static |
|
static |
|
static |
|
static |
|
inline |
Definition at line 494 of file vtkOpenGLFramebufferObject.h.
|
inline |
Definition at line 496 of file vtkOpenGLFramebufferObject.h.
|
inline |
Definition at line 498 of file vtkOpenGLFramebufferObject.h.
|
inline |
Definition at line 500 of file vtkOpenGLFramebufferObject.h.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Attach all buffers to the FO if not already done so.
|
protected |
Attach a specific buffer.
|
protected |
|
inlinestaticprotected |
Load all necessary extensions.
Definition at line 527 of file vtkOpenGLFramebufferObject.h.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Display all the attachments of the current framebuffer object.
|
protected |
Display a given attachment for the current framebuffer object.
|
protected |
Display the draw buffers.
|
protected |
Display the read buffer.
|
protected |
Display any buffer (convert value into string).
Given a vtk type get a compatible open gl type.
|
protected |
Definition at line 528 of file vtkOpenGLFramebufferObject.h.
|
protected |
Definition at line 581 of file vtkOpenGLFramebufferObject.h.
|
protected |
Definition at line 583 of file vtkOpenGLFramebufferObject.h.
|
protected |
Definition at line 585 of file vtkOpenGLFramebufferObject.h.
|
protected |
Definition at line 586 of file vtkOpenGLFramebufferObject.h.
|
protected |
Definition at line 587 of file vtkOpenGLFramebufferObject.h.
|
protected |
Definition at line 588 of file vtkOpenGLFramebufferObject.h.
|
protected |
Definition at line 589 of file vtkOpenGLFramebufferObject.h.
|
protected |
Definition at line 590 of file vtkOpenGLFramebufferObject.h.
|
protected |
Definition at line 591 of file vtkOpenGLFramebufferObject.h.
|
protected |
Definition at line 592 of file vtkOpenGLFramebufferObject.h.
|
protected |
Definition at line 594 of file vtkOpenGLFramebufferObject.h.
|
protected |
Definition at line 595 of file vtkOpenGLFramebufferObject.h.
|
protected |
Definition at line 597 of file vtkOpenGLFramebufferObject.h.
|
protected |
Definition at line 598 of file vtkOpenGLFramebufferObject.h.
|
protected |
Definition at line 599 of file vtkOpenGLFramebufferObject.h.
|
protected |
Definition at line 600 of file vtkOpenGLFramebufferObject.h.