bgfx/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-outES3.txt
2015-04-02 23:30:48 -07:00

68 lines
1.9 KiB
Plaintext

#version 300 es
out lowp vec4 _fragData;
uniform sampler2D _BumpMap;
uniform mediump vec4 _Color;
uniform mediump vec4 _LightColor0;
uniform sampler2D _MainTex;
uniform highp float _Shininess;
uniform mediump vec4 _SpecColor;
in highp vec4 _uv0;
in mediump vec3 _uv1;
in mediump vec3 _uv2;
in mediump vec3 _uv3;
void main ()
{
mediump vec4 c_1;
mediump vec3 tmpvar_2;
mediump float tmpvar_3;
lowp vec4 tmpvar_4;
tmpvar_4 = texture (_MainTex, _uv0.xy);
tmpvar_2 = (tmpvar_4.xyz * _Color.xyz);
tmpvar_3 = (tmpvar_4.w * _Color.w);
lowp vec4 tmpvar_5;
tmpvar_5 = texture (_BumpMap, _uv0.zw);
mediump vec4 packednormal_6;
packednormal_6 = tmpvar_5;
mediump vec4 normal_7;
normal_7.xy = ((packednormal_6.wy * 2.0) - 1.0);
normal_7.z = sqrt(((1.0 -
(normal_7.x * normal_7.x)
) - (normal_7.y * normal_7.y)));
mediump vec4 c_8;
lowp float spec_9;
mediump float tmpvar_10;
tmpvar_10 = pow (max (0.0, dot (normal_7.xyz,
normalize((_uv2 + normalize(_uv1)))
)), (_Shininess * 128.0));
spec_9 = (tmpvar_10 * tmpvar_4.w);
c_8.xyz = (((
(tmpvar_2 * _LightColor0.xyz)
*
max (0.0, dot (normal_7.xyz, _uv2))
) + (
(_LightColor0.xyz * _SpecColor.xyz)
* spec_9)) * 2.0);
c_8.w = (tmpvar_3 + ((_LightColor0.w * _SpecColor.w) * spec_9));
c_1.xyz = (c_8.xyz + (tmpvar_2 * _uv3));
c_1.w = tmpvar_3;
lowp vec4 tmpvar_11;
tmpvar_11 = c_1;
_fragData = tmpvar_11;
}
// stats: 30 alu 2 tex 0 flow
// inputs: 4
// #0: _uv0 (high float) 4x1 [-1]
// #1: _uv1 (medium float) 3x1 [-1]
// #2: _uv2 (medium float) 3x1 [-1]
// #3: _uv3 (medium float) 3x1 [-1]
// uniforms: 4 (total size: 0)
// #0: _Color (medium float) 4x1 [-1]
// #1: _LightColor0 (medium float) 4x1 [-1]
// #2: _Shininess (high float) 1x1 [-1]
// #3: _SpecColor (medium float) 4x1 [-1]
// textures: 2
// #0: _BumpMap (low 2d) 0x0 [-1]
// #1: _MainTex (low 2d) 0x0 [-1]