mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2025-02-16 11:50:19 -05:00
23 lines
785 B
Text
23 lines
785 B
Text
uniform vec4 _ReflectColor;
|
|
uniform sampler2D _MainTex;
|
|
uniform samplerCube _Cube;
|
|
uniform sampler2D _BumpMap;
|
|
void main ()
|
|
{
|
|
vec4 c;
|
|
vec3 wn;
|
|
vec4 normal_i0;
|
|
normal_i0.xy = ((texture2D (_BumpMap, gl_TexCoord[1].xy).wy * 2.0) - 1.0);
|
|
normal_i0.z = sqrt (((1.0 - (normal_i0.x * normal_i0.x)) - (normal_i0.y * normal_i0.y)));
|
|
vec4 tmpvar_1;
|
|
tmpvar_1 = texture2D (_MainTex, gl_TexCoord[0].xy);
|
|
wn.x = dot (gl_TexCoord[3].xyz, normal_i0.xyz);
|
|
wn.y = dot (gl_TexCoord[4].xyz, normal_i0.xyz);
|
|
wn.z = dot (gl_TexCoord[5].xyz, normal_i0.xyz);
|
|
vec4 tmpvar_2;
|
|
tmpvar_2 = (gl_LightModel.ambient * tmpvar_1);
|
|
c = tmpvar_2;
|
|
c.xyz = (tmpvar_2.xyz * 2.0);
|
|
gl_FragData[0] = (c + ((textureCube (_Cube, reflect (gl_TexCoord[2].xyz, wn)) * _ReflectColor) * tmpvar_1.w));
|
|
}
|
|
|