bgfx/3rdparty/glsl-optimizer/tests/fragment/unity-Transparent_Cutout_Specular1-out.txt

45 lines
1.3 KiB
Text
Raw Normal View History

2012-04-03 23:30:07 -04:00
uniform vec4 _SpecColor;
uniform float _Shininess;
uniform sampler2D _MainTex;
uniform sampler2D _LightTextureB0;
uniform samplerCube _LightTexture0;
uniform vec4 _LightColor0;
uniform float _Cutoff;
uniform vec4 _Color;
void main ()
{
vec3 tmpvar_1;
tmpvar_1 = gl_TexCoord[1].xyz;
vec3 tmpvar_2;
tmpvar_2 = gl_TexCoord[2].xyz;
vec3 tmpvar_3;
tmpvar_3 = gl_TexCoord[3].xyz;
vec3 tmpvar_4;
tmpvar_4 = gl_TexCoord[4].xyz;
vec4 c;
vec4 tmpvar_5;
tmpvar_5 = texture2D (_MainTex, gl_TexCoord[0].xy);
vec3 tmpvar_6;
tmpvar_6 = (tmpvar_5.xyz * _Color.xyz);
float tmpvar_7;
tmpvar_7 = (tmpvar_5.w * _Color.w);
float x;
x = (tmpvar_7 - _Cutoff);
if ((x < 0.0)) {
discard;
};
vec3 tmpvar_8;
tmpvar_8 = normalize (tmpvar_2);
float atten;
atten = (texture2D (_LightTextureB0, vec2(dot (tmpvar_4, tmpvar_4))).w * textureCube (_LightTexture0, tmpvar_4).w);
vec4 c_i0;
float tmpvar_9;
tmpvar_9 = (pow (max (0.0, dot (tmpvar_1, normalize ((tmpvar_8 + normalize (tmpvar_3))))), (_Shininess * 128.0)) * tmpvar_5.w);
c_i0.xyz = ((((tmpvar_6 * _LightColor0.xyz) * max (0.0, dot (tmpvar_1, tmpvar_8))) + ((_LightColor0.xyz * _SpecColor.xyz) * tmpvar_9)) * (atten * 2.0));
c_i0.w = (tmpvar_7 + (((_LightColor0.w * _SpecColor.w) * tmpvar_9) * atten));
c = c_i0;
c.w = tmpvar_7;
gl_FragData[0] = c;
}