blob: eb58d6643155ba20daef75fd75c1c7a5359822cf (
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
56
57
58
59
60
61
62
63
|
[vertex]
layout(location=0) in highp vec4 vertex_attrib;
#ifdef USE_CUBEMAP
layout(location=4) in vec3 cube_in;
#else
layout(location=4) in vec2 uv_in; // attrib:4
#endif
layout(location=5) in vec2 uv2_in; // attrib:5
#ifdef USE_CUBEMAP
out vec3 cube_interp;
#else
out vec2 uv_interp;
#endif
out vec2 uv2_interp;
void main() {
#ifdef USE_CUBEMAP
cube_interp = cube_in;
#else
uv_interp = uv_in;
#endif
uv2_interp = uv2_in;
gl_Position = vertex_attrib;
}
[fragment]
#ifdef USE_CUBEMAP
in vec3 cube_interp;
uniform samplerCube source_cube; //texunit:0
#else
in vec2 uv_interp;
uniform sampler2D source; //texunit:0
#endif
uniform float stuff;
in vec2 uv2_interp;
layout(location = 0) out vec4 frag_color;
void main() {
//vec4 color = color_interp;
#ifdef USE_CUBEMAP
vec4 color = texture( source_cube, normalize(cube_interp) );
#else
vec4 color = texture( source, uv_interp );
#endif
frag_color = color;
}
|