Use correct normal matrix

This commit is contained in:
Dane Johnson
2021-01-23 23:31:46 -06:00
parent 0bc3a89e66
commit d012554db9
2 changed files with 17 additions and 2 deletions

View File

@@ -46,8 +46,7 @@ void main() {
UV = uv;
vec3 my_normal = (VIEW * MODEL * vec4(normal, 0.0)).xyz;
my_normal *= NORMAL;
vec3 my_normal = (VIEW * mat4(NORMAL) * vec4(normal, 0.0)).xyz;
// Flat shading, we compute light per vertex
AMBIENT = directionalLight.ambient * directionalLight.color * material.ambient;