blob: 7b223e172dd5b6464877722d0e4bda90a4f10818 (
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
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
|
[require]
GLSL >= 1.10
[fragment shader]
#define FRAGMENT_SHADER
// Warsow GLSL shader
#if !defined(__GLSL_CG_DATA_TYPES)
#define myhalf float
#define myhalf2 vec2
#define myhalf3 vec3
#define myhalf4 vec4
#else
#define myhalf half
#define myhalf2 half2
#define myhalf3 half3
#define myhalf4 half4
#endif
#define M_TWOPI 6.28318530717958647692
varying vec2 TexCoord;
#ifdef VERTEX_SHADER
// Vertex shader
uniform float TurbAmplitude, TurbPhase;
void main(void)
{
gl_FrontColor = gl_Color;
vec4 turb;
turb = vec4(gl_MultiTexCoord0);
turb.s += TurbAmplitude * sin( ((gl_MultiTexCoord0.t / 4.0 + TurbPhase)) * M_TWOPI );
turb.t += TurbAmplitude * sin( ((gl_MultiTexCoord0.s / 4.0 + TurbPhase)) * M_TWOPI );
TexCoord = vec2(gl_TextureMatrix[0] * turb);
gl_Position = ftransform();
#ifdef APPLY_CLIPPING
#ifdef __GLSL_CG_DATA_TYPES
gl_ClipVertex = gl_ModelViewMatrix * gl_Vertex;
#endif
#endif
}
#endif // VERTEX_SHADER
#ifdef FRAGMENT_SHADER
// Fragment shader
uniform sampler2D BaseTexture;
void main(void)
{
myhalf4 color;
color = myhalf4(gl_Color) * myhalf4(texture2D(BaseTexture, TexCoord));
gl_FragColor = vec4(color);
}
#endif // FRAGMENT_SHADER
[vertex shader]
#define VERTEX_SHADER
// Warsow GLSL shader
#if !defined(__GLSL_CG_DATA_TYPES)
#define myhalf float
#define myhalf2 vec2
#define myhalf3 vec3
#define myhalf4 vec4
#else
#define myhalf half
#define myhalf2 half2
#define myhalf3 half3
#define myhalf4 half4
#endif
#define M_TWOPI 6.28318530717958647692
varying vec2 TexCoord;
#ifdef VERTEX_SHADER
// Vertex shader
uniform float TurbAmplitude, TurbPhase;
void main(void)
{
gl_FrontColor = gl_Color;
vec4 turb;
turb = vec4(gl_MultiTexCoord0);
turb.s += TurbAmplitude * sin( ((gl_MultiTexCoord0.t / 4.0 + TurbPhase)) * M_TWOPI );
turb.t += TurbAmplitude * sin( ((gl_MultiTexCoord0.s / 4.0 + TurbPhase)) * M_TWOPI );
TexCoord = vec2(gl_TextureMatrix[0] * turb);
gl_Position = ftransform();
#ifdef APPLY_CLIPPING
#ifdef __GLSL_CG_DATA_TYPES
gl_ClipVertex = gl_ModelViewMatrix * gl_Vertex;
#endif
#endif
}
#endif // VERTEX_SHADER
#ifdef FRAGMENT_SHADER
// Fragment shader
uniform sampler2D BaseTexture;
void main(void)
{
myhalf4 color;
color = myhalf4(gl_Color) * myhalf4(texture2D(BaseTexture, TexCoord));
gl_FragColor = vec4(color);
}
#endif // FRAGMENT_SHADER
|