gKit2 light
Toggle main menu visibility
Loading...
Searching...
No Matches
src
gKit
framebuffer.h
Go to the documentation of this file.
1
3
4
#ifndef _FRAMEBUFFER_H
5
#define _FRAMEBUFFER_H
6
7
#include <vector>
8
#include <array>
9
10
#include "
texture.h
"
11
12
51
52
struct
Framebuffer
53
{
54
Framebuffer( ) =
default
;
55
57
GLuint
create
(
const
int
width
,
const
int
height
);
59
void
release
( );
60
62
int
width
( )
const
;
64
int
height
( )
const
;
65
68
void
clear_color
(
const
Color
& value );
69
void
clear_depth
(
const
float
value );
70
void
clear_position
(
const
Point
& value );
71
void
clear_texcoord
(
const
vec2
& value );
72
void
clear_normal
(
const
Vector
& value );
73
void
clear_material
(
const
unsigned
value );
75
77
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 );
78
80
void
unbind
(
const
int
width
,
const
int
height
);
81
83
void
unbind_textures
( );
84
89
void
use_color_texture(
const
GLuint program,
const
char
*uniform,
const
int
unit,
const
GLuint sampler= 0 );
90
void
use_depth_texture(
const
GLuint program,
const
char
*uniform,
const
int
unit,
const
GLuint sampler= 0 );
91
void
use_position_texture(
const
GLuint program,
const
char
*uniform,
const
int
unit,
const
GLuint sampler= 0 );
92
void
use_texcoord_texture(
const
GLuint program,
const
char
*uniform,
const
int
unit,
const
GLuint sampler= 0 );
93
void
use_normal_texture(
const
GLuint program,
const
char
*uniform,
const
int
unit,
const
GLuint sampler= 0 );
94
void
use_material_texture(
const
GLuint program,
const
char
*uniform,
const
int
unit,
const
GLuint sampler= 0 );
96
101
void
blit_depth(
const
int
dstX0,
const
int
dstY0,
const
int
dstX1,
const
int
dstY1 );
102
void
blit_color(
const
int
dstX0,
const
int
dstY0,
const
int
dstX1,
const
int
dstY1 );
103
void
blit_position(
const
int
dstX0,
const
int
dstY0,
const
int
dstX1,
const
int
dstY1 );
104
void
blit_texcoord(
const
int
dstX0,
const
int
dstY0,
const
int
dstX1,
const
int
dstY1 );
105
void
blit_normal(
const
int
dstX0,
const
int
dstY0,
const
int
dstX1,
const
int
dstY1 );
106
//~ void blit_material( const int dstX0, const int dstY0, const int dstX1, const int dstY1 );
108
109
protected
:
110
bool
status( );
111
112
std::vector<GLenum> m_draw_buffers;
113
std::vector<GLuint> m_color_textures;
114
115
std::vector< std::array<unsigned,4> > m_clear_colors;
116
std::vector<int> m_color_units;
117
float
m_clear_depth;
118
int
m_depth_unit;
119
120
GLuint m_depth_texture;
121
GLuint m_fbo;
122
int
m_width;
123
int
m_height;
124
};
125
126
127
#endif
Color
representation d'une couleur (rgba) transparente ou opaque.
Definition
color.h:14
Framebuffer::release
void release()
destruction.
Definition
framebuffer.cpp:33
Framebuffer::height
int height() const
renvoie la hauteur du framebuffer.
Definition
framebuffer.cpp:45
Framebuffer::clear_texcoord
void clear_texcoord(const vec2 &value)
texcoord par defaut.
Definition
framebuffer.cpp:333
Framebuffer::clear_position
void clear_position(const Point &value)
position par defaut.
Definition
framebuffer.cpp:324
Framebuffer::clear_material
void clear_material(const unsigned value)
indice de matiere par defaut.
Definition
framebuffer.cpp:351
Framebuffer::width
int width() const
renvoie la largeur du framebuffer.
Definition
framebuffer.cpp:40
Framebuffer::unbind
void unbind(const int width, const int height)
desactive le framebuffer, selection du framebuffer par defaut associe a la fenetre.
Definition
framebuffer.cpp:276
Framebuffer::create
GLuint create(const int width, const int height)
creation du framebuffer
Definition
framebuffer.cpp:13
Framebuffer::clear_color
void clear_color(const Color &value)
couleur par defaut.
Definition
framebuffer.cpp:315
Framebuffer::clear_depth
void clear_depth(const float value)
profondeur par defaut.
Definition
framebuffer.cpp:307
Framebuffer::unbind_textures
void unbind_textures()
nettoyage, desactive les textures utilisees par les autres shaders, cf use_color_texture(),...
Definition
framebuffer.cpp:283
Framebuffer::bind
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...
Definition
framebuffer.cpp:51
Framebuffer::clear_normal
void clear_normal(const Vector &value)
normale par defaut.
Definition
framebuffer.cpp:342
Point
representation d'un point 3d.
Definition
vec.h:21
Vector
representation d'un vecteur 3d.
Definition
vec.h:67
vec2
vecteur generique, utilitaire.
Definition
vec.h:152
texture.h
Generated on
for gKit2 light by
1.17.0