mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-25 17:18:12 -05:00
19 lines
729 B
Text
19 lines
729 B
Text
uniform vec4 _horizonColor;
|
|
uniform sampler2D _ColorControl;
|
|
uniform sampler2D _BumpMap;
|
|
void main ()
|
|
{
|
|
vec4 col_1;
|
|
vec4 normal_2;
|
|
normal_2.xy = ((texture2D (_BumpMap, gl_TexCoord[0].xy).wy * 2.0) - 1.0);
|
|
normal_2.z = sqrt(((1.0 - (normal_2.x * normal_2.x)) - (normal_2.y * normal_2.y)));
|
|
vec4 normal_3;
|
|
normal_3.xy = ((texture2D (_BumpMap, gl_TexCoord[1].xy).wy * 2.0) - 1.0);
|
|
normal_3.z = sqrt(((1.0 - (normal_3.x * normal_3.x)) - (normal_3.y * normal_3.y)));
|
|
vec4 tmpvar_4;
|
|
tmpvar_4 = texture2D (_ColorControl, vec2(dot (gl_TexCoord[2].xyz, ((normal_2.xyz + normal_3.xyz) * 0.5))));
|
|
col_1.xyz = mix (tmpvar_4.xyz, _horizonColor.xyz, tmpvar_4.www);
|
|
col_1.w = _horizonColor.w;
|
|
gl_FragData[0] = col_1;
|
|
}
|
|
|