gKit2 light
render_cubemap.glsl
Go to the documentation of this file.
1 
3 
4 #version 330
5 
6 #extension GL_ARB_shader_viewport_layer_array : require
7 
8 #ifdef VERTEX_SHADER
9 uniform mat4 mvpMatrix[6];
10 uniform mat4 modelMatrix;
11 
12 layout(location= 0) in vec3 position;
13 layout(location= 2) in vec3 normal;
14 
15 out vec3 vertex_position;
16 out vec3 vertex_normal;
17 
18 void main( )
19 {
20  gl_Position= mvpMatrix[gl_InstanceID] * vec4(position, 1);
21  gl_Layer= gl_InstanceID;
22 
23  vertex_position= vec3(modelMatrix * vec4(position, 1));
24  vertex_normal= mat3(modelMatrix) * normal;
25 }
26 #endif
27 
28 
29 #ifdef FRAGMENT_SHADER
30 out vec4 fragment_color;
31 
32 in vec3 vertex_position;
33 in vec3 vertex_normal;
34 void main( )
35 {
36  fragment_color= vec4(abs(vertex_position / 20), 1);
37 }
38 #endif
vecteur generique, utilitaire.
Definition: vec.h:146
vecteur generique 4d, ou 3d homogene, utilitaire.
Definition: vec.h:168