bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular2-out.txt

56 lines
1.6 KiB
Text
Raw Normal View History

2012-10-07 23:41:18 -04:00
uniform sampler2D _BumpMap;
2014-02-11 02:06:13 -05:00
uniform vec4 _Color;
uniform samplerCube _Cube;
uniform sampler2D _LightBuffer;
uniform sampler2D _MainTex;
uniform vec4 _ReflectColor;
uniform vec4 _SpecColor;
uniform vec4 unity_Ambient;
2012-10-07 23:41:18 -04:00
void main ()
{
vec4 tmpvar_1;
tmpvar_1 = gl_TexCoord[0];
vec4 tmpvar_2;
tmpvar_2 = gl_TexCoord[2];
vec4 tmpvar_3;
tmpvar_3 = gl_TexCoord[3];
vec4 tmpvar_4;
tmpvar_4 = gl_TexCoord[4];
vec4 col_5;
vec4 light_6;
vec3 tmpvar_7;
tmpvar_7.x = tmpvar_2.w;
tmpvar_7.y = tmpvar_3.w;
tmpvar_7.z = tmpvar_4.w;
vec4 tmpvar_8;
tmpvar_8 = texture2D (_MainTex, tmpvar_1.xy);
vec4 normal_9;
normal_9.xy = ((texture2D (_BumpMap, tmpvar_1.zw).wy * 2.0) - 1.0);
2014-02-11 02:06:13 -05:00
normal_9.z = sqrt(((1.0 -
(normal_9.x * normal_9.x)
) - (normal_9.y * normal_9.y)));
2012-10-07 23:41:18 -04:00
vec3 tmpvar_10;
tmpvar_10.x = dot (tmpvar_2.xyz, normal_9.xyz);
tmpvar_10.y = dot (tmpvar_3.xyz, normal_9.xyz);
tmpvar_10.z = dot (tmpvar_4.xyz, normal_9.xyz);
vec4 tmpvar_11;
2014-02-11 02:06:13 -05:00
tmpvar_11 = (textureCube (_Cube, (tmpvar_7 - (2.0 *
(dot (tmpvar_10, tmpvar_7) * tmpvar_10)
))) * tmpvar_8.w);
2012-10-07 23:41:18 -04:00
vec4 tmpvar_12;
tmpvar_12 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1])));
light_6.w = tmpvar_12.w;
light_6.xyz = (tmpvar_12.xyz + unity_Ambient.xyz);
vec4 c_13;
float tmpvar_14;
tmpvar_14 = (tmpvar_12.w * tmpvar_8.w);
c_13.xyz = (((tmpvar_8 * _Color).xyz * light_6.xyz) + ((light_6.xyz * _SpecColor.xyz) * tmpvar_14));
c_13.w = ((tmpvar_11.w * _ReflectColor.w) + (tmpvar_14 * _SpecColor.w));
col_5.w = c_13.w;
col_5.xyz = (c_13.xyz + (tmpvar_11.xyz * _ReflectColor.xyz));
gl_FragData[0] = col_5;
}
2014-02-11 02:06:13 -05:00
// inputs: 1, stats: 29 alu 4 tex 0 flow