[vulkan] Normalize the normal vectors on alias models

I was wondering why scaled-down quake-guy was dimmer than full-size
quake-guy. And the per-fragment normalization gives the illusion of
smoothness if you don't look at his legs (and even then...).
This commit is contained in:
Bill Currie 2022-05-05 23:46:24 +09:00
parent 72cb7d3fdd
commit 4abcaff980
2 changed files with 2 additions and 2 deletions

View file

@ -34,6 +34,6 @@ main (void)
pos = (Model * vertex);
gl_Position = Projection3d * (View * pos);
position = pos;
normal = mat3 (Model) * norm;
normal = normalize (mat3 (Model) * norm);
st = uv;
}

View file

@ -33,6 +33,6 @@ main (void)
frag_color = c;
frag_emission = e;
frag_normal = vec4(normal, 1);
frag_normal = vec4(normalize(normal), 1);
frag_position = position;
}