gKit2 light
Toggle main menu visibility
Loading...
Searching...
No Matches
gkit2_tutos
storage_texture_display.glsl
Go to the documentation of this file.
1
3
4
#version 430
5
6
#ifdef VERTEX_SHADER
7
8
void
main( )
9
{
10
vec3
positions[3]=
vec3
[3](
vec3
(-1, 1, -1),
vec3
( -1, -3, -1),
vec3
( 3, 1, -1) );
11
12
gl_Position=
vec4
(positions[gl_VertexID], 1.0);
13
}
14
#endif
15
16
17
#ifdef FRAGMENT_SHADER
18
19
layout(binding= 0, r32ui) readonly uniform uimage2D image;
20
21
out
vec4
fragment_color;
22
23
void
main( )
24
{
25
// utilise une palette de couleur pour afficher la valeur du compteur
26
const
vec3
colors[10]=
vec3
[10](
27
vec3
(0,0,0),
28
vec3
(12,17,115),
29
vec3
(28,121,255),
30
vec3
(31,255,255),
31
vec3
(130,255,17),
32
vec3
(255,255,14),
33
vec3
(255,112,22),
34
vec3
(251,0,20),
35
vec3
(113,1,14),
36
vec3
(113,1,14)
37
);
38
39
uint n= imageLoad(image, ivec2(gl_FragCoord.xy)).r;
40
vec3
color;
41
if
(n < 10) color= colors[n] /
vec3
(255);
42
else
color= colors[9] /
vec3
(255);
43
44
fragment_color=
vec4
(color, 1.0);
45
}
46
#endif
vec3
vecteur generique, utilitaire.
Definition
vec.h:169
vec4
vecteur generique 4d, ou 3d homogene, utilitaire.
Definition
vec.h:192
Generated on
for gKit2 light by
1.17.0