mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-22 20:41:20 +00:00
[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:
parent
72cb7d3fdd
commit
4abcaff980
2 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue