bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Unlit-out.txt
2014-10-11 12:32:43 -07:00

39 lines
1.1 KiB
Plaintext

uniform sampler2D _BumpMap;
uniform samplerCube _Cube;
uniform sampler2D _MainTex;
uniform vec4 _ReflectColor;
void main ()
{
vec3 tmpvar_1;
tmpvar_1 = gl_TexCoord[2].xyz;
vec4 c_2;
vec3 wn_3;
vec4 normal_4;
normal_4.xy = ((texture2D (_BumpMap, gl_TexCoord[1].xy).wy * 2.0) - 1.0);
normal_4.z = sqrt(((1.0 -
(normal_4.x * normal_4.x)
) - (normal_4.y * normal_4.y)));
vec4 tmpvar_5;
tmpvar_5 = texture2D (_MainTex, gl_TexCoord[0].xy);
wn_3.x = dot (gl_TexCoord[3].xyz, normal_4.xyz);
wn_3.y = dot (gl_TexCoord[4].xyz, normal_4.xyz);
wn_3.z = dot (gl_TexCoord[5].xyz, normal_4.xyz);
c_2 = (gl_LightModel.ambient * tmpvar_5);
c_2.xyz = (c_2.xyz * 2.0);
gl_FragData[0] = (c_2 + ((textureCube (_Cube,
(tmpvar_1 - (2.0 * (dot (wn_3, tmpvar_1) * wn_3)))
) * _ReflectColor) * tmpvar_5.w));
}
// stats: 19 alu 3 tex 0 flow
// inputs: 1
// #0: gl_TexCoord (high float) 4x1 [6] loc 4
// uniforms: 2 (total size: 0)
// #0: gl_LightModel (high other) 0x0 [-1]
// #1: _ReflectColor (high float) 4x1 [-1]
// textures: 3
// #0: _BumpMap (high 2d) 0x0 [-1]
// #1: _Cube (high cube) 0x0 [-1]
// #2: _MainTex (high 2d) 0x0 [-1]