|
gKit2 light
|
#include <framebuffer.h>
Public Member Functions | |
| GLuint | create (const int width, const int height) |
| creation du framebuffer | |
| void | release () |
| destruction. | |
| int | width () const |
| renvoie la largeur du framebuffer. | |
| int | height () const |
| renvoie la hauteur du framebuffer. | |
| void | bind (const GLuint program, const bool store_color, const bool store_depth, const bool store_position, const bool store_texcoord, const bool store_normal, const bool store_material) |
| selection du framebuffer, stocker les sorties du fragment shader. les textures sont initialisees avec les valeurs par defaut definies par clear_color(), clear_depth(), etc. | |
| void | unbind (const int width, const int height) |
| desactive le framebuffer, selection du framebuffer par defaut associe a la fenetre. | |
| void | unbind_textures () |
| nettoyage, desactive les textures utilisees par les autres shaders, cf use_color_texture(), etc. | |
configuration des valeurs par defaut. | |
| void | clear_color (const Color &value) |
| couleur par defaut. | |
| void | clear_depth (const float value) |
| profondeur par defaut. | |
| void | clear_position (const Point &value) |
| position par defaut. | |
| void | clear_texcoord (const vec2 &value) |
| texcoord par defaut. | |
| void | clear_normal (const Vector &value) |
| normale par defaut. | |
| void | clear_material (const unsigned value) |
| indice de matiere par defaut. | |
utilisation des textures resultats par un shader. | |
meme utilisation que program_use_texture(). | |
| void | use_color_texture (const GLuint program, const char *uniform, const int unit, const GLuint sampler=0) |
| void | use_depth_texture (const GLuint program, const char *uniform, const int unit, const GLuint sampler=0) |
| void | use_position_texture (const GLuint program, const char *uniform, const int unit, const GLuint sampler=0) |
| void | use_texcoord_texture (const GLuint program, const char *uniform, const int unit, const GLuint sampler=0) |
| void | use_normal_texture (const GLuint program, const char *uniform, const int unit, const GLuint sampler=0) |
| void | use_material_texture (const GLuint program, const char *uniform, const int unit, const GLuint sampler=0) |
visualisation des textures. | |
copie la texture dans le rectangle (X0, Y0) x (X1, Y1) du framebuffer actuellement selectionne sur GL_DRAW_FRAMEBUFFER, utilise glBlitFramebuffer(). | |
| void | blit_depth (const int dstX0, const int dstY0, const int dstX1, const int dstY1) |
| void | blit_color (const int dstX0, const int dstY0, const int dstX1, const int dstY1) |
| void | blit_position (const int dstX0, const int dstY0, const int dstX1, const int dstY1) |
| void | blit_texcoord (const int dstX0, const int dstY0, const int dstX1, const int dstY1) |
| void | blit_normal (const int dstX0, const int dstY0, const int dstX1, const int dstY1) |
Protected Member Functions | |
| bool | status () |
Protected Attributes | |
| std::vector< GLenum > | m_draw_buffers |
| std::vector< GLuint > | m_color_textures |
| std::vector< std::array< unsigned, 4 > > | m_clear_colors |
| std::vector< int > | m_color_units |
| float | m_clear_depth |
| int | m_depth_unit |
| GLuint | m_depth_texture |
| GLuint | m_fbo |
| int | m_width |
| int | m_height |
stockage des sorties d'un fragment shader. exemple complet d'utilisation dans tuto_shadows.cpp
Definition at line 52 of file framebuffer.h.
| GLuint Framebuffer::create | ( | const int | width, |
| const int | height ) |
creation du framebuffer
Definition at line 13 of file framebuffer.cpp.
| void Framebuffer::release | ( | ) |
destruction.
Definition at line 33 of file framebuffer.cpp.
| int Framebuffer::width | ( | ) | const |
renvoie la largeur du framebuffer.
Definition at line 40 of file framebuffer.cpp.
| int Framebuffer::height | ( | ) | const |
renvoie la hauteur du framebuffer.
Definition at line 45 of file framebuffer.cpp.
| void Framebuffer::clear_color | ( | const Color & | value | ) |
couleur par defaut.
Definition at line 315 of file framebuffer.cpp.
| void Framebuffer::clear_depth | ( | const float | value | ) |
profondeur par defaut.
Definition at line 307 of file framebuffer.cpp.
| void Framebuffer::clear_position | ( | const Point & | value | ) |
position par defaut.
Definition at line 324 of file framebuffer.cpp.
| void Framebuffer::clear_texcoord | ( | const vec2 & | value | ) |
texcoord par defaut.
Definition at line 333 of file framebuffer.cpp.
| void Framebuffer::clear_normal | ( | const Vector & | value | ) |
normale par defaut.
Definition at line 342 of file framebuffer.cpp.
| void Framebuffer::clear_material | ( | const unsigned | value | ) |
indice de matiere par defaut.
Definition at line 351 of file framebuffer.cpp.
| void Framebuffer::bind | ( | const GLuint | program, |
| const bool | store_color, | ||
| const bool | store_depth, | ||
| const bool | store_position, | ||
| const bool | store_texcoord, | ||
| const bool | store_normal, | ||
| const bool | store_material ) |
selection du framebuffer, stocker les sorties du fragment shader. les textures sont initialisees avec les valeurs par defaut definies par clear_color(), clear_depth(), etc.
Definition at line 51 of file framebuffer.cpp.
| void Framebuffer::unbind | ( | const int | width, |
| const int | height ) |
desactive le framebuffer, selection du framebuffer par defaut associe a la fenetre.
Definition at line 276 of file framebuffer.cpp.
| void Framebuffer::unbind_textures | ( | ) |
nettoyage, desactive les textures utilisees par les autres shaders, cf use_color_texture(), etc.
Definition at line 283 of file framebuffer.cpp.
| void Framebuffer::use_color_texture | ( | const GLuint | program, |
| const char * | uniform, | ||
| const int | unit, | ||
| const GLuint | sampler = 0 ) |
Definition at line 381 of file framebuffer.cpp.
| void Framebuffer::use_depth_texture | ( | const GLuint | program, |
| const char * | uniform, | ||
| const int | unit, | ||
| const GLuint | sampler = 0 ) |
Definition at line 375 of file framebuffer.cpp.
| void Framebuffer::use_position_texture | ( | const GLuint | program, |
| const char * | uniform, | ||
| const int | unit, | ||
| const GLuint | sampler = 0 ) |
Definition at line 387 of file framebuffer.cpp.
| void Framebuffer::use_texcoord_texture | ( | const GLuint | program, |
| const char * | uniform, | ||
| const int | unit, | ||
| const GLuint | sampler = 0 ) |
Definition at line 393 of file framebuffer.cpp.
| void Framebuffer::use_normal_texture | ( | const GLuint | program, |
| const char * | uniform, | ||
| const int | unit, | ||
| const GLuint | sampler = 0 ) |
Definition at line 399 of file framebuffer.cpp.
| void Framebuffer::use_material_texture | ( | const GLuint | program, |
| const char * | uniform, | ||
| const int | unit, | ||
| const GLuint | sampler = 0 ) |
Definition at line 405 of file framebuffer.cpp.
| void Framebuffer::blit_depth | ( | const int | dstX0, |
| const int | dstY0, | ||
| const int | dstX1, | ||
| const int | dstY1 ) |
Definition at line 413 of file framebuffer.cpp.
| void Framebuffer::blit_color | ( | const int | dstX0, |
| const int | dstY0, | ||
| const int | dstX1, | ||
| const int | dstY1 ) |
Definition at line 422 of file framebuffer.cpp.
| void Framebuffer::blit_position | ( | const int | dstX0, |
| const int | dstY0, | ||
| const int | dstX1, | ||
| const int | dstY1 ) |
Definition at line 432 of file framebuffer.cpp.
| void Framebuffer::blit_texcoord | ( | const int | dstX0, |
| const int | dstY0, | ||
| const int | dstX1, | ||
| const int | dstY1 ) |
Definition at line 442 of file framebuffer.cpp.
| void Framebuffer::blit_normal | ( | const int | dstX0, |
| const int | dstY0, | ||
| const int | dstX1, | ||
| const int | dstY1 ) |
Definition at line 452 of file framebuffer.cpp.
|
protected |
Definition at line 361 of file framebuffer.cpp.
|
protected |
Definition at line 112 of file framebuffer.h.
|
protected |
Definition at line 113 of file framebuffer.h.
|
protected |
Definition at line 115 of file framebuffer.h.
|
protected |
Definition at line 116 of file framebuffer.h.
|
protected |
Definition at line 117 of file framebuffer.h.
|
protected |
Definition at line 118 of file framebuffer.h.
|
protected |
Definition at line 120 of file framebuffer.h.
|
protected |
Definition at line 121 of file framebuffer.h.
|
protected |
Definition at line 122 of file framebuffer.h.
|
protected |
Definition at line 123 of file framebuffer.h.