2013-12-18 19:13:17 -05:00
|
|
|
#version 130
|
2013-11-30 16:33:06 -05:00
|
|
|
uniform sampler2D tex;
|
|
|
|
uniform int hastex;
|
|
|
|
uniform float objectid;
|
|
|
|
|
2013-12-18 19:13:17 -05:00
|
|
|
noperspective in vec3 nor;
|
2014-01-09 19:31:22 -05:00
|
|
|
in vec2 uv0;
|
|
|
|
in vec2 uv1;
|
2014-01-19 13:31:00 -05:00
|
|
|
out vec4 Albedo;
|
|
|
|
out vec4 NormalDepth;
|
|
|
|
out vec4 Specular;
|
2013-12-18 19:13:17 -05:00
|
|
|
|
2013-11-30 16:33:06 -05:00
|
|
|
void main() {
|
|
|
|
|
2013-12-11 18:46:40 -05:00
|
|
|
//if (hastex != 0) {
|
2014-01-19 12:53:35 -05:00
|
|
|
vec4 col = texture(tex, uv0);
|
2013-11-30 16:33:06 -05:00
|
|
|
|
|
|
|
if (col.a < 0.5)
|
|
|
|
discard;
|
|
|
|
|
2014-01-19 13:31:00 -05:00
|
|
|
Albedo = vec4(col.xyz, 1.);
|
2013-12-11 18:46:40 -05:00
|
|
|
//} else {
|
2014-01-19 13:31:00 -05:00
|
|
|
// Albedo = gl_Color;
|
2013-12-11 18:46:40 -05:00
|
|
|
//}
|
2013-11-30 16:33:06 -05:00
|
|
|
|
2014-01-19 13:31:00 -05:00
|
|
|
NormalDepth = vec4(0.5 * normalize(nor) + 0.5, gl_FragCoord.z);
|
|
|
|
Specular = vec4(1. - col.a);
|
2013-11-30 16:33:06 -05:00
|
|
|
}
|
|
|
|
|