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

34 lines
932 B
Text

uniform sampler2D _BumpMap;
uniform vec4 _Color;
uniform sampler2D _Illum;
uniform sampler2D _LightBuffer;
uniform sampler2D _MainTex;
uniform vec4 unity_Ambient;
void main ()
{
vec4 tmpvar_1;
tmpvar_1 = gl_TexCoord[0];
vec4 col_2;
vec4 light_3;
vec2 tmpvar_4;
vec4 tmpvar_5;
tmpvar_5 = (texture2D (_MainTex, tmpvar_1.xy) * _Color);
vec4 normal_6;
normal_6.xy = ((texture2D (_BumpMap, tmpvar_4).wy * 2.0) - 1.0);
normal_6.z = sqrt(((1.0 -
(normal_6.x * normal_6.x)
) - (normal_6.y * normal_6.y)));
vec4 tmpvar_7;
tmpvar_7 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1])));
light_3.w = tmpvar_7.w;
light_3.xyz = (tmpvar_7.xyz + unity_Ambient.xyz);
vec4 c_8;
c_8.xyz = (tmpvar_5.xyz * light_3.xyz);
c_8.w = tmpvar_5.w;
col_2.w = c_8.w;
col_2.xyz = (c_8.xyz + (tmpvar_5.xyz * texture2D (_Illum, tmpvar_1.zw).w));
gl_FragData[0] = col_2;
}
// inputs: 1, stats: 14 alu 4 tex 0 flow