1
0
mirror of synced 2024-12-03 03:27:23 +01:00
Switch-Toolbox/Toolbox/Shader/Bcres/BCRES.frag

42 lines
667 B
GLSL
Raw Normal View History

#version 330
in vec3 normal;
2019-05-11 22:11:27 +02:00
in vec4 color;
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;
}
else
{
FragColor = vec4(1);
}
return;
}
2019-05-11 22:11:27 +02:00
FragColor = vec4(1);
vec3 displayNormal = (normal.xyz * 0.5) + 0.5;
2019-05-11 22:11:27 +02:00
if (renderType == 1) // normals color
FragColor = vec4(displayNormal.rgb,1);
}