/
generic.dei
107 lines (95 loc) · 3.26 KB
/
generic.dei
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
group generic
{
# Simple shader with untextured vertices. There is an additional constant
# color applied to all vertices. Uses a combined model-view-projection
# matrix.
shader color_ucolor
{
vertex = "
uniform highp mat4 uMvpMatrix;
uniform highp vec4 uColor;
DENG_ATTRIB highp vec4 aVertex;
DENG_ATTRIB highp vec4 aColor;
DENG_VAR highp vec4 vColor;
void main(void) {
gl_Position = uMvpMatrix * aVertex;
vColor = uColor * aColor;
}"
fragment = "
DENG_VAR highp vec4 vColor;
void main(void) {
out_FragColor = vColor;
}"
}
shader texture
{
vertex = "
uniform highp mat4 uMvpMatrix;
DENG_ATTRIB highp vec4 aVertex;
DENG_ATTRIB highp vec2 aUV;
DENG_VAR highp vec2 vUV;
void main(void) {
gl_Position = uMvpMatrix * aVertex;
vUV = aUV;
}"
fragment = "
uniform sampler2D uTex;
DENG_VAR highp vec2 vUV;
void main(void) {
out_FragColor = texture(uTex, vUV);
}"
}
group textured
{
# Simple shader with one texture plus a color per vertex. Uses a
# combined model-view-projection matrix.
shader color
{
vertex = "
uniform highp mat4 uMvpMatrix;
DENG_ATTRIB highp vec4 aVertex;
DENG_ATTRIB highp vec2 aUV;
DENG_ATTRIB highp vec4 aColor;
DENG_VAR highp vec2 vUV;
DENG_VAR highp vec4 vColor;
void main(void) {
gl_Position = uMvpMatrix * aVertex;
vUV = aUV;
vColor = aColor;
}"
fragment = "
uniform sampler2D uTex;
DENG_VAR highp vec2 vUV;
DENG_VAR highp vec4 vColor;
void main(void) {
out_FragColor = vColor * texture(uTex, vUV);
}"
}
# Simple shader with one texture plus a color per vertex. There is
# an additional constant color applied to all vertices. Uses a
# combined model-view-projection matrix.
shader color_ucolor
{
vertex = "
uniform highp mat4 uMvpMatrix;
uniform highp vec4 uColor;
DENG_ATTRIB highp vec4 aVertex;
DENG_ATTRIB highp vec2 aUV;
DENG_ATTRIB highp vec4 aColor;
DENG_VAR highp vec2 vUV;
DENG_VAR highp vec4 vColor;
void main(void) {
gl_Position = uMvpMatrix * aVertex;
vUV = aUV;
vColor = aColor * uColor;
}"
fragment = "
uniform sampler2D uTex;
DENG_VAR highp vec2 vUV;
DENG_VAR highp vec4 vColor;
void main(void) {
out_FragColor = vColor * texture(uTex, vUV);
}"
}
}
}