2014-11-03 19:38:17 +00:00
|
|
|
uniform sampler2D basemap;
|
2014-12-22 16:15:46 +00:00
|
|
|
uniform sampler2D normalTex;
|
2015-12-25 06:47:51 +00:00
|
|
|
uniform mat3 normalMatrix;
|
2014-10-27 01:32:08 +00:00
|
|
|
|
2014-12-03 15:47:33 +00:00
|
|
|
#ifndef OPENCLONK
|
2016-01-08 02:35:14 +00:00
|
|
|
in vec2 texcoord;
|
|
|
|
out vec4 fragColor;
|
2014-12-03 15:47:33 +00:00
|
|
|
#define slice(x)
|
2014-10-27 01:32:08 +00:00
|
|
|
void main()
|
|
|
|
{
|
2016-01-08 02:35:14 +00:00
|
|
|
fragColor = vec4(1.0, 1.0, 1.0, 1.0);
|
2014-12-03 15:47:33 +00:00
|
|
|
#endif
|
2014-11-06 19:24:41 +00:00
|
|
|
|
2015-09-20 13:50:22 +00:00
|
|
|
slice(texture+1)
|
2014-12-03 15:47:33 +00:00
|
|
|
{
|
2016-01-08 02:35:14 +00:00
|
|
|
fragColor = fragColor * texture(basemap, texcoord);
|
2014-12-03 15:47:33 +00:00
|
|
|
|
|
|
|
#ifndef OPENCLONK
|
|
|
|
// TODO: Could apply some default lighting here, for viewing the mesh in
|
|
|
|
// a mesh viewer
|
|
|
|
#endif
|
|
|
|
}
|
2014-10-27 01:32:08 +00:00
|
|
|
|
2015-12-25 06:47:51 +00:00
|
|
|
slice(normal+1)
|
|
|
|
{
|
|
|
|
// TODO: This overrides what is set in slice(normal)
|
|
|
|
// from ObjectShader.glsl. It's probably optimized out,
|
|
|
|
// but a more elegant solution would be nice. Also maybe
|
|
|
|
// a function in UtilShader.glsl to reduce code duplication.
|
2016-01-08 02:35:14 +00:00
|
|
|
vec4 normalPx = texture(normalTex, texcoord);
|
2015-12-25 06:47:51 +00:00
|
|
|
vec3 normalPxDir = 2.0 * (normalPx.xyz - vec3(0.5, 0.5, 0.5));
|
|
|
|
normal = normalize(normalMatrix * normalPxDir);
|
|
|
|
}
|
|
|
|
|
2014-12-03 15:47:33 +00:00
|
|
|
#ifndef OPENCLONK
|
2014-10-27 01:32:08 +00:00
|
|
|
}
|
2014-12-03 15:47:33 +00:00
|
|
|
#endif
|