float xll_saturate_f( float x) { return clamp( x, 0.0, 1.0); } vec2 xll_saturate_vf2( vec2 x) { return clamp( x, 0.0, 1.0); } vec3 xll_saturate_vf3( vec3 x) { return clamp( x, 0.0, 1.0); } vec4 xll_saturate_vf4( vec4 x) { return clamp( x, 0.0, 1.0); } mat2 xll_saturate_mf2x2(mat2 m) { return mat2( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0)); } mat3 xll_saturate_mf3x3(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_mf4x4(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; #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 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 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 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 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_f(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: type 12 arrsize 0 // _BumpTiling: type 12 arrsize 0 // _GAmplitude: type 12 arrsize 0 // _GDirectionAB: type 12 arrsize 0 // _GDirectionCD: type 12 arrsize 0 // _GFrequency: type 12 arrsize 0 // _GSpeed: type 12 arrsize 0 // _GSteepness: type 12 arrsize 0 // _GerstnerIntensity: type 9 arrsize 0 // _Object2World: type 21 arrsize 0 // _ProjectionParams: type 12 arrsize 0 // _Time: type 12 arrsize 0 // _WorldSpaceCameraPos: type 11 arrsize 0 // glstate_matrix_mvp: type 21 arrsize 0 // unity_Scale: type 12 arrsize 0