-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathwaterpaint.glsl
executable file
·387 lines (197 loc) · 5.9 KB
/
waterpaint.glsl
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
// GLSL shader autogenerated by cg2glsl.py.
#if defined(VERTEX)
varying vec4 VARc21_22;
varying vec4 VARc12_20;
varying vec2 VARc11;
varying vec4 VARc02_10;
varying vec4 VARc00_01;
struct tex_coords {
vec4 VARc00_01;
vec4 VARc02_10;
vec2 VARc11;
vec4 VARc12_20;
vec4 VARc21_22;
};
struct input_dummy {
vec2 _video_size;
vec2 _texture_size;
vec2 _output_dummy_size;
};
vec4 _oPosition1;
tex_coords _coords1;
uniform mat4 MVPMatrix;
input_dummy _IN1;
vec4 _r0012;
attribute vec4 VertexCoord;
attribute vec4 COLOR;
varying vec4 COL0;
attribute vec4 TexCoord;
mat4 transpose_(mat4 matrix)
{
mat4 ret;
for (int i = 0; i != 4; i++)
for (int j = 0; j != 4; j++)
ret[i][j] = matrix[j][i];
return ret;
}
uniform int FrameDirection;
uniform int FrameCount;
#ifdef GL_ES
uniform mediump vec2 OutputSize;
uniform mediump vec2 TextureSize;
uniform mediump vec2 InputSize;
#else
uniform vec2 OutputSize;
uniform vec2 TextureSize;
uniform vec2 InputSize;
#endif
void main()
{
mat4 MVPMatrix_ = transpose_(MVPMatrix);
vec4 _oColor;
vec2 _delta;
vec2 _TMP2;
vec2 _TMP3;
vec2 _TMP4;
vec2 _TMP5;
vec2 _TMP6;
vec2 _TMP7;
vec2 _TMP8;
vec2 _TMP9;
tex_coords _TMP10;
_r0012.x = dot(MVPMatrix_[0], VertexCoord);
_r0012.y = dot(MVPMatrix_[1], VertexCoord);
_r0012.z = dot(MVPMatrix_[2], VertexCoord);
_r0012.w = dot(MVPMatrix_[3], VertexCoord);
_oPosition1 = _r0012;
_oColor = COLOR;
_delta = 5.00000000E-001/TextureSize;
_TMP8 = TexCoord.xy + vec2(-_delta.x, -_delta.y);
_TMP9 = TexCoord.xy + vec2(-_delta.x, 0.00000000E+000);
_TMP10.VARc00_01 = vec4(_TMP8.x, _TMP8.y, _TMP9.x, _TMP9.y);
_TMP6 = TexCoord.xy + vec2(-_delta.x, _delta.y);
_TMP7 = TexCoord.xy + vec2(0.00000000E+000, -_delta.y);
_TMP10.VARc02_10 = vec4(_TMP6.x, _TMP6.y, _TMP7.x, _TMP7.y);
_TMP4 = TexCoord.xy + vec2(0.00000000E+000, _delta.y);
_TMP5 = TexCoord.xy + vec2(_delta.x, -_delta.y);
_TMP10.VARc12_20 = vec4(_TMP4.x, _TMP4.y, _TMP5.x, _TMP5.y);
_TMP2 = TexCoord.xy + vec2(_delta.x, 0.00000000E+000);
_TMP3 = TexCoord.xy + vec2(_delta.x, _delta.y);
_TMP10.VARc21_22 = vec4(_TMP2.x, _TMP2.y, _TMP3.x, _TMP3.y);
VARc00_01 = _TMP10.VARc00_01;
VARc02_10 = _TMP10.VARc02_10;
VARc11 = TexCoord.xy;
VARc12_20 = _TMP10.VARc12_20;
VARc21_22 = _TMP10.VARc21_22;
gl_Position = _r0012;
COL0 = COLOR;
}
#elif defined(FRAGMENT)
#ifdef GL_ES
precision mediump float;
#endif
varying vec4 VARc21_22;
varying vec4 VARc12_20;
varying vec2 VARc11;
varying vec4 VARc02_10;
varying vec4 VARc00_01;
struct tex_coords {
vec4 VARc00_01;
vec4 VARc02_10;
vec2 VARc11;
vec4 VARc12_20;
vec4 VARc21_22;
};
struct input_dummy {
vec2 _video_size;
vec2 _texture_size;
vec2 _output_dummy_size;
};
vec4 _ret_0;
vec3 _TMP18;
vec3 _TMP17;
vec3 _TMP15;
vec3 _TMP14;
float _TMP13;
float _TMP12;
float _TMP11;
float _TMP10;
float _TMP9;
vec4 _TMP8;
vec4 _TMP7;
vec4 _TMP6;
vec4 _TMP5;
vec4 _TMP3;
vec4 _TMP2;
vec4 _TMP1;
vec4 _TMP0;
tex_coords _co1;
input_dummy _IN1;
uniform sampler2D Texture;
float _x0042;
float _x0046;
float _x0050;
float _x0054;
float _x0058;
vec3 _a0064;
vec3 _diff0066;
vec3 _TMP67;
vec3 _x0074;
vec3 _TMP75;
uniform int FrameDirection;
uniform int FrameCount;
#ifdef GL_ES
uniform mediump vec2 OutputSize;
uniform mediump vec2 TextureSize;
uniform mediump vec2 InputSize;
#else
uniform vec2 OutputSize;
uniform vec2 TextureSize;
uniform vec2 InputSize;
#endif
void main()
{
vec3 _first;
vec3 _second;
vec3 _mid_horiz;
vec3 _mid_vert;
vec3 _res;
vec3 _final;
_TMP0 = texture2D(Texture, VARc00_01.xy);
_TMP1 = texture2D(Texture, VARc00_01.zw);
_TMP2 = texture2D(Texture, VARc02_10.xy);
_TMP3 = texture2D(Texture, VARc02_10.zw);
_TMP5 = texture2D(Texture, VARc12_20.xy);
_TMP6 = texture2D(Texture, VARc12_20.zw);
_TMP7 = texture2D(Texture, VARc21_22.xy);
_TMP8 = texture2D(Texture, VARc21_22.zw);
_x0042 = VARc11.x*TextureSize.x + 5.00000000E-001;
_TMP9 = fract(_x0042);
_first = _TMP0.xyz + _TMP9*(_TMP6.xyz - _TMP0.xyz);
_x0046 = VARc11.x*TextureSize.x + 5.00000000E-001;
_TMP10 = fract(_x0046);
_second = _TMP2.xyz + _TMP10*(_TMP8.xyz - _TMP2.xyz);
_x0050 = VARc11.x*TextureSize.x + 5.00000000E-001;
_TMP11 = fract(_x0050);
_mid_horiz = _TMP1.xyz + _TMP11*(_TMP7.xyz - _TMP1.xyz);
_x0054 = VARc11.y*TextureSize.y + 5.00000000E-001;
_TMP12 = fract(_x0054);
_mid_vert = _TMP3.xyz + _TMP12*(_TMP5.xyz - _TMP3.xyz);
_x0058 = VARc11.y*TextureSize.y + 5.00000000E-001;
_TMP13 = fract(_x0058);
_res = _first + _TMP13*(_second - _first);
_TMP14 = _mid_horiz + 5.00000000E-001*(_mid_vert - _mid_horiz);
_a0064 = _res - _TMP14;
_TMP15 = abs(_a0064);
_final = 2.59999990E-001*(_res + _mid_horiz + _mid_vert) + 3.50000000E+000*_TMP15;
_diff0066 = _final - vec3( 8.00000012E-001, 8.00000012E-001, 8.00000012E-001);
_TMP17 = min(vec3( 1.00000000E+002, 1.00000000E+002, 1.00000000E+002), _diff0066);
_TMP67 = max(vec3( 0.00000000E+000, 0.00000000E+000, 0.00000000E+000), _TMP17);
_x0074 = _final - _TMP67*8.00000012E-001;
_TMP18 = min(vec3( 1.00000000E+000, 1.00000000E+000, 1.00000000E+000), _x0074);
_TMP75 = max(vec3( 0.00000000E+000, 0.00000000E+000, 0.00000000E+000), _TMP18);
_ret_0 = vec4(_TMP75.x, _TMP75.y, _TMP75.z, 1.00000000E+000);
gl_FragColor = _ret_0;
return;
}
#endif