VTK
|
internal class which encapsulates OpenGL frame buffer object. Not to be used directly. More...
#include <vtkFrameBufferObject.h>
Public Types | |
typedef vtkObject | Superclass |
typedef vtkObject | Superclass |
Public Types inherited from vtkObject | |
typedef vtkObjectBase | Superclass |
Public Member Functions | |
virtual int | IsA (const char *type) |
vtkFrameBufferObject * | NewInstance () const |
void | PrintSelf (ostream &os, vtkIndent indent) |
void | RenderQuad (int minX, int maxX, int minY, int maxY) |
void | Bind () |
void | UnBind () |
void | SetActiveBuffers (int numbuffers, unsigned int indices[]) |
vtkTextureObject * | GetColorBuffer (unsigned int index) |
void | RemoveColorBuffer (unsigned int index) |
void | RemoveAllColorBuffers () |
unsigned int | GetMaximumNumberOfActiveTargets () |
unsigned int | GetMaximumNumberOfRenderTargets () |
int | CheckFrameBufferStatus (unsigned int mode) |
virtual int | IsA (const char *type) |
vtkFrameBufferObject * | NewInstance () const |
void | PrintSelf (ostream &os, vtkIndent indent) |
void | Bind () |
void | UnBind () |
void | SetActiveBuffers (int numbuffers, unsigned int indices[]) |
vtkTextureObject * | GetColorBuffer (unsigned int index) |
void | RemoveColorBuffer (unsigned int index) |
void | RemoveAllColorBuffers () |
unsigned int | GetMaximumNumberOfActiveTargets () |
unsigned int | GetMaximumNumberOfRenderTargets () |
int | CheckFrameBufferStatus (unsigned int mode) |
void | SetContext (vtkRenderWindow *context) |
vtkRenderWindow * | GetContext () |
bool | Start (int width, int height, bool shaderSupportsTextureInt) |
bool | StartNonOrtho (int width, int height, bool shaderSupportsTextureInt) |
void | SetActiveBuffer (unsigned int index) |
void | SetColorBuffer (unsigned int index, vtkTextureObject *texture, unsigned int zslice=0) |
void | SetDepthBuffer (vtkTextureObject *depthTexture) |
void | RemoveDepthBuffer () |
virtual void | SetDepthBufferNeeded (bool) |
virtual bool | GetDepthBufferNeeded () |
void | SetNumberOfRenderTargets (unsigned int) |
virtual unsigned int | GetNumberOfRenderTargets () |
virtual int * | GetLastSize () |
virtual void | GetLastSize (int &, int &) |
virtual void | GetLastSize (int[2]) |
void | SetContext (vtkOpenGLRenderWindow *context) |
vtkOpenGLRenderWindow * | GetContext () |
bool | Start (int width, int height, bool shaderSupportsTextureInt) |
bool | StartNonOrtho (int width, int height, bool shaderSupportsTextureInt) |
void | RenderQuad (int minX, int maxX, int minY, int maxY, vtkShaderProgram *program, vtkOpenGLVertexArrayObject *vao) |
void | SetActiveBuffer (unsigned int index) |
void | SetColorBuffer (unsigned int index, vtkTextureObject *texture, unsigned int zslice=0) |
void | SetDepthBuffer (vtkTextureObject *depthTexture) |
void | RemoveDepthBuffer () |
virtual void | SetDepthBufferNeeded (bool) |
virtual bool | GetDepthBufferNeeded () |
void | SetNumberOfRenderTargets (unsigned int) |
virtual unsigned int | GetNumberOfRenderTargets () |
virtual int * | GetLastSize () |
virtual void | GetLastSize (int &, int &) |
virtual void | GetLastSize (int[2]) |
Public Member Functions inherited from vtkObject | |
vtkObject * | NewInstance () const |
virtual void | DebugOn () |
virtual void | DebugOff () |
bool | GetDebug () |
void | SetDebug (bool debugFlag) |
virtual void | Modified () |
virtual unsigned long | GetMTime () |
unsigned long | AddObserver (unsigned long event, vtkCommand *, float priority=0.0f) |
unsigned long | AddObserver (const char *event, vtkCommand *, float priority=0.0f) |
vtkCommand * | GetCommand (unsigned long tag) |
void | RemoveObserver (vtkCommand *) |
void | RemoveObservers (unsigned long event, vtkCommand *) |
void | RemoveObservers (const char *event, vtkCommand *) |
int | HasObserver (unsigned long event, vtkCommand *) |
int | HasObserver (const char *event, vtkCommand *) |
void | RemoveObserver (unsigned long tag) |
void | RemoveObservers (unsigned long event) |
void | RemoveObservers (const char *event) |
void | RemoveAllObservers () |
int | HasObserver (unsigned long event) |
int | HasObserver (const char *event) |
template<class U , class T > | |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f) |
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) |
int | InvokeEvent (unsigned long event, void *callData) |
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 |
virtual void | Delete () |
virtual void | FastDelete () |
void | Print (ostream &os) |
virtual void | Register (vtkObjectBase *o) |
virtual void | UnRegister (vtkObjectBase *o) |
void | SetReferenceCount (int) |
void | PrintRevisions (ostream &) |
virtual void | PrintHeader (ostream &os, vtkIndent indent) |
virtual void | PrintTrailer (ostream &os, vtkIndent indent) |
int | GetReferenceCount () |
Static Public Member Functions | |
static vtkFrameBufferObject * | New () |
static int | IsTypeOf (const char *type) |
static vtkFrameBufferObject * | SafeDownCast (vtkObjectBase *o) |
static bool | IsSupported (vtkRenderWindow *renWin) |
static vtkFrameBufferObject * | New () |
static int | IsTypeOf (const char *type) |
static vtkFrameBufferObject * | SafeDownCast (vtkObjectBase *o) |
static bool | IsSupported (vtkOpenGLRenderWindow *renWin) |
Static Public Member Functions inherited from vtkObject | |
static int | IsTypeOf (const char *type) |
static vtkObject * | SafeDownCast (vtkObjectBase *o) |
static vtkObject * | New () |
static void | BreakOnError () |
static void | SetGlobalWarningDisplay (int val) |
static void | GlobalWarningDisplayOn () |
static void | GlobalWarningDisplayOff () |
static int | GetGlobalWarningDisplay () |
Static Public Member Functions inherited from vtkObjectBase | |
static int | IsTypeOf (const char *name) |
static vtkObjectBase * | New () |
Static Protected Member Functions | |
static bool | LoadRequiredExtensions (vtkRenderWindow *renWin) |
static bool | LoadRequiredExtensions (vtkOpenGLRenderWindow *renWin) |
Protected Attributes | |
vtkWeakPointer< vtkRenderWindow > | Context |
bool | DepthBufferNeeded |
bool | ColorBuffersDirty |
unsigned int | FBOIndex |
int | PreviousFBOIndex |
unsigned int | DepthBuffer |
unsigned int | NumberOfRenderTargets |
int | LastSize [2] |
std::vector< unsigned int > | UserZSlices |
std::vector< vtkSmartPointer< vtkTextureObject > > | UserColorBuffers |
std::vector< vtkSmartPointer< vtkTextureObject > > | ColorBuffers |
std::vector< unsigned int > | ActiveBuffers |
vtkSmartPointer< vtkTextureObject > | UserDepthBuffer |
bool | DepthBufferDirty |
vtkWeakPointer< vtkOpenGLRenderWindow > | Context |
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 frame buffer object. Not to be used directly.
Encapsulates an OpenGL Frame Buffer Object. For use by vtkOpenGLFBORenderWindow, not to be used directly. Use vtkFrameBufferObject2 instead.
Definition at line 46 of file vtkFrameBufferObject.h.
Definition at line 50 of file vtkFrameBufferObject.h.
Definition at line 49 of file vtkFrameBufferObject.h.
|
protected |
|
protected |
|
protected |
|
protected |
|
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 vtkObject.
|
static |
|
protectedvirtual |
Reimplemented from vtkObject.
vtkFrameBufferObject* vtkFrameBufferObject::NewInstance | ( | ) | const |
|
virtual |
void vtkFrameBufferObject::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.
vtkRenderWindow* vtkFrameBufferObject::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.
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.
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 vtkFrameBufferObject::Bind | ( | ) |
Make the draw frame buffer active (uses FRAMEBUFFER).
void vtkFrameBufferObject::UnBind | ( | ) |
Restore the previous draw framebuffer if saved, else bind the default buffer.
|
inline |
Choose the buffers to render into.
Definition at line 89 of file vtkFrameBufferObject.h.
User provided color buffers are attached by index to color buffers. This command lets you select which attachments are written to. See set color buffer. This call overwrites what the previous list of active buffers.
void vtkFrameBufferObject::SetColorBuffer | ( | unsigned int | index, |
vtkTextureObject * | texture, | ||
unsigned int | zslice = 0 |
||
) |
Insert a color buffer into the list of available color buffers. 0 to NumberOfRenderTargets of these are attached to color attachments by index. See SetActiveBuffers to select them for writing. All user specified texture objects must match the FBO dimensions and must have been created by the time Start() gets called. If texture is a 3D texture, zslice identifies the zslice that will be attached to the color buffer. .SECTION Caveat Currently, 1D textures are not supported.
vtkTextureObject* vtkFrameBufferObject::GetColorBuffer | ( | unsigned int | index | ) |
void vtkFrameBufferObject::RemoveColorBuffer | ( | unsigned int | index | ) |
void vtkFrameBufferObject::RemoveAllColorBuffers | ( | ) |
void vtkFrameBufferObject::SetDepthBuffer | ( | vtkTextureObject * | depthTexture | ) |
Set the texture to use as depth buffer.
void vtkFrameBufferObject::RemoveDepthBuffer | ( | ) |
Set the texture to use as depth buffer.
|
virtual |
If true, the frame buffer object will be initialized with a depth buffer. Initial value is true.
|
virtual |
If true, the frame buffer object will be initialized with a depth buffer. Initial value is true.
void vtkFrameBufferObject::SetNumberOfRenderTargets | ( | unsigned | int | ) |
Set/Get the number of render targets to render into at once. Textures (user supplied or generated internally) are attached to color attachment 0 to NumberOfRenderTargets. You can use SetActiveBuffer to specify which of these are actually written to. If zero then all of the user provided color buffers are used.
|
virtual |
Set/Get the number of render targets to render into at once. Textures (user supplied or generated internally) are attached to color attachment 0 to NumberOfRenderTargets. You can use SetActiveBuffer to specify which of these are actually written to. If zero then all of the user provided color buffers are used.
unsigned int vtkFrameBufferObject::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 vtkFrameBufferObject::GetMaximumNumberOfRenderTargets | ( | ) |
Returns the maximum number of render targets available. This limits the available attachement points for SetColorAttachment(). The return value is valid only if GetContext is non-null.
|
virtual |
Dimensions in pixels of the framebuffer.
Dimensions in pixels of the framebuffer.
|
virtual |
Dimensions in pixels of the framebuffer.
|
static |
Returns if the context supports the required extensions. Extension will be loaded when the conetxt is set.
Validate the current FBO configuration (attachments, formats, etc) prints detected errors to vtkErrorMacro.
|
staticprotected |
Load all necessary extensions.
|
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).
|
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 vtkObject.
|
static |
|
protectedvirtual |
Reimplemented from vtkObject.
vtkFrameBufferObject* vtkFrameBufferObject::NewInstance | ( | ) | const |
|
virtual |
void vtkFrameBufferObject::SetContext | ( | vtkOpenGLRenderWindow * | 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* vtkFrameBufferObject::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.
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.
void vtkFrameBufferObject::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 vtkFrameBufferObject::Bind | ( | ) |
Make the draw frame buffer active (uses FRAMEBUFFER).
void vtkFrameBufferObject::UnBind | ( | ) |
Restore the previous draw framebuffer if saved, else bind the default buffer.
|
inline |
Choose the buffers to render into.
Definition at line 91 of file vtkFrameBufferObject.h.
User provided color buffers are attached by index to color buffers. This command lets you select which attachments are written to. See set color buffer. This call overwrites what the previous list of active buffers.
void vtkFrameBufferObject::SetColorBuffer | ( | unsigned int | index, |
vtkTextureObject * | texture, | ||
unsigned int | zslice = 0 |
||
) |
Insert a color buffer into the list of available color buffers. 0 to NumberOfRenderTargets of these are attached to color attachments by index. See SetActiveBuffers to select them for writing. All user specified texture objects must match the FBO dimensions and must have been created by the time Start() gets called. If texture is a 3D texture, zslice identifies the zslice that will be attached to the color buffer. .SECTION Caveat Currently, 1D textures are not supported.
vtkTextureObject* vtkFrameBufferObject::GetColorBuffer | ( | unsigned int | index | ) |
void vtkFrameBufferObject::RemoveColorBuffer | ( | unsigned int | index | ) |
void vtkFrameBufferObject::RemoveAllColorBuffers | ( | ) |
void vtkFrameBufferObject::SetDepthBuffer | ( | vtkTextureObject * | depthTexture | ) |
Set the texture to use as depth buffer.
void vtkFrameBufferObject::RemoveDepthBuffer | ( | ) |
Set the texture to use as depth buffer.
|
virtual |
If true, the frame buffer object will be initialized with a depth buffer. Initial value is true.
|
virtual |
If true, the frame buffer object will be initialized with a depth buffer. Initial value is true.
void vtkFrameBufferObject::SetNumberOfRenderTargets | ( | unsigned | int | ) |
Set/Get the number of render targets to render into at once. Textures (user supplied or generated internally) are attached to color attachment 0 to NumberOfRenderTargets. You can use SetActiveBuffer to specify which of these are actually written to. If zero then all of the user provided color buffers are used.
|
virtual |
Set/Get the number of render targets to render into at once. Textures (user supplied or generated internally) are attached to color attachment 0 to NumberOfRenderTargets. You can use SetActiveBuffer to specify which of these are actually written to. If zero then all of the user provided color buffers are used.
unsigned int vtkFrameBufferObject::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 vtkFrameBufferObject::GetMaximumNumberOfRenderTargets | ( | ) |
Returns the maximum number of render targets available. This limits the available attachement points for SetColorAttachment(). The return value is valid only if GetContext is non-null.
|
virtual |
Dimensions in pixels of the framebuffer.
Dimensions in pixels of the framebuffer.
|
virtual |
Dimensions in pixels of the framebuffer.
|
static |
Returns if the context supports the required extensions. Extension will be loaded when the conetxt is set.
Validate the current FBO configuration (attachments, formats, etc) prints detected errors to vtkErrorMacro.
|
staticprotected |
Load all necessary extensions.
|
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).
|
protected |
Definition at line 220 of file vtkFrameBufferObject.h.
|
protected |
Definition at line 222 of file vtkFrameBufferObject.h.
|
protected |
Definition at line 223 of file vtkFrameBufferObject.h.
|
protected |
Definition at line 224 of file vtkFrameBufferObject.h.
|
protected |
Definition at line 225 of file vtkFrameBufferObject.h.
|
protected |
Definition at line 226 of file vtkFrameBufferObject.h.
|
protected |
Definition at line 227 of file vtkFrameBufferObject.h.
|
protected |
Definition at line 228 of file vtkFrameBufferObject.h.
|
protected |
Definition at line 229 of file vtkFrameBufferObject.h.
|
protected |
Definition at line 230 of file vtkFrameBufferObject.h.
|
protected |
Definition at line 231 of file vtkFrameBufferObject.h.
|
protected |
Definition at line 232 of file vtkFrameBufferObject.h.
|
protected |
Definition at line 233 of file vtkFrameBufferObject.h.
|
protected |
Definition at line 234 of file vtkFrameBufferObject.h.
|
protected |
Definition at line 221 of file vtkFrameBufferObject.h.