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/A4/resources/sil.glsl
2017-04-10 17:45:21 -05:00

20 lines
397 B
GLSL

#version 120
varying vec4 p;
varying vec4 n;
void main()
{
vec4 normal = normalize(n);
vec3 norm = vec3(normal.x, normal.y, normal.z);
vec4 npos = normalize(p);
vec3 pos = vec3(npos.x, npos.y, npos.z);
float product = dot(norm, pos);
if(product <= 0.3 && product >= -0.3)
gl_FragColor = vec4(0.0f, 0.0f, 0.0f, 1.0f);
else
gl_FragColor = vec4(1.0f, 1.0f, 1.0f, 1.0f);
}