vec2 xll_matrixindex_mf2x2_i (mat2 m, int i) { vec2 v; v.x=m[0][i]; v.y=m[1][i]; return v; } vec3 xll_matrixindex_mf3x3_i (mat3 m, int i) { vec3 v; v.x=m[0][i]; v.y=m[1][i]; v.z=m[2][i]; return v; } vec4 xll_matrixindex_mf4x4_i (mat4 m, int i) { vec4 v; v.x=m[0][i]; v.y=m[1][i]; v.z=m[2][i]; v.w=m[3][i]; return v; } #line 10 struct appdata_full { vec4 vertex; vec4 tangent; vec3 normal; vec4 texcoord; vec4 texcoord1; vec4 color; }; #line 105 struct v2f_surf { vec4 pos; vec2 hip_pack0; vec4 lop_color; vec3 lightDir; vec3 viewDir; vec2 _LightCoord; }; #line 1 uniform mat4 glstate_matrix_mvp; uniform mat4 glstate_matrix_modelview0; uniform mat4 glstate_matrix_invtrans_modelview0; uniform vec4 _Time; #line 5 uniform vec4 _ProjectionParams; uniform vec4 unity_Scale; uniform vec3 _WorldSpaceCameraPos; uniform vec4 _WorldSpaceLightPos0; #line 9 uniform mat4 _Object2World; uniform mat4 _World2Object; #line 20 #line 25 #line 30 uniform vec4 _LightColor0; uniform vec4 _SpecColor; uniform mat4 _LightMatrix0; #line 42 uniform vec4 _Scale; uniform vec4 _SquashPlaneNormal; uniform float _SquashAmount; #line 52 uniform vec4 _Wind; #line 101 uniform vec4 _Color; uniform vec3 _TranslucencyColor; uniform float _TranslucencyViewDependency; uniform float _ShadowStrength; #line 115 uniform vec4 _MainTex_ST; #line 20 vec3 ObjSpaceLightDir( in vec4 v ) { vec3 objSpaceLightPos = (_World2Object * _WorldSpaceLightPos0).xyz; return objSpaceLightPos.xyz; } #line 25 vec3 ObjSpaceViewDir( in vec4 v ) { vec3 objSpaceCameraPos = ((_World2Object * vec4( _WorldSpaceCameraPos.xyz, 1.0)).xyz * unity_Scale.w); return (objSpaceCameraPos - v.xyz); } #line 62 vec4 SmoothCurve( in vec4 x ) { #line 64 return ((x * x) * (3.0 - (2.0 * x))); } #line 66 vec4 TriangleWave( in vec4 x ) { #line 68 return abs(((fract((x + 0.5)) * 2.0) - 1.0)); } #line 70 vec4 SmoothTriangleWave( in vec4 x ) { #line 72 return SmoothCurve( TriangleWave( x)); } #line 74 vec4 AnimateVertex( in vec4 pos, in vec3 normal, in vec4 animParams ) { #line 76 float fDetailAmp = 0.1; float fBranchAmp = 0.3; float fObjPhase = dot( xll_matrixindex_mf4x4_i (_Object2World, 3).xyz, vec3( 1.0)); float fBranchPhase = (fObjPhase + animParams.x); #line 80 float fVtxPhase = dot( pos.xyz, vec3( (animParams.y + fBranchPhase))); vec2 vWavesIn = (_Time.yy + vec2( fVtxPhase, fBranchPhase)); vec4 vWaves = ((fract((vWavesIn.xxyy * vec4( 1.975, 0.793, 0.375, 0.193))) * 2.0) - 1.0); vWaves = SmoothTriangleWave( vWaves); #line 84 vec2 vWavesSum = (vWaves.xz + vWaves.yw); vec3 bend = ((animParams.y * fDetailAmp) * normal.xyz); bend.y = (animParams.w * fBranchAmp); pos.xyz += (((vWavesSum.xyx * bend) + ((_Wind.xyz * vWavesSum.y) * animParams.w)) * _Wind.w); #line 88 pos.xyz += (animParams.z * _Wind.xyz); return pos; } #line 53 void ExpandBillboard( in mat4 mat, inout vec4 pos, inout vec3 normal, inout vec4 tangent ) { float isBillboard = (1.0 - abs(tangent.w)); #line 56 vec3 norb = vec3( normalize((vec4( normal, 0.0) * mat))); vec3 tanb = vec3( normalize((vec4( tangent.xyz, 0.0) * mat))); pos += ((vec4( normal.xy, 0.0, 0.0) * mat) * isBillboard); normal = mix( normal, norb, vec3( isBillboard)); #line 60 tangent = mix( tangent, vec4( tanb, -1.0), vec4( isBillboard)); } #line 45 vec4 Squash( in vec4 pos ) { #line 47 vec3 planeNormal = _SquashPlaneNormal.xyz; vec3 projectedVertex = (pos.xyz - ((dot( planeNormal, vec3( pos)) + _SquashPlaneNormal.w) * planeNormal)); pos = vec4( mix( projectedVertex, pos.xyz, vec3( _SquashAmount)), 1.0); return pos; } #line 91 void TreeVertLeaf( inout appdata_full v ) { #line 93 ExpandBillboard( glstate_matrix_invtrans_modelview0, v.vertex, v.normal, v.tangent); v.vertex.xyz *= _Scale.xyz; v.vertex = AnimateVertex( v.vertex, v.normal, vec4( v.color.xy, v.texcoord1.xy)); v.vertex = Squash( v.vertex); #line 97 v.color = vec4( 1.0, 1.0, 1.0, v.color.w); v.normal = normalize(v.normal); v.tangent.xyz = normalize(v.tangent.xyz); } #line 116 v2f_surf xlat_main( in appdata_full v ) { v2f_surf o; #line 119 TreeVertLeaf( v); o.pos = (glstate_matrix_mvp * v.vertex); o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); o.lop_color = v.color; #line 123 vec3 binormal = (cross( v.normal, v.tangent.xyz) * v.tangent.w); mat3 rotation = mat3( v.tangent.x, v.tangent.y, v.tangent.z, binormal.x, binormal.y, binormal.z, v.normal.x, v.normal.y, v.normal.z); o.lightDir = (rotation * ObjSpaceLightDir( v.vertex)); o.viewDir = (rotation * ObjSpaceViewDir( v.vertex)); #line 127 o._LightCoord = (_LightMatrix0 * (_Object2World * v.vertex)).xy; return o; } attribute vec4 TANGENT; varying vec2 xlv_TEXCOORD0; varying vec4 xlv_COLOR0; varying vec3 xlv_TEXCOORD1; varying vec3 xlv_TEXCOORD2; varying vec2 xlv_TEXCOORD3; void main() { v2f_surf 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); xlt_v.texcoord1 = vec4(gl_MultiTexCoord1); xlt_v.color = vec4(gl_Color); xl_retval = xlat_main( xlt_v); gl_Position = vec4(xl_retval.pos); xlv_TEXCOORD0 = vec2(xl_retval.hip_pack0); xlv_COLOR0 = vec4(xl_retval.lop_color); xlv_TEXCOORD1 = vec3(xl_retval.lightDir); xlv_TEXCOORD2 = vec3(xl_retval.viewDir); xlv_TEXCOORD3 = vec2(xl_retval._LightCoord); } // uniforms: // _LightMatrix0: type 21 arrsize 0 // _MainTex_ST: type 12 arrsize 0 // _Object2World: type 21 arrsize 0 // _Scale: type 12 arrsize 0 // _SquashAmount: type 9 arrsize 0 // _SquashPlaneNormal: type 12 arrsize 0 // _Time: type 12 arrsize 0 // _Wind: type 12 arrsize 0 // _World2Object: type 21 arrsize 0 // _WorldSpaceCameraPos: type 11 arrsize 0 // _WorldSpaceLightPos0: type 12 arrsize 0 // glstate_matrix_invtrans_modelview0: type 21 arrsize 0 // glstate_matrix_mvp: type 21 arrsize 0 // unity_Scale: type 12 arrsize 0