mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-12-11 16:51:32 -05:00
20 lines
566 B
Text
20 lines
566 B
Text
uniform sampler2D _BumpMap;
|
|
void main ()
|
|
{
|
|
vec4 res_1;
|
|
vec3 viewN_2;
|
|
vec4 normal_3;
|
|
normal_3.xy = ((texture2D (_BumpMap, gl_TexCoord[0].xy).wy * 2.0) - 1.0);
|
|
normal_3.z = sqrt(((1.0 -
|
|
(normal_3.x * normal_3.x)
|
|
) - (normal_3.y * normal_3.y)));
|
|
viewN_2.x = dot (gl_TexCoord[1].xyz, normal_3.xyz);
|
|
viewN_2.y = dot (gl_TexCoord[2].xyz, normal_3.xyz);
|
|
viewN_2.z = dot (gl_TexCoord[3].xyz, normal_3.xyz);
|
|
res_1.xyz = ((viewN_2 * vec3(0.5, 0.5, -0.5)) + 0.5);
|
|
res_1.w = 0.0;
|
|
gl_FragData[0] = res_1;
|
|
}
|
|
|
|
|
|
// inputs: 1, stats: 13 alu 1 tex 0 flow
|