bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Diffuse1-out.txt

73 lines
2.2 KiB
Text
Raw Normal View History

2012-10-07 23:41:18 -04:00
uniform sampler2D _BumpMap;
2014-02-11 02:06:13 -05:00
uniform vec4 _Color;
uniform samplerCube _Cube;
uniform sampler2D _LightBuffer;
uniform sampler2D _MainTex;
uniform float _Parallax;
uniform sampler2D _ParallaxMap;
uniform vec4 _ReflectColor;
uniform vec4 unity_Ambient;
2012-10-07 23:41:18 -04:00
void main ()
{
vec4 tmpvar_1;
tmpvar_1 = gl_TexCoord[0];
vec4 tmpvar_2;
tmpvar_2 = gl_TexCoord[3];
vec4 tmpvar_3;
tmpvar_3 = gl_TexCoord[4];
vec4 tmpvar_4;
tmpvar_4 = gl_TexCoord[5];
vec4 col_5;
vec4 light_6;
vec3 tmpvar_7;
tmpvar_7.x = tmpvar_2.w;
tmpvar_7.y = tmpvar_3.w;
tmpvar_7.z = tmpvar_4.w;
2014-10-11 15:32:43 -04:00
vec4 reflcol_8;
vec2 tmpvar_9;
vec3 v_10;
vec3 tmpvar_11;
tmpvar_11 = normalize(gl_TexCoord[1].xyz);
v_10.xy = tmpvar_11.xy;
v_10.z = (tmpvar_11.z + 0.42);
tmpvar_9 = (((texture2D (_ParallaxMap, tmpvar_1.zw).w * _Parallax) - (_Parallax / 2.0)) * (tmpvar_11.xy / v_10.z));
vec4 tmpvar_12;
tmpvar_12 = texture2D (_MainTex, (tmpvar_1.xy + tmpvar_9));
vec4 normal_13;
normal_13.xy = ((texture2D (_BumpMap, (tmpvar_1.zw + tmpvar_9)).wy * 2.0) - 1.0);
normal_13.z = sqrt(((1.0 -
(normal_13.x * normal_13.x)
) - (normal_13.y * normal_13.y)));
vec3 tmpvar_14;
tmpvar_14.x = dot (tmpvar_2.xyz, normal_13.xyz);
tmpvar_14.y = dot (tmpvar_3.xyz, normal_13.xyz);
tmpvar_14.z = dot (tmpvar_4.xyz, normal_13.xyz);
reflcol_8 = (textureCube (_Cube, (tmpvar_7 - (2.0 *
(dot (tmpvar_14, tmpvar_7) * tmpvar_14)
))) * tmpvar_12.w);
light_6 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[2])));
light_6.xyz = (light_6.xyz + unity_Ambient.xyz);
vec4 c_15;
c_15.xyz = ((tmpvar_12 * _Color).xyz * light_6.xyz);
c_15.w = (reflcol_8.w * _ReflectColor.w);
col_5.w = c_15.w;
col_5.xyz = (c_15.xyz + (reflcol_8.xyz * _ReflectColor.xyz));
2012-10-07 23:41:18 -04:00
gl_FragData[0] = col_5;
}
2014-02-11 02:06:13 -05:00
2014-10-11 15:32:43 -04:00
// stats: 32 alu 5 tex 0 flow
// inputs: 1
// #0: gl_TexCoord (high float) 4x1 [6] loc 4
// uniforms: 4 (total size: 0)
// #0: _Color (high float) 4x1 [-1]
// #1: _Parallax (high float) 1x1 [-1]
// #2: _ReflectColor (high float) 4x1 [-1]
// #3: unity_Ambient (high float) 4x1 [-1]
// textures: 5
// #0: _BumpMap (high 2d) 0x0 [-1]
// #1: _Cube (high cube) 0x0 [-1]
// #2: _LightBuffer (high 2d) 0x0 [-1]
// #3: _MainTex (high 2d) 0x0 [-1]
// #4: _ParallaxMap (high 2d) 0x0 [-1]