void xll_clip_f(float x) { if ( x<0.0 ) discard; } void xll_clip_vf2(vec2 x) { if (any(lessThan(x,vec2(0.0)))) discard; } void xll_clip_vf3(vec3 x) { if (any(lessThan(x,vec3(0.0)))) discard; } void xll_clip_vf4(vec4 x) { if (any(lessThan(x,vec4(0.0)))) discard; } 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 16 struct LeafSurfaceOutput { mediump vec3 Albedo; mediump vec3 Normal; mediump vec3 Emission; mediump float Translucency; mediump float ShadowOffset; mediump float Specular; mediump float Gloss; mediump float Alpha; }; #line 47 struct Input { highp vec2 uv_MainTex; highp vec4 color; }; #line 66 struct v2f_surf { highp vec4 pos; highp vec2 hip_pack0; highp vec4 lop_color; highp vec3 lightDir; highp vec3 viewDir; highp vec2 _LightCoord; }; #line 1 uniform highp vec4 _LightColor0; #line 9 uniform highp vec4 _SpecColor; uniform sampler2D _LightTexture0; uniform highp mat4 _LightMatrix0; uniform highp vec4 _Color; #line 13 uniform mediump vec3 _TranslucencyColor; uniform mediump float _TranslucencyViewDependency; uniform mediump float _ShadowStrength; #line 28 #line 44 uniform sampler2D _MainTex; uniform sampler2D _BumpSpecMap; uniform sampler2D _TranslucencyMap; #line 53 #line 76 uniform highp float _Cutoff; #line 28 mediump vec4 LightingTreeLeaf( in LeafSurfaceOutput s, in mediump vec3 lightDir, in mediump vec3 viewDir, in mediump float atten ) { mediump vec3 h = normalize((lightDir + viewDir)); mediump float nl = dot( s.Normal, lightDir); #line 32 mediump float nh = max( 0.0, dot( s.Normal, h)); mediump float spec = (pow( nh, (s.Specular * 128.0)) * s.Gloss); mediump float backContrib = xll_saturate_f(dot( viewDir, (-lightDir))); backContrib = mix( xll_saturate_f((-nl)), backContrib, _TranslucencyViewDependency); #line 36 mediump vec3 translucencyColor = ((backContrib * s.Translucency) * _TranslucencyColor); nl = max( 0.0, ((nl * 0.6) + 0.4)); mediump vec4 c; c.xyz = (s.Albedo * ((translucencyColor * 2.0) + nl)); #line 40 c.xyz = ((c.xyz * _LightColor0.xyz) + spec); c.xyz *= mix( 2.0, (atten * 2.0), _ShadowStrength); return c; } #line 1 mediump vec4 UnpackNormal( in mediump vec4 packednormal ) { mediump vec4 normal; normal.xy = ((packednormal.wy * 2.0) - 1.0); #line 5 normal.z = sqrt(((1.0 - (normal.x * normal.x)) - (normal.y * normal.y))); return normal; } #line 53 void surf( in Input IN, inout LeafSurfaceOutput o ) { mediump vec4 c = texture( _MainTex, IN.uv_MainTex); o.Albedo = ((c.xyz * _Color.xyz) * IN.color.w); #line 57 mediump vec4 trngls = texture( _TranslucencyMap, IN.uv_MainTex); o.Translucency = trngls.z; o.Gloss = (trngls.w * _Color.x); o.Alpha = c.w; #line 61 mediump vec4 norspc = texture( _BumpSpecMap, IN.uv_MainTex); o.Specular = norspc.x; o.ShadowOffset = norspc.z; o.Normal = vec3( UnpackNormal( norspc)); } #line 77 mediump vec4 xlat_main( in v2f_surf IN ) { Input surfIN; #line 80 surfIN.uv_MainTex = IN.hip_pack0.xy; surfIN.color = IN.lop_color; LeafSurfaceOutput o; o.Albedo = vec3( 0.0); #line 84 o.Emission = vec3( 0.0); o.Specular = 0.0; o.Alpha = 0.0; surf( surfIN, o); #line 88 xll_clip_f((o.Alpha - _Cutoff)); mediump vec3 lightDir = IN.lightDir; mediump vec4 c = LightingTreeLeaf( o, lightDir, normalize(IN.viewDir), (texture( _LightTexture0, IN._LightCoord).w * 1.0)); c.w = o.Alpha; #line 92 return c; } in highp vec2 xlv_TEXCOORD0; in highp vec4 xlv_COLOR0; in highp vec3 xlv_TEXCOORD1; in highp vec3 xlv_TEXCOORD2; in highp vec2 xlv_TEXCOORD3; void main() { mediump vec4 xl_retval; v2f_surf xlt_IN; xlt_IN.pos = vec4(0.0); xlt_IN.hip_pack0 = vec2(xlv_TEXCOORD0); xlt_IN.lop_color = vec4(xlv_COLOR0); xlt_IN.lightDir = vec3(xlv_TEXCOORD1); xlt_IN.viewDir = vec3(xlv_TEXCOORD2); xlt_IN._LightCoord = vec2(xlv_TEXCOORD3); xl_retval = xlat_main( xlt_IN); gl_FragData[0] = vec4(xl_retval); } // uniforms: // _BumpSpecMap: type 25 arrsize 0 // _Color: type 12 arrsize 0 // _Cutoff: type 9 arrsize 0 // _LightColor0: type 12 arrsize 0 // _LightTexture0: type 25 arrsize 0 // _MainTex: type 25 arrsize 0 // _ShadowStrength: type 9 arrsize 0 // _TranslucencyColor: type 11 arrsize 0 // _TranslucencyMap: type 25 arrsize 0 // _TranslucencyViewDependency: type 9 arrsize 0