#version 400

uniform samplerBuffer colorTex;
uniform int colorNum;

in vec4 fragNormal;

out vec4 result;

// This is the actual code that is executed.
void main( void )
{
  vec4 color = texelFetch( colorTex, colorNum );
  result = vec4( color*abs(fragNormal.z) );
}