blob: 89cdd48257c2064870a6c49e1981d933b3b0354c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
#version 440
#if defined(TABLE)
layout(location = 0) in vec2 tt;
#endif
#if defined(SPRITE)
layout(location = 1) in vec4 fTexS;
#elif !defined(POINT)
layout(location = 1) in vec2 fTex;
#endif
#if defined(COLOR)
layout(location = 2) in vec4 fColor;
#else
layout(location = 2) in float fFade;
#endif
layout(location = 0) out vec4 fragColor;
layout(std140, binding = 0) uniform buf {
mat4 matrix;
float opacity;
float entry;
float timestamp;
float sizetable[64];
float opacitytable[64];
} ubuf;
layout(binding = 1) uniform sampler2D _qt_texture;
#if defined(TABLE) || defined(SPRITE)
layout(binding = 2) uniform sampler2D colortable;
#endif
void main()
{
#if defined(SPRITE)
fragColor = mix(texture(_qt_texture, fTexS.xy), texture(_qt_texture, fTexS.zw), tt.y)
* fColor
* texture(colortable, tt)
* ubuf.opacity;
#elif defined(TABLE)
fragColor = texture(_qt_texture, fTex)
* fColor
* texture(colortable, tt)
* ubuf.opacity;
#elif !defined(POINT)
fragColor = texture(_qt_texture, fTex) * fColor * ubuf.opacity;
#elif defined(COLOR)
fragColor = texture(_qt_texture, gl_PointCoord) * fColor * ubuf.opacity;
#else // simple point
fragColor = texture(_qt_texture, gl_PointCoord) * fFade * ubuf.opacity;
#endif
}
|