2015-02-24 22:30:59 +00:00
|
|
|
#version 150
|
|
|
|
|
2015-03-01 18:40:39 +00:00
|
|
|
uniform vec3 camera;
|
|
|
|
|
2015-03-01 17:45:31 +00:00
|
|
|
in vec3 fColor;
|
|
|
|
|
2015-03-01 18:40:39 +00:00
|
|
|
in GS_OUT {
|
2015-03-01 22:28:36 +00:00
|
|
|
smooth vec3 normal;
|
|
|
|
smooth vec3 position;
|
2015-03-01 18:40:39 +00:00
|
|
|
}fs_in;
|
|
|
|
|
2015-02-24 22:30:59 +00:00
|
|
|
out vec4 oColor;
|
|
|
|
|
2015-03-01 17:45:31 +00:00
|
|
|
|
2015-02-24 22:30:59 +00:00
|
|
|
void main() {
|
2015-03-01 22:28:36 +00:00
|
|
|
float dotProduct = dot(normalize(fs_in.normal), normalize(camera - fs_in.position));
|
|
|
|
if (dotProduct < 0.1 && dotProduct > 0.0){
|
|
|
|
oColor = vec4(1.0, 0.0, 0.0, 0.5);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
oColor = vec4(fColor, 0.5);
|
|
|
|
}
|
2015-02-24 22:30:59 +00:00
|
|
|
}
|