gKit2 light
tuto9_texture1.glsl
Go to the documentation of this file.
1 
3 
4 #version 330
5 
6 #ifdef VERTEX_SHADER
7 layout(location= 0) in vec3 position;
8 layout(location= 1) in vec2 texcoord;
9 
10 uniform mat4 mvpMatrix;
11 
12 out vec2 vertex_texcoord;
13 
14 void main( )
15 {
16  gl_Position= mvpMatrix * vec4(position, 1);
17  vertex_texcoord= texcoord;
18 }
19 
20 #endif
21 
22 
23 #ifdef FRAGMENT_SHADER
24 out vec4 fragment_color;
25 
26 in vec2 vertex_texcoord;
27 
28 uniform sampler2D texture0;
29 
30 void main( )
31 {
32  vec4 color= texture(texture0, vertex_texcoord);
33  fragment_color= color;
34 }
35 
36 #endif
vecteur generique, utilitaire.
Definition: vec.h:131
vecteur generique, utilitaire.
Definition: vec.h:146
vecteur generique 4d, ou 3d homogene, utilitaire.
Definition: vec.h:168