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 { highp vec4 pos; highp vec4 normalInterpolator; highp vec4 viewInterpolator; highp vec4 bumpCoords; highp vec4 screenPos; highp vec4 grabPassPos; }; #line 16 struct appdata_full { highp vec4 vertex; highp vec4 tangent; highp vec3 normal; highp vec4 texcoord; }; uniform highp vec4 _Time; uniform highp vec4 _SinTime; #line 3 uniform highp vec4 _CosTime; uniform highp vec3 _WorldSpaceCameraPos; uniform highp vec4 _ProjectionParams; uniform highp vec4 _ScreenParams; #line 7 uniform highp vec4 _ZBufferParams; uniform highp mat4 glstate_matrix_mvp; uniform highp mat4 glstate_matrix_modelview0; uniform highp mat4 glstate_matrix_invtrans_modelview0; #line 11 uniform highp mat4 _Object2World; uniform highp mat4 _World2Object; uniform highp vec4 unity_Scale; uniform highp mat4 glstate_matrix_transpose_modelview0; #line 15 uniform highp mat4 glstate_matrix_projection; #line 24 #line 42 #line 46 #line 50 uniform mediump float _GerstnerIntensity; #line 65 #line 93 #line 114 #line 130 uniform highp vec4 _DistortParams; uniform highp vec4 _BumpTiling; uniform highp vec4 _BumpDirection; uniform highp vec4 _GAmplitude; #line 134 uniform highp vec4 _GFrequency; uniform highp vec4 _GSteepness; uniform highp vec4 _GSpeed; uniform highp vec4 _GDirectionAB; #line 138 uniform highp vec4 _GDirectionCD; #line 35 highp vec4 ComputeScreenPos( in highp vec4 pos ) { #line 37 highp 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 highp vec4 pos, out highp vec4 screenPos, out highp vec4 grabPassPos ) { #line 59 highp 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 mediump vec3 GerstnerNormal4( in mediump vec2 xzVtx, in mediump vec4 amp, in mediump vec4 freq, in mediump vec4 speed, in mediump vec4 dirAB, in mediump vec4 dirCD ) { #line 102 mediump vec3 nrml = vec3( 0.0, 2.0, 0.0); mediump vec4 AB = ((freq.xxyy * amp.xxyy) * dirAB.xyzw); mediump vec4 CD = ((freq.zzww * amp.zzww) * dirCD.xyzw); mediump vec4 dotABCD = (freq.xyzw * vec4( dot( dirAB.xy, xzVtx), dot( dirAB.zw, xzVtx), dot( dirCD.xy, xzVtx), dot( dirCD.zw, xzVtx))); #line 106 mediump vec4 TIME = (_Time.yyyy * speed); mediump 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 mediump vec3 GerstnerOffset4( in mediump vec2 xzVtx, in mediump vec4 steepness, in mediump vec4 amp, in mediump vec4 freq, in mediump vec4 speed, in mediump vec4 dirAB, in mediump vec4 dirCD ) { #line 81 mediump vec3 offsets; mediump vec4 AB = ((steepness.xxyy * amp.xxyy) * dirAB.xyzw); mediump vec4 CD = ((steepness.zzww * amp.zzww) * dirCD.xyzw); mediump vec4 dotABCD = (freq.xyzw * vec4( dot( dirAB.xy, xzVtx), dot( dirAB.zw, xzVtx), dot( dirCD.xy, xzVtx), dot( dirCD.zw, xzVtx))); #line 85 mediump vec4 TIME = (_Time.yyyy * speed); mediump vec4 COS = cos((dotABCD + TIME)); mediump 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 mediump vec3 offs, out mediump vec3 nrml, in mediump vec3 vtx, in mediump vec3 tileableVtx, in mediump vec4 amplitude, in mediump vec4 frequency, in mediump vec4 steepness, in mediump vec4 speed, in mediump vec4 directionAB, in mediump 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; mediump vec3 worldSpaceVertex = (_Object2World * v.vertex).xyz; mediump vec3 vtxForAni = (worldSpaceVertex.xzz * unity_Scale.w); mediump vec3 nrml; #line 146 mediump vec3 offsets; Gerstner( offsets, nrml, v.vertex.xyz, vtxForAni, _GAmplitude, _GFrequency, _GSteepness, _GSpeed, _GDirectionAB, _GDirectionCD); v.vertex.xyz += offsets; mediump 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; } in highp vec4 xlat_attrib_POSITION; in highp vec4 TANGENT; in highp vec3 xlat_attrib_NORMAL; in highp vec4 xlat_attrib_TEXCOORD0; out highp vec4 xlv_TEXCOORD0; out highp vec4 xlv_TEXCOORD1; out highp vec4 xlv_TEXCOORD2; out highp vec4 xlv_TEXCOORD3; out highp vec4 xlv_TEXCOORD4; void main() { v2f xl_retval; appdata_full xlt_v; xlt_v.vertex = vec4(xlat_attrib_POSITION); xlt_v.tangent = vec4(TANGENT); xlt_v.normal = vec3(xlat_attrib_NORMAL); xlt_v.texcoord = vec4(xlat_attrib_TEXCOORD0); 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