blob: 0e60fc6f55ee20c0ad440db77b24e88d02af10fa (
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
|
#define FRAGMENT_SHADER
// Warsow GLSL shader
varying vec4 ProjVector;
#ifdef VERTEX_SHADER
// Vertex shader
uniform float OutlineHeight;
void main(void)
{
gl_FrontColor = gl_Color;
vec4 n = vec4(gl_Normal.xyz, 0.0);
vec4 v = vec4(gl_Vertex) + n * OutlineHeight;
gl_Position = gl_ModelViewProjectionMatrix * v;
ProjVector = gl_Position;
#ifdef APPLY_CLIPPING
#ifdef __GLSL_CG_DATA_TYPES
gl_ClipVertex = gl_ModelViewMatrix * v;
#endif
#endif
}
#endif // VERTEX_SHADER
#ifdef FRAGMENT_SHADER
// Fragment shader
uniform float OutlineCutOff;
void main(void)
{
#ifdef APPLY_OUTLINES_CUTOFF
if (OutlineCutOff > 0.0 && (ProjVector.w > OutlineCutOff))
discard;
#endif
gl_FragColor = vec4 (gl_Color);
}
#endif // FRAGMENT_SHADER
|