#line 2 struct v2f { highp vec4 pos; highp vec2 uv; highp vec3 ray; }; #line 8 uniform sampler2D _CameraDepthTexture; uniform highp vec4 unity_LightmapFade; uniform highp mat4 _View2Shadow; #line 12 uniform highp mat4 _View2Shadow1; uniform highp mat4 _View2Shadow2; uniform highp mat4 _View2Shadow3; uniform highp vec4 _LightSplitsNear; #line 16 uniform highp vec4 _LightSplitsFar; uniform highp vec4 _LightShadowData; uniform sampler2D _ShadowMapTexture; #line 20 uniform highp vec4 _ZBufferParams; #line 37 #line 54 #line 27 highp vec2 EncodeFloatRG( in highp float v ) { #line 29 highp vec2 kEncodeMul = vec2( 1.0, 255.0); highp float kEncodeBit = 0.003921569; highp vec2 enc = (kEncodeMul * v); enc = fract(enc); #line 33 enc.x -= (enc.y * kEncodeBit); return enc; } #line 22 highp float Linear01Depth( in highp float z ) { #line 24 return (1.0 / ((_ZBufferParams.x * z) + _ZBufferParams.y)); } #line 37 mediump float unitySampleShadow( in highp vec4 eyePos ) { highp vec3 sc0 = (_View2Shadow * eyePos).xyz; highp vec3 sc1 = (_View2Shadow1 * eyePos).xyz; #line 41 highp vec3 sc2 = (_View2Shadow2 * eyePos).xyz; highp vec3 sc3 = (_View2Shadow3 * eyePos).xyz; highp float z = eyePos.z; #line 46 highp vec4 near = vec4(greaterThanEqual( vec4( z ), _LightSplitsNear)); highp vec4 far = vec4(lessThan( vec4( z ), _LightSplitsFar)); highp vec4 weights = (near * far); highp vec4 coord = vec4( ((((sc0 * weights.x) + (sc1 * weights.y)) + (sc2 * weights.z)) + (sc3 * weights.w)), 1.0); #line 50 mediump float shadow = (( (texture( _ShadowMapTexture, coord.xy).x < coord.z) ) ? ( _LightShadowData.x ) : ( 1.0 )); return shadow; } #line 54 mediump vec4 xlat_main( in v2f i ) { highp float depth = texture( _CameraDepthTexture, i.uv).x; depth = Linear01Depth( depth); #line 58 highp vec4 vpos = vec4( (i.ray * depth), 1.0); mediump float shadow = unitySampleShadow( vpos); highp vec4 res; res.x = shadow; #line 62 res.y = 1.0; res.zw = EncodeFloatRG( (1.0 - depth)); return res; } in highp vec2 xlv_TEXCOORD0; in highp vec3 xlv_TEXCOORD1; void main() { mediump vec4 xl_retval; v2f xlt_i; xlt_i.pos = vec4(0.0); xlt_i.uv = vec2(xlv_TEXCOORD0); xlt_i.ray = vec3(xlv_TEXCOORD1); xl_retval = xlat_main( xlt_i); gl_FragData[0] = vec4(xl_retval); } // uniforms: // _CameraDepthTexture: type 25 arrsize 0 // _LightShadowData: type 12 arrsize 0 // _LightSplitsFar: type 12 arrsize 0 // _LightSplitsNear: type 12 arrsize 0 // _ShadowMapTexture: type 25 arrsize 0 // _View2Shadow: type 21 arrsize 0 // _View2Shadow1: type 21 arrsize 0 // _View2Shadow2: type 21 arrsize 0 // _View2Shadow3: type 21 arrsize 0 // _ZBufferParams: type 12 arrsize 0