![]() |
Vis 2 Demo
1.0
Technical illustration type real-time rendering of geometry
|
This class builds a Frame Buffer Object (FBO) for post-processing effects. More...
Public Member Functions | |
FramebufferObject (const unsigned int _vp_width, const unsigned int _vp_height, const bool _color_only) | |
Constructs a FBO for rendering to texture(s) More... | |
~FramebufferObject () | |
Destructor. More... | |
unsigned int | getFBOStatus () const |
This function returns the state of the FBO. More... | |
void | bindFramebufferObject (const float _r, const float _g, const float _b, const float _a) |
Binds this framebuffer for rendering. More... | |
void | releaseFramebufferObject () |
Unbinds this framebuffer. More... | |
Texture * | getFBOColorTexture () |
Getter for the rendered FBO texture : color. More... | |
Texture * | getFBODepthTexture () |
Getter for the rendered FBO texture : depth. More... | |
Private Member Functions | |
FramebufferObject (const FramebufferObject &) | |
Hidden copy-constructor. More... | |
Private Attributes | |
bool | color_only |
true if only a color attachemnt is bound to the FBO, false otherwise More... | |
GLuint | fbo_handle |
handle to the frame buffer object for rendering to texture More... | |
bool | fbo_setup_done |
signifies if the setup for the frame buffer object was completed More... | |
unsigned int | fbo_status |
holds the state of the FBO More... | |
unsigned int | fbo_width |
is the width of the viewport, which is the same for all attachments of the FBO More... | |
unsigned int | fbo_height |
is the height of the viewport, which is the same for all attachments of the FBO More... | |
GLuint | fbo_renderbuffer_color_handle |
stores the name of the renderable object - in this case a renderbuffer for color More... | |
GLuint | fbo_renderbuffer_depth_handle |
stores the name of the renderable object - in this case a renderbuffer for depth More... | |
Texture * | fbo_color_texture |
stores the result of the render to texture function : color buffer More... | |
Texture * | fbo_depth_texture |
stores the result of the render to texture function : depth buffer More... | |
This class builds a Frame Buffer Object (FBO) for post-processing effects.
The class builds FBOs with only a color or with both a color and a depth attachment.
The depth test can be performed only on FBOs with a depth attachment.
Definition at line 18 of file FramebufferObject.h.
FramebufferObject::FramebufferObject | ( | const unsigned int | _vp_width, |
const unsigned int | _vp_height, | ||
const bool | _color_only | ||
) |
Constructs a FBO for rendering to texture(s)
Any of the shader programs can render to these textures.
[in] | _vp_width | is the viewport width, |
[in] | _vp_height | is the viewport height, |
[in] | _color_only | : if true only a color attachment is prepared. Per default a color and depth textures are prepared. |
Definition at line 5 of file FramebufferObject.cpp.
FramebufferObject::~FramebufferObject | ( | ) |
Destructor.
Deletes the FBO and both textures associated with its attachments.
Definition at line 78 of file FramebufferObject.cpp.
|
private |
Hidden copy-constructor.
void FramebufferObject::bindFramebufferObject | ( | const float | _r, |
const float | _g, | ||
const float | _b, | ||
const float | _a | ||
) |
Binds this framebuffer for rendering.
This function is called directly BEFORE a drawing command.
[in] | _r | is the red channel of the viewport background color in the interval [0.0 1.0], |
[in] | _g | is the green channel of the viewport background color in the interval [0.0 1.0], |
[in] | _b | is the blue channel of the viewport background color in the interval [0.0 1.0], |
[in] | _a | is the alpha channel of the viewport background color in the interval [0.0 1.0]. |
Definition at line 89 of file FramebufferObject.cpp.
|
inline |
Getter for the rendered FBO texture : color.
Definition at line 59 of file FramebufferObject.h.
|
inline |
Getter for the rendered FBO texture : depth.
Definition at line 61 of file FramebufferObject.h.
|
inline |
This function returns the state of the FBO.
Definition at line 40 of file FramebufferObject.h.
void FramebufferObject::releaseFramebufferObject | ( | ) |
Unbinds this framebuffer.
This function is called directly AFTER a drawing command.
It binds the FBO, and clears the viewport for rendering.
Definition at line 106 of file FramebufferObject.cpp.
|
private |
true if only a color attachemnt is bound to the FBO, false otherwise
Definition at line 67 of file FramebufferObject.h.
|
private |
stores the result of the render to texture function : color buffer
Definition at line 76 of file FramebufferObject.h.
|
private |
stores the result of the render to texture function : depth buffer
Definition at line 77 of file FramebufferObject.h.
|
private |
handle to the frame buffer object for rendering to texture
Definition at line 69 of file FramebufferObject.h.
|
private |
is the height of the viewport, which is the same for all attachments of the FBO
Definition at line 73 of file FramebufferObject.h.
|
private |
stores the name of the renderable object - in this case a renderbuffer for color
Definition at line 74 of file FramebufferObject.h.
|
private |
stores the name of the renderable object - in this case a renderbuffer for depth
Definition at line 75 of file FramebufferObject.h.
|
private |
signifies if the setup for the frame buffer object was completed
Definition at line 70 of file FramebufferObject.h.
|
private |
holds the state of the FBO
Definition at line 71 of file FramebufferObject.h.
|
private |
is the width of the viewport, which is the same for all attachments of the FBO
Definition at line 72 of file FramebufferObject.h.