much improve
[carveJwlIkooP6JGAAIwe30JlM.git] / shaders / character.fs
index cf62679587bb9ee47ab2c42c25de9f9176c0b18a..2b13d764be0f2a048355d31b9bebd2287b60e4db 100644 (file)
@@ -8,6 +8,7 @@ in vec4 aColour;
 in vec2 aUv;
 in vec3 aNorm;
 in vec3 aCo;
+in vec3 aWorldCo;
 in float aOpacity;
 
 #include "common_world.glsl"
@@ -17,7 +18,7 @@ void main()
    vec3 vfrag = texture( uTexMain, aUv ).rgb;
 
    // Lighting
-   vec3 halfview = uCamera - aCo;
+   vec3 halfview = uCamera - aWorldCo;
    float fdist = length( halfview );
    halfview /= fdist;