bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-PrePassCollectShadows-out.txt
2014-02-10 23:06:13 -08:00

50 lines
1.4 KiB
Text

uniform sampler2D _CameraDepthTexture;
uniform vec4 _LightShadowData;
uniform vec4 _LightSplitsFar;
uniform vec4 _LightSplitsNear;
uniform sampler2D _ShadowMapTexture;
uniform mat4 _View2Shadow;
uniform mat4 _View2Shadow1;
uniform mat4 _View2Shadow2;
uniform mat4 _View2Shadow3;
uniform vec4 _ZBufferParams;
void main ()
{
vec4 res_1;
float tmpvar_2;
tmpvar_2 = (1.0/(((_ZBufferParams.x * texture2D (_CameraDepthTexture, gl_TexCoord[0].xy).x) + _ZBufferParams.y)));
vec4 tmpvar_3;
tmpvar_3.w = 1.0;
tmpvar_3.xyz = (gl_TexCoord[1].xyz * tmpvar_2);
vec4 tmpvar_4;
tmpvar_4 = (vec4(greaterThanEqual (tmpvar_3.zzzz, _LightSplitsNear)) * vec4(lessThan (tmpvar_3.zzzz, _LightSplitsFar)));
vec4 tmpvar_5;
tmpvar_5.w = 1.0;
tmpvar_5.xyz = (((
((_View2Shadow * tmpvar_3).xyz * tmpvar_4.x)
+
((_View2Shadow1 * tmpvar_3).xyz * tmpvar_4.y)
) + (
(_View2Shadow2 * tmpvar_3)
.xyz * tmpvar_4.z)) + ((_View2Shadow3 * tmpvar_3).xyz * tmpvar_4.w));
vec4 tmpvar_6;
tmpvar_6 = texture2D (_ShadowMapTexture, tmpvar_5.xy);
float tmpvar_7;
if ((tmpvar_6.x < tmpvar_5.z)) {
tmpvar_7 = _LightShadowData.x;
} else {
tmpvar_7 = 1.0;
};
res_1.x = tmpvar_7;
res_1.y = 1.0;
vec2 enc_8;
vec2 tmpvar_9;
tmpvar_9 = fract((vec2(1.0, 255.0) * (1.0 - tmpvar_2)));
enc_8.y = tmpvar_9.y;
enc_8.x = (tmpvar_9.x - (tmpvar_9.y * 0.00392157));
res_1.zw = enc_8;
gl_FragData[0] = res_1;
}
// inputs: 1, stats: 30 alu 2 tex 1 flow