/
z-WaterDisplRefr-out.txt
198 lines (197 loc) · 6.72 KB
/
z-WaterDisplRefr-out.txt
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
float xll_saturate( float x) {
return clamp( x, 0.0, 1.0);
}
vec2 xll_saturate( vec2 x) {
return clamp( x, 0.0, 1.0);
}
vec3 xll_saturate( vec3 x) {
return clamp( x, 0.0, 1.0);
}
vec4 xll_saturate( vec4 x) {
return clamp( x, 0.0, 1.0);
}
mat2 xll_saturate(mat2 m) {
return mat2( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0));
}
mat3 xll_saturate(mat3 m) {
return mat3( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0));
}
mat4 xll_saturate(mat4 m) {
return mat4( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0), clamp(m[3], 0.0, 1.0));
}
#line 119
struct v2f {
vec4 pos;
vec4 normalInterpolator;
vec4 viewInterpolator;
vec4 bumpCoords;
vec4 screenPos;
vec4 grabPassPos;
};
#line 16
struct appdata_full {
vec4 vertex;
vec4 tangent;
vec3 normal;
vec4 texcoord;
};
uniform vec4 _Time;
uniform vec4 _SinTime;
#line 3
uniform vec4 _CosTime;
uniform vec3 _WorldSpaceCameraPos;
uniform vec4 _ProjectionParams;
uniform vec4 _ScreenParams;
#line 7
uniform vec4 _ZBufferParams;
uniform mat4 glstate_matrix_mvp;
uniform mat4 glstate_matrix_modelview0;
uniform mat4 glstate_matrix_invtrans_modelview0;
#line 11
uniform mat4 _Object2World;
uniform mat4 _World2Object;
uniform vec4 unity_Scale;
uniform mat4 glstate_matrix_transpose_modelview0;
#line 15
uniform mat4 glstate_matrix_projection;
#line 24
#line 42
#line 46
#line 50
uniform float _GerstnerIntensity;
#line 65
#line 93
#line 114
#line 130
uniform vec4 _DistortParams;
uniform vec4 _BumpTiling;
uniform vec4 _BumpDirection;
uniform vec4 _GAmplitude;
#line 134
uniform vec4 _GFrequency;
uniform vec4 _GSteepness;
uniform vec4 _GSpeed;
uniform vec4 _GDirectionAB;
#line 138
uniform vec4 _GDirectionCD;
vec3 GerstnerOffset4( in vec2 xzVtx, in vec4 steepness, in vec4 amp, in vec4 freq, in vec4 speed, in vec4 dirAB, in vec4 dirCD );
vec3 GerstnerNormal4( in vec2 xzVtx, in vec4 amp, in vec4 freq, in vec4 speed, in vec4 dirAB, in vec4 dirCD );
void Gerstner( out vec3 offs, out vec3 nrml, in vec3 vtx, in vec3 tileableVtx, in vec4 amplitude, in vec4 frequency, in vec4 steepness, in vec4 speed, in vec4 directionAB, in vec4 directionCD );
vec4 ComputeScreenPos( in vec4 pos );
void ComputeScreenAndGrabPassPos( in vec4 pos, out vec4 screenPos, out vec4 grabPassPos );
v2f xlat_main( in appdata_full v );
#line 79
vec3 GerstnerOffset4( in vec2 xzVtx, in vec4 steepness, in vec4 amp, in vec4 freq, in vec4 speed, in vec4 dirAB, in vec4 dirCD ) {
#line 81
vec3 offsets;
vec4 AB = ((steepness.xxyy * amp.xxyy) * dirAB.xyzw);
vec4 CD = ((steepness.zzww * amp.zzww) * dirCD.xyzw);
vec4 dotABCD = (freq.xyzw * vec4( dot( dirAB.xy, xzVtx), dot( dirAB.zw, xzVtx), dot( dirCD.xy, xzVtx), dot( dirCD.zw, xzVtx)));
#line 85
vec4 TIME = (_Time.yyyy * speed);
vec4 COS = cos((dotABCD + TIME));
vec4 SIN = sin((dotABCD + TIME));
offsets.x = dot( COS, vec4( AB.xz, CD.xz));
#line 89
offsets.z = dot( COS, vec4( AB.yw, CD.yw));
offsets.y = dot( SIN, amp);
return offsets;
}
#line 100
vec3 GerstnerNormal4( in vec2 xzVtx, in vec4 amp, in vec4 freq, in vec4 speed, in vec4 dirAB, in vec4 dirCD ) {
#line 102
vec3 nrml = vec3( 0.0, 2.0, 0.0);
vec4 AB = ((freq.xxyy * amp.xxyy) * dirAB.xyzw);
vec4 CD = ((freq.zzww * amp.zzww) * dirCD.xyzw);
vec4 dotABCD = (freq.xyzw * vec4( dot( dirAB.xy, xzVtx), dot( dirAB.zw, xzVtx), dot( dirCD.xy, xzVtx), dot( dirCD.zw, xzVtx)));
#line 106
vec4 TIME = (_Time.yyyy * speed);
vec4 COS = cos((dotABCD + TIME));
nrml.x -= dot( COS, vec4( AB.xz, CD.xz));
nrml.z -= dot( COS, vec4( AB.yw, CD.yw));
#line 110
nrml.xz *= _GerstnerIntensity;
nrml = normalize(nrml);
return nrml;
}
#line 114
void Gerstner( out vec3 offs, out vec3 nrml, in vec3 vtx, in vec3 tileableVtx, in vec4 amplitude, in vec4 frequency, in vec4 steepness, in vec4 speed, in vec4 directionAB, in vec4 directionCD ) {
offs = GerstnerOffset4( tileableVtx.xz, steepness, amplitude, frequency, speed, directionAB, directionCD);
nrml = GerstnerNormal4( (tileableVtx.xz + offs.xz), amplitude, frequency, speed, directionAB, directionCD);
}
#line 35
vec4 ComputeScreenPos( in vec4 pos ) {
#line 37
vec4 o = (pos * 0.5);
o.xy = (vec2( o.x, (o.y * _ProjectionParams.x)) + o.w);
o.zw = pos.zw;
return o;
}
#line 57
void ComputeScreenAndGrabPassPos( in vec4 pos, out vec4 screenPos, out vec4 grabPassPos ) {
#line 59
float scale = 1.0;
screenPos = ComputeScreenPos( pos);
grabPassPos.xy = ((vec2( pos.x, (pos.y * scale)) + pos.w) * 0.5);
grabPassPos.zw = pos.zw;
}
#line 140
v2f xlat_main( in appdata_full v ) {
#line 142
v2f o;
vec3 worldSpaceVertex = (_Object2World * v.vertex).xyz;
vec3 vtxForAni = (worldSpaceVertex.xzz * unity_Scale.w);
vec3 nrml;
#line 146
vec3 offsets;
Gerstner( offsets, nrml, v.vertex.xyz, vtxForAni, _GAmplitude, _GFrequency, _GSteepness, _GSpeed, _GDirectionAB, _GDirectionCD);
v.vertex.xyz += offsets;
vec2 tileableUv = (_Object2World * v.vertex).xz;
#line 150
o.bumpCoords.xyzw = ((tileableUv.xyxy + (_Time.xxxx * _BumpDirection.xyzw)) * _BumpTiling.xyzw);
o.viewInterpolator.xyz = (worldSpaceVertex - _WorldSpaceCameraPos);
o.pos = (glstate_matrix_mvp * v.vertex);
ComputeScreenAndGrabPassPos( o.pos, o.screenPos, o.grabPassPos);
#line 154
o.normalInterpolator.xyz = nrml;
o.viewInterpolator.w = xll_saturate(offsets.y);
o.normalInterpolator.w = 1.0;
return o;
}
attribute vec4 TANGENT;
varying vec4 xlv_TEXCOORD0;
varying vec4 xlv_TEXCOORD1;
varying vec4 xlv_TEXCOORD2;
varying vec4 xlv_TEXCOORD3;
varying vec4 xlv_TEXCOORD4;
void main() {
v2f xl_retval;
appdata_full xlt_v;
xlt_v.vertex = vec4(gl_Vertex);
xlt_v.tangent = vec4(TANGENT);
xlt_v.normal = vec3(gl_Normal);
xlt_v.texcoord = vec4(gl_MultiTexCoord0);
xl_retval = xlat_main( xlt_v);
gl_Position = vec4(xl_retval.pos);
xlv_TEXCOORD0 = vec4(xl_retval.normalInterpolator);
xlv_TEXCOORD1 = vec4(xl_retval.viewInterpolator);
xlv_TEXCOORD2 = vec4(xl_retval.bumpCoords);
xlv_TEXCOORD3 = vec4(xl_retval.screenPos);
xlv_TEXCOORD4 = vec4(xl_retval.grabPassPos);
}
// uniforms:
// _BumpDirection:<none> type 12 arrsize 0
// _BumpTiling:<none> type 12 arrsize 0
// _GAmplitude:<none> type 12 arrsize 0
// _GDirectionAB:<none> type 12 arrsize 0
// _GDirectionCD:<none> type 12 arrsize 0
// _GFrequency:<none> type 12 arrsize 0
// _GSpeed:<none> type 12 arrsize 0
// _GSteepness:<none> type 12 arrsize 0
// _GerstnerIntensity:<none> type 9 arrsize 0
// _Object2World:<none> type 21 arrsize 0
// _ProjectionParams:<none> type 12 arrsize 0
// _Time:<none> type 12 arrsize 0
// _WorldSpaceCameraPos:<none> type 11 arrsize 0
// glstate_matrix_mvp:<none> type 21 arrsize 0
// unity_Scale:<none> type 12 arrsize 0