bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Shadow-ScreenBlur-out.txt
2014-10-11 12:32:43 -07:00

79 lines
3 KiB
Text

uniform vec4 _BlurOffsets[8];
uniform sampler2D _MainTex;
uniform vec4 unity_ShadowBlurParams;
void main ()
{
float diff_1;
float radius_2;
float dist_3;
vec4 mask_4;
vec4 tmpvar_5;
tmpvar_5.zw = vec2(0.0, 0.0);
tmpvar_5.xy = gl_TexCoord[0].xy;
vec4 tmpvar_6;
tmpvar_6 = texture2D (_MainTex, tmpvar_5.xy);
mask_4.zw = tmpvar_6.zw;
dist_3 = (tmpvar_6.z + (tmpvar_6.w / 255.0));
radius_2 = clamp ((unity_ShadowBlurParams.y / (1.0 - dist_3)), 0.0, 1.0);
mask_4.xy = (tmpvar_6.xy * unity_ShadowBlurParams.x);
vec4 tmpvar_7;
tmpvar_7 = texture2D (_MainTex, (tmpvar_5 + (radius_2 * _BlurOffsets[0])).xy);
diff_1 = (dist_3 - (tmpvar_7.z + (tmpvar_7.w / 255.0)));
mask_4.xy = (mask_4.xy + (clamp (
(unity_ShadowBlurParams.x - abs(diff_1))
, 0.0, 1.0) * tmpvar_7.xy));
vec4 tmpvar_8;
tmpvar_8 = texture2D (_MainTex, (tmpvar_5 + (radius_2 * _BlurOffsets[1])).xy);
diff_1 = (dist_3 - (tmpvar_8.z + (tmpvar_8.w / 255.0)));
mask_4.xy = (mask_4.xy + (clamp (
(unity_ShadowBlurParams.x - abs(diff_1))
, 0.0, 1.0) * tmpvar_8.xy));
vec4 tmpvar_9;
tmpvar_9 = texture2D (_MainTex, (tmpvar_5 + (radius_2 * _BlurOffsets[2])).xy);
diff_1 = (dist_3 - (tmpvar_9.z + (tmpvar_9.w / 255.0)));
mask_4.xy = (mask_4.xy + (clamp (
(unity_ShadowBlurParams.x - abs(diff_1))
, 0.0, 1.0) * tmpvar_9.xy));
vec4 tmpvar_10;
tmpvar_10 = texture2D (_MainTex, (tmpvar_5 + (radius_2 * _BlurOffsets[3])).xy);
diff_1 = (dist_3 - (tmpvar_10.z + (tmpvar_10.w / 255.0)));
mask_4.xy = (mask_4.xy + (clamp (
(unity_ShadowBlurParams.x - abs(diff_1))
, 0.0, 1.0) * tmpvar_10.xy));
vec4 tmpvar_11;
tmpvar_11 = texture2D (_MainTex, (tmpvar_5 + (radius_2 * _BlurOffsets[4])).xy);
diff_1 = (dist_3 - (tmpvar_11.z + (tmpvar_11.w / 255.0)));
mask_4.xy = (mask_4.xy + (clamp (
(unity_ShadowBlurParams.x - abs(diff_1))
, 0.0, 1.0) * tmpvar_11.xy));
vec4 tmpvar_12;
tmpvar_12 = texture2D (_MainTex, (tmpvar_5 + (radius_2 * _BlurOffsets[5])).xy);
diff_1 = (dist_3 - (tmpvar_12.z + (tmpvar_12.w / 255.0)));
mask_4.xy = (mask_4.xy + (clamp (
(unity_ShadowBlurParams.x - abs(diff_1))
, 0.0, 1.0) * tmpvar_12.xy));
vec4 tmpvar_13;
tmpvar_13 = texture2D (_MainTex, (tmpvar_5 + (radius_2 * _BlurOffsets[6])).xy);
diff_1 = (dist_3 - (tmpvar_13.z + (tmpvar_13.w / 255.0)));
mask_4.xy = (mask_4.xy + (clamp (
(unity_ShadowBlurParams.x - abs(diff_1))
, 0.0, 1.0) * tmpvar_13.xy));
vec4 tmpvar_14;
tmpvar_14 = texture2D (_MainTex, (tmpvar_5 + (radius_2 * _BlurOffsets[7])).xy);
diff_1 = (dist_3 - (tmpvar_14.z + (tmpvar_14.w / 255.0)));
float tmpvar_15;
tmpvar_15 = clamp ((unity_ShadowBlurParams.x - abs(diff_1)), 0.0, 1.0);
diff_1 = tmpvar_15;
mask_4.xy = (mask_4.xy + (tmpvar_15 * tmpvar_14.xy));
gl_FragData[0] = vec4((mask_4.x / mask_4.y));
}
// stats: 88 alu 9 tex 0 flow
// inputs: 1
// #0: gl_TexCoord (high float) 4x1 [1] loc 4
// uniforms: 2 (total size: 0)
// #0: _BlurOffsets (high float) 4x1 [8]
// #1: unity_ShadowBlurParams (high float) 4x1 [-1]
// textures: 1
// #0: _MainTex (high 2d) 0x0 [-1]