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

43 lines
1.3 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 sampler2D _Illum;
uniform sampler2D _LightBuffer;
uniform sampler2D _MainTex;
uniform float _Parallax;
uniform sampler2D _ParallaxMap;
uniform vec4 unity_Ambient;
2012-10-07 23:41:18 -04:00
void main ()
{
vec4 tmpvar_1;
tmpvar_1 = gl_TexCoord[0];
vec4 col_2;
vec4 light_3;
vec2 tmpvar_4;
vec3 v_5;
vec3 tmpvar_6;
tmpvar_6 = normalize(gl_TexCoord[2].xyz);
v_5.xy = tmpvar_6.xy;
v_5.z = (tmpvar_6.z + 0.42);
tmpvar_4 = (((texture2D (_ParallaxMap, tmpvar_1.zw).w * _Parallax) - (_Parallax / 2.0)) * (tmpvar_6.xy / v_5.z));
vec4 tmpvar_7;
tmpvar_7 = (texture2D (_MainTex, (tmpvar_1.xy + tmpvar_4)) * _Color);
vec4 normal_8;
normal_8.xy = ((texture2D (_BumpMap, (tmpvar_1.zw + tmpvar_4)).wy * 2.0) - 1.0);
2014-02-11 02:06:13 -05:00
normal_8.z = sqrt(((1.0 -
(normal_8.x * normal_8.x)
) - (normal_8.y * normal_8.y)));
2012-10-07 23:41:18 -04:00
vec4 tmpvar_9;
tmpvar_9 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[3])));
light_3.w = tmpvar_9.w;
light_3.xyz = (tmpvar_9.xyz + unity_Ambient.xyz);
vec4 c_10;
c_10.xyz = (tmpvar_7.xyz * light_3.xyz);
c_10.w = tmpvar_7.w;
col_2.w = c_10.w;
col_2.xyz = (c_10.xyz + (tmpvar_7.xyz * texture2D (_Illum, (gl_TexCoord[1].xy + tmpvar_4)).w));
gl_FragData[0] = col_2;
}
2014-02-11 02:06:13 -05:00
// inputs: 1, stats: 24 alu 5 tex 0 flow