bgfx/3rdparty/glsl-optimizer/tests/fragment/unity-Transparent_Cutout_Bumped_Specular-out.txt
Branimir Karadzic dee3fe5266 Initial commit.
2012-04-03 20:30:07 -07:00

35 lines
896 B
Text

uniform float _Shininess;
uniform sampler2D _MainTex;
uniform float _Cutoff;
uniform vec4 _Color;
uniform sampler2D _BumpMap;
void main ()
{
vec4 tmpvar_1;
tmpvar_1 = gl_TexCoord[0];
vec3 tmpvar_2;
tmpvar_2 = gl_TexCoord[1].xyz;
vec3 tmpvar_3;
tmpvar_3 = gl_TexCoord[2].xyz;
vec3 tmpvar_4;
tmpvar_4 = gl_TexCoord[3].xyz;
vec4 res;
vec3 viewN;
vec4 normal;
normal.xy = ((texture2D (_BumpMap, tmpvar_1.zw).wy * 2.0) - 1.0);
normal.z = sqrt (((1.0 - (normal.x * normal.x)) - (normal.y * normal.y)));
vec3 tmpvar_5;
tmpvar_5 = normal.xyz;
float x;
x = ((texture2D (_MainTex, tmpvar_1.xy).w * _Color.w) - _Cutoff);
if ((x < 0.0)) {
discard;
};
viewN.x = dot (tmpvar_2, tmpvar_5);
viewN.y = dot (tmpvar_3, tmpvar_5);
viewN.z = dot (tmpvar_4, tmpvar_5);
res.xyz = ((viewN * vec3(0.5, 0.5, -0.5)) + 0.5);
res.w = _Shininess;
gl_FragData[0] = res;
}