This repository has been archived on 2025-04-11. You can view files and clone it, but cannot push or open issues or pull requests.
csce441pine64backup/L12/resources/normal_frag.glsl
2017-04-10 17:50:27 -05:00

11 lines
210 B
GLSL

#version 120
varying vec3 vNor;
void main()
{
vec3 normal = normalize(vNor);
// Map normal in the range [-1, 1] to color in range [0, 1];
vec3 color = 0.5*normal + 0.5;
gl_FragColor = vec4(color, 1.0);
}