6 #extension GL_ARB_shader_viewport_layer_array : require
9 uniform mat4 mvpMatrix[6];
10 uniform mat4 modelMatrix;
12 layout(location= 0) in
vec3 position;
13 layout(location= 2) in
vec3 normal;
15 out
vec3 vertex_position;
16 out
vec3 vertex_normal;
20 gl_Position= mvpMatrix[gl_InstanceID] *
vec4(position, 1);
21 gl_Layer= gl_InstanceID;
23 vertex_position=
vec3(modelMatrix *
vec4(position, 1));
24 vertex_normal= mat3(modelMatrix) * normal;
29 #ifdef FRAGMENT_SHADER
30 out
vec4 fragment_color;
32 in
vec3 vertex_position;
33 in
vec3 vertex_normal;
36 fragment_color=
vec4(abs(vertex_position / 20), 1);
vecteur generique, utilitaire.
vecteur generique 4d, ou 3d homogene, utilitaire.