2019-05-10 23:51:59 +02:00
|
|
|
|
#version 330
|
|
|
|
|
in vec3 normal;
|
2019-05-11 22:11:27 +02:00
|
|
|
|
in vec4 color;
|
2019-05-10 23:51:59 +02:00
|
|
|
|
in vec3 position;
|
|
|
|
|
|
|
|
|
|
uniform vec3 difLightDirection;
|
|
|
|
|
uniform vec3 difLightColor;
|
|
|
|
|
uniform vec3 ambLightColor;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uniform int colorOverride;
|
|
|
|
|
uniform int renderType;
|
|
|
|
|
uniform int renderVertColor;
|
|
|
|
|
uniform mat4 modelview;
|
|
|
|
|
|
|
|
|
|
out vec4 FragColor;
|
|
|
|
|
|
|
|
|
|
void main()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
if (colorOverride == 1)
|
|
|
|
|
{
|
|
|
|
|
// Wireframe color.
|
|
|
|
|
|
|
|
|
|
if (renderVertColor == 1)
|
|
|
|
|
{
|
2019-05-11 22:11:27 +02:00
|
|
|
|
FragColor = color;
|
2019-05-10 23:51:59 +02:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
FragColor = vec4(1);
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2019-05-11 22:11:27 +02:00
|
|
|
|
FragColor = vec4(1);
|
|
|
|
|
|
2019-05-10 23:51:59 +02:00
|
|
|
|
vec3 displayNormal = (normal.xyz * 0.5) + 0.5;
|
2019-05-11 22:11:27 +02:00
|
|
|
|
if (renderType == 1) // normals color
|
2019-05-10 23:51:59 +02:00
|
|
|
|
FragColor = vec4(displayNormal.rgb,1);
|
|
|
|
|
}
|