gKit2 light
Toggle main menu visibility
Loading...
Searching...
No Matches
gkit2_tutos
M2
mesh.glsl
1
2
#version 460
3
#extension GL_EXT_mesh_shader : require
4
5
#ifdef MESH_SHADER
6
uniform mat4 mvpMatrix;
7
8
layout(local_size_x= 4) in;
9
layout(triangles, max_vertices = 4, max_primitives = 2) out;
10
void
main()
11
{
12
SetMeshOutputsEXT(4, 2);
13
14
vec2
positions[4]=
vec2
[4](
vec2
(-1, -1),
vec2
(1, -1),
vec2
(1, 1),
vec2
(-1, 1) );
15
16
if
(gl_LocalInvocationIndex < 4)
17
gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_Position= mvpMatrix *
vec4
( positions[gl_LocalInvocationIndex], 0, 1);
18
19
if
(gl_LocalInvocationIndex == 0)
20
gl_PrimitiveTriangleIndicesEXT[0] = uvec3(0, 1, 2);
21
if
(gl_LocalInvocationIndex == 1)
22
gl_PrimitiveTriangleIndicesEXT[1] = uvec3(2, 3, 0);
23
}
24
#endif
25
26
#ifdef FRAGMENT_SHADER
27
uniform
vec4
color;
28
29
out
vec4
fragment_color;
30
void
main()
31
{
32
fragment_color= color;
33
}
34
#endif
vec2
vecteur generique, utilitaire.
Definition
vec.h:152
vec4
vecteur generique 4d, ou 3d homogene, utilitaire.
Definition
vec.h:192
Generated on
for gKit2 light by
1.17.0