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

62 lines
1.7 KiB
Plaintext

uniform sampler2D _BumpSpecMap;
uniform vec4 _Color;
uniform float _Cutoff;
uniform vec4 _LightColor0;
uniform sampler2D _LightTexture0;
uniform sampler2D _MainTex;
uniform float _ShadowStrength;
uniform vec3 _TranslucencyColor;
uniform sampler2D _TranslucencyMap;
uniform float _TranslucencyViewDependency;
varying vec2 xlv_TEXCOORD0;
varying vec4 xlv_COLOR0;
varying vec3 xlv_TEXCOORD1;
varying vec3 xlv_TEXCOORD2;
varying vec2 xlv_TEXCOORD3;
void main ()
{
vec4 c_1;
vec4 tmpvar_2;
tmpvar_2 = texture2D (_MainTex, xlv_TEXCOORD0);
vec4 tmpvar_3;
tmpvar_3 = texture2D (_TranslucencyMap, xlv_TEXCOORD0);
vec4 tmpvar_4;
tmpvar_4 = texture2D (_BumpSpecMap, xlv_TEXCOORD0);
vec4 normal_5;
normal_5.xy = ((tmpvar_4.wy * 2.0) - 1.0);
normal_5.z = sqrt(((1.0 -
(normal_5.x * normal_5.x)
) - (normal_5.y * normal_5.y)));
float x_6;
x_6 = (tmpvar_2.w - _Cutoff);
if ((x_6 < 0.0)) {
discard;
};
vec3 tmpvar_7;
tmpvar_7 = normalize(xlv_TEXCOORD2);
vec4 c_8;
float tmpvar_9;
tmpvar_9 = dot (normal_5.xyz, xlv_TEXCOORD1);
c_8.xyz = (((tmpvar_2.xyz * _Color.xyz) * xlv_COLOR0.w) * ((
((mix (clamp (
-(tmpvar_9)
, 0.0, 1.0), clamp (
dot (tmpvar_7, -(xlv_TEXCOORD1))
, 0.0, 1.0), _TranslucencyViewDependency) * tmpvar_3.z) * _TranslucencyColor)
* 2.0) + max (0.0,
((tmpvar_9 * 0.6) + 0.4)
)));
c_8.xyz = ((c_8.xyz * _LightColor0.xyz) + (pow (
max (0.0, dot (normal_5.xyz, normalize((xlv_TEXCOORD1 + tmpvar_7))))
,
(tmpvar_4.x * 128.0)
) * (tmpvar_3.w * _Color.x)));
c_8.xyz = (c_8.xyz * mix (2.0, (texture2D (_LightTexture0, xlv_TEXCOORD3).w * 2.0), _ShadowStrength));
c_1.xyz = c_8.xyz;
c_1.w = tmpvar_2.w;
gl_FragData[0] = c_1;
}
// inputs: 5, stats: 40 alu 5 tex 1 flow