29#ifndef vtkFrameBufferObject_h
30#define vtkFrameBufferObject_h
33#include "vtkRenderingOpenGL2Module.h"
77 bool Start(
int width,
int height,
bool shaderSupportsTextureInt);
110 this->SetActiveBuffers(1, &
index);
136 unsigned int zslice=0);
156 vtkGetMacro(DepthBufferNeeded,
bool);
168 vtkGetMacro(NumberOfRenderTargets,
unsigned int);
189 vtkGetVector2Macro(LastSize,
int);
237 bool shaderSupportsTextureInt);
276 bool DepthBufferNeeded;
277 bool ColorBuffersDirty;
278 unsigned int FBOIndex;
279 int PreviousFBOIndex;
280 unsigned int DepthBuffer;
281 unsigned int NumberOfRenderTargets;
283 std::vector<unsigned int> UserZSlices;
284 std::vector<vtkSmartPointer<vtkTextureObject> > UserColorBuffers;
285 std::vector<vtkSmartPointer<vtkTextureObject> > ColorBuffers;
286 std::vector<unsigned int> ActiveBuffers;
288 bool DepthBufferDirty;
abstract interface to OpenGL FBOs
internal class which encapsulates OpenGL frame buffer object.
bool StartNonOrtho(int width, int height, bool shaderSupportsTextureInt)
unsigned int GetMaximumNumberOfRenderTargets()
Returns the maximum number of render targets available.
virtual void ReleaseGraphicsResources(vtkWindow *win)
Deactivate and UnBind.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
void DisplayFrameBufferAttachments()
Display all the attachments of the current framebuffer object.
void SetColorBuffer(unsigned int index, vtkTextureObject *texture, unsigned int zslice=0)
Insert a color buffer into the list of available color buffers.
bool Start(int width, int height, bool shaderSupportsTextureInt)
User must take care that width/height match the dimensions of the user defined texture attachments.
void SetNumberOfRenderTargets(unsigned int)
Set/Get the number of render targets to render into at once.
void DisplayBuffer(int value)
Display any buffer (convert value into string).
void RemoveColorBuffer(unsigned int index)
static vtkFrameBufferObject * New()
void UnBind()
Restore the previous draw framebuffer if saved, else bind the default buffer.
unsigned int GetMaximumNumberOfActiveTargets()
Returns the maximum number of targets that can be rendered to at one time.
static bool LoadRequiredExtensions(vtkOpenGLRenderWindow *renWin)
Load all necessary extensions.
vtkWeakPointer< vtkOpenGLRenderWindow > Context
void DisplayReadBuffer()
Display the read buffer.
void CreateColorBuffers(int width, int height, unsigned int mode, bool shaderSupportsTextureInt)
void RemoveAllColorBuffers()
void SetActiveBuffer(unsigned int index)
Choose the buffers to render into.
void SetActiveBuffers(int numbuffers, unsigned int indices[])
User provided color buffers are attached by index to color buffers.
void DisplayFrameBufferAttachment(unsigned int uattachment)
Display a given attachment for the current framebuffer object.
int CheckFrameBufferStatus(unsigned int mode)
Validate the current FBO configuration (attachments, formats, etc) prints detected errors to vtkError...
void SetDepthBuffer(vtkTextureObject *depthTexture)
Set the texture to use as depth buffer.
void SetContext(vtkOpenGLRenderWindow *context)
Get/Set the context.
void Bind()
Make the draw frame buffer active (uses FRAMEBUFFER).
void CreateDepthBuffer(int width, int height, unsigned int mode)
void RenderQuad(int minX, int maxX, int minY, int maxY, vtkShaderProgram *program, vtkOpenGLVertexArrayObject *vao)
Renders a quad at the given location with pixel coordinates.
void DestroyDepthBuffer()
vtkTextureObject * GetColorBuffer(unsigned int index)
vtkGenericOpenGLResourceFreeCallback * ResourceCallback
void DestroyColorBuffers()
vtkOpenGLRenderWindow * GetContext()
void DisplayDrawBuffers()
Display the draw buffers.
static bool IsSupported(vtkOpenGLRenderWindow *renWin)
Returns if the context supports the required extensions.
a simple class to control print indentation
The VertexArrayObject class uses, or emulates, vertex array objects.
abstracts an OpenGL pixel buffer object.
create a window for renderers to draw into
The ShaderProgram uses one or more Shader objects.
abstracts an OpenGL texture object.
window superclass for vtkRenderWindow
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.