2019-09-13 00:52:47 +02:00
|
|
|
|
#version 330
|
|
|
|
|
|
|
|
|
|
uniform vec4 blackColor;
|
2019-09-08 23:03:00 +02:00
|
|
|
|
uniform vec4 whiteColor;
|
|
|
|
|
uniform int hasTexture0;
|
|
|
|
|
uniform int debugShading;
|
|
|
|
|
uniform int numTextureMaps;
|
2019-09-11 00:42:48 +02:00
|
|
|
|
|
2019-09-08 23:03:00 +02:00
|
|
|
|
uniform sampler2D textures0;
|
|
|
|
|
uniform sampler2D uvTestPattern;
|
|
|
|
|
|
2019-09-13 00:52:47 +02:00
|
|
|
|
in vec2 uv0;
|
|
|
|
|
in vec4 vertexColor0;
|
|
|
|
|
|
|
|
|
|
out vec4 fragColor;
|
|
|
|
|
|
2019-09-08 23:03:00 +02:00
|
|
|
|
void main()
|
|
|
|
|
{
|
|
|
|
|
vec4 textureMap0 = vec4(1);
|
2019-09-11 00:42:48 +02:00
|
|
|
|
vec4 textureMap1 = vec4(1);
|
|
|
|
|
vec4 textureMap2 = vec4(1);
|
|
|
|
|
|
2019-09-08 23:03:00 +02:00
|
|
|
|
if (numTextureMaps > 0)
|
|
|
|
|
{
|
|
|
|
|
if (hasTexture0 == 1)
|
2019-09-13 00:52:47 +02:00
|
|
|
|
textureMap0 = texture2D(textures0, uv0);
|
2019-09-08 23:03:00 +02:00
|
|
|
|
}
|
2019-09-11 00:42:48 +02:00
|
|
|
|
|
2019-09-08 23:03:00 +02:00
|
|
|
|
if (debugShading == 0)
|
|
|
|
|
{
|
2019-09-11 00:42:48 +02:00
|
|
|
|
vec4 colorBlend = textureMap0 * whiteColor;
|
2019-09-13 00:52:47 +02:00
|
|
|
|
fragColor = vertexColor0 * colorBlend;
|
2019-09-08 23:03:00 +02:00
|
|
|
|
}
|
2019-09-11 00:42:48 +02:00
|
|
|
|
else if (debugShading == 5)
|
2019-09-13 00:52:47 +02:00
|
|
|
|
fragColor = vec4(textureMap0.rgb, 1);
|
2019-09-11 00:42:48 +02:00
|
|
|
|
else if (debugShading == 1)
|
2019-09-13 00:52:47 +02:00
|
|
|
|
fragColor = vertexColor0;
|
2019-09-11 00:42:48 +02:00
|
|
|
|
else if (debugShading == 2)
|
2019-09-13 00:52:47 +02:00
|
|
|
|
fragColor = whiteColor;
|
2019-09-11 00:42:48 +02:00
|
|
|
|
else if (debugShading == 3)
|
2019-09-13 00:52:47 +02:00
|
|
|
|
fragColor = blackColor;
|
2019-09-11 00:42:48 +02:00
|
|
|
|
else if (debugShading == 4)
|
2019-09-13 00:52:47 +02:00
|
|
|
|
fragColor = texture2D(uvTestPattern, uv0);
|
2019-09-08 23:03:00 +02:00
|
|
|
|
}
|