gKit2 light

- Main Page
- Related Pages
- Modules
- Classes
- Files

- File List
- File Members

tuto5GL_multi.glsl
1
2 #version 330
3
4 #ifdef VERTEX_SHADER
5 in vec3 position;
6 in vec2 texcoord;
7
8 uniform mat4 mvpMatrix;
9
10 out vec2 vertex_texcoord;
11
12 void main( )
13 {
14 gl_Position= mvpMatrix * vec4(position, 1);
15 vertex_texcoord= texcoord;
16 }
17 #endif
18
19
20 #ifdef FRAGMENT_SHADER
21
22 in vec2 vertex_texcoord;
23
24 uniform sampler2D base_texture;
25 uniform sampler2D detail_texture;
26
27 out vec4 fragment_color;
28
29 void main( )
30 {
31 vec4 color= texture(base_texture, vertex_texcoord);
32 color= color * 0.5 + texture(detail_texture, vertex_texcoord) * 0.5;
33
34 fragment_color= color;
35 }
36 #endif
vec3
vecteur generique, utilitaire.
Definition: vec.h:104
vec2
vecteur generique, utilitaire.
Definition: vec.h:94
vec4
vecteur generique 4d, ou 3d homogene, utilitaire.
Definition: vec.h:121