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/A3/resources/sil.glsl

21 lines
397 B
Text
Raw Normal View History

2017-03-01 19:00:01 -06:00
#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);
}