Flip v texture coordinate in textured.frag
@@ -5,8 +5,8 @@ uniform float diffuse_intensity;
uniform float specular_intensity;
uniform float specular_power;
-in vec3 nor;
in vec3 pos;
+in vec3 nor;
in vec2 uvs;
layout (location = 0) out vec4 out_color;
@@ -31,7 +31,7 @@ vec3 triplanarMapping (sampler2D t, vec3 normal, vec3 position) {
void main()
{
vec3 n = normalize(gl_FrontFacing ? nor : -nor);
- out_color = vec4(use_uvs ? texture(tex, uvs).rgb: triplanarMapping(tex, n, pos), diffuse_intensity);
+ out_color = vec4(use_uvs ? texture(tex, vec2(uvs.x, 1.0 - uvs.y)).rgb: triplanarMapping(tex, n, pos), diffuse_intensity);
int intensity = int(floor(specular_intensity * 15.0));
int power = int(floor(specular_power*0.5));
normal = vec4(0.5 * n + 0.5, float(power << 4 | intensity)/255.0);
