mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-25 00:58:30 -05:00
27 lines
902 B
Text
27 lines
902 B
Text
uniform vec4 _ReflectColor;
|
|
uniform sampler2D _MainTex;
|
|
uniform samplerCube _Cube;
|
|
uniform sampler2D _BumpMap;
|
|
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);
|
|
vec4 tmpvar_6;
|
|
tmpvar_6 = (gl_LightModel.ambient * tmpvar_5);
|
|
c_2.w = tmpvar_6.w;
|
|
c_2.xyz = (tmpvar_6.xyz * 2.0);
|
|
vec4 tmpvar_7;
|
|
tmpvar_7 = ((textureCube (_Cube, (tmpvar_1 - (2.0 * (dot (wn_3, tmpvar_1) * wn_3)))) * _ReflectColor) * tmpvar_5.w);
|
|
gl_FragData[0] = (c_2 + tmpvar_7);
|
|
}
|
|
|