bgfx/3rdparty/glsl-optimizer/tests/fragment/unity-FX_Glass_Stained_BumpDistort-out.txt

19 lines
623 B
Text
Raw Normal View History

2012-04-03 23:30:07 -04:00
uniform sampler2D _MainTex;
uniform vec4 _GrabTexture_TexelSize;
uniform sampler2D _GrabTexture;
uniform sampler2D _BumpMap;
uniform float _BumpAmt;
void main ()
{
vec4 tmpvar_1;
tmpvar_1 = gl_TexCoord[0];
vec4 tmpvar_2;
tmpvar_2 = tmpvar_1;
vec4 normal;
normal.xy = ((texture2D (_BumpMap, gl_TexCoord[1].xy).wy * 2.0) - 1.0);
normal.z = sqrt (((1.0 - (normal.x * normal.x)) - (normal.y * normal.y)));
tmpvar_2.xy = ((((normal.xy * _BumpAmt) * _GrabTexture_TexelSize.xy) * tmpvar_1.z) + tmpvar_1.xy);
gl_FragData[0] = (texture2DProj (_GrabTexture, tmpvar_2) * texture2D (_MainTex, gl_TexCoord[2].xy));
}