
µ    g                DIRECTIONAL   SHADOWS_SCREEN  !!GLSL#version 120

#ifdef VERTEX
uniform vec4 _ProjectionParams;


uniform float _LightAsQuad;
varying vec4 xlv_TEXCOORD0;
varying vec3 xlv_TEXCOORD1;
void main ()
{
  vec4 tmpvar_1;
  vec3 tmpvar_2;
  tmpvar_1 = (gl_ModelViewProjectionMatrix * gl_Vertex);
  vec4 o_3;
  vec4 tmpvar_4;
  tmpvar_4 = (tmpvar_1 * 0.5);
  vec2 tmpvar_5;
  tmpvar_5.x = tmpvar_4.x;
  tmpvar_5.y = (tmpvar_4.y * _ProjectionParams.x);
  o_3.xy = (tmpvar_5 + tmpvar_4.w);
  o_3.zw = tmpvar_1.zw;
  tmpvar_2 = ((gl_ModelViewMatrix * gl_Vertex).xyz * vec3(-1.0, -1.0, 1.0));
  vec3 tmpvar_6;
  tmpvar_6 = mix (tmpvar_2, gl_Normal, vec3(_LightAsQuad));
  tmpvar_2 = tmpvar_6;
  gl_Position = tmpvar_1;
  xlv_TEXCOORD0 = o_3;
  xlv_TEXCOORD1 = tmpvar_6;
}


#endif
#ifdef FRAGMENT
uniform vec3 _WorldSpaceCameraPos;
uniform vec4 _ProjectionParams;
uniform vec4 _ZBufferParams;
uniform vec4 _LightShadowData;
uniform vec4 unity_ShadowFadeCenterAndType;
uniform sampler2D _CameraDepthTexture;
uniform vec4 _LightDir;
uniform vec4 _LightColor;
uniform mat4 _CameraToWorld;
uniform sampler2D _ShadowMapTexture;
uniform vec4 unity_LightGammaCorrectionConsts;
uniform sampler2D _CameraGBufferTexture0;
uniform sampler2D _CameraGBufferTexture1;
uniform sampler2D _CameraGBufferTexture2;
varying vec4 xlv_TEXCOORD0;
varying vec3 xlv_TEXCOORD1;
void main ()
{
  vec3 tmpvar_1;
  vec3 lightDir_2;
  vec2 tmpvar_3;
  tmpvar_3 = (xlv_TEXCOORD0.xy / xlv_TEXCOORD0.w);
  vec4 tmpvar_4;
  tmpvar_4.w = 1.0;
  tmpvar_4.xyz = ((xlv_TEXCOORD1 * (_ProjectionParams.z / xlv_TEXCOORD1.z)) * (1.0/((
    (_ZBufferParams.x * texture2D (_CameraDepthTexture, tmpvar_3).x)
   + _ZBufferParams.y))));
  vec3 tmpvar_5;
  tmpvar_5 = (_CameraToWorld * tmpvar_4).xyz;
  vec3 tmpvar_6;
  tmpvar_6 = (tmpvar_5 - unity_ShadowFadeCenterAndType.xyz);
  lightDir_2 = -(_LightDir.xyz);
  vec4 tmpvar_7;
  tmpvar_7 = texture2D (_CameraGBufferTexture1, tmpvar_3);
  tmpvar_1 = (_LightColor.xyz * clamp ((texture2D (_ShadowMapTexture, tmpvar_3).x + 
    clamp (((mix (tmpvar_4.z, 
      sqrt(dot (tmpvar_6, tmpvar_6))
    , unity_ShadowFadeCenterAndType.w) * _LightShadowData.z) + _LightShadowData.w), 0.0, 1.0)
  ), 0.0, 1.0));
  vec3 tmpvar_8;
  tmpvar_8 = normalize(((texture2D (_CameraGBufferTexture2, tmpvar_3).xyz * 2.0) - 1.0));
  float tmpvar_9;
  tmpvar_9 = max (0.0, dot (tmpvar_8, lightDir_2));
  vec3 viewDir_10;
  viewDir_10 = -(normalize((tmpvar_5 - _WorldSpaceCameraPos)));
  float tmpvar_11;
  tmpvar_11 = (1.0 - tmpvar_7.w);
  vec3 tmpvar_12;
  vec3 inVec_13;
  inVec_13 = (lightDir_2 + viewDir_10);
  tmpvar_12 = (inVec_13 * inversesqrt(max (0.001, 
    dot (inVec_13, inVec_13)
  )));
  float tmpvar_14;
  tmpvar_14 = max (0.0, dot (tmpvar_8, viewDir_10));
  float tmpvar_15;
  tmpvar_15 = max (0.0, dot (lightDir_2, tmpvar_12));
  float tmpvar_16;
  tmpvar_16 = ((tmpvar_11 * tmpvar_11) * unity_LightGammaCorrectionConsts.w);
  float tmpvar_17;
  float tmpvar_18;
  tmpvar_18 = (10.0 / log2((
    ((1.0 - tmpvar_11) * 0.968)
   + 0.03)));
  tmpvar_17 = (tmpvar_18 * tmpvar_18);
  float x_19;
  x_19 = (1.0 - tmpvar_9);
  float x_20;
  x_20 = (1.0 - tmpvar_14);
  float tmpvar_21;
  tmpvar_21 = (0.5 + ((2.0 * tmpvar_15) * (tmpvar_15 * tmpvar_11)));
  float x_22;
  x_22 = (1.0 - tmpvar_15);
  vec4 tmpvar_23;
  tmpvar_23.w = 1.0;
  tmpvar_23.xyz = ((texture2D (_CameraGBufferTexture0, tmpvar_3).xyz * (tmpvar_1 * 
    (((1.0 + (
      (tmpvar_21 - 1.0)
     * 
      ((x_19 * x_19) * ((x_19 * x_19) * x_19))
    )) * (1.0 + (
      (tmpvar_21 - 1.0)
     * 
      ((x_20 * x_20) * ((x_20 * x_20) * x_20))
    ))) * tmpvar_9)
  )) + ((
    max (0.0, (((
      (1.0/((((
        (tmpvar_9 * (1.0 - tmpvar_16))
       + tmpvar_16) * (
        (tmpvar_14 * (1.0 - tmpvar_16))
       + tmpvar_16)) + 0.0001)))
     * 
      (pow (max (0.0, dot (tmpvar_8, tmpvar_12)), tmpvar_17) * ((tmpvar_17 + 1.0) * unity_LightGammaCorrectionConsts.y))
    ) * tmpvar_9) * unity_LightGammaCorrectionConsts.x))
   * tmpvar_1) * (tmpvar_7.xyz + 
    ((1.0 - tmpvar_7.xyz) * ((x_22 * x_22) * ((x_22 * x_22) * x_22)))
  )));
  gl_FragData[0] = exp2(-(tmpvar_23));
}


#endif
                          