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