mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-18 15:01:41 +00:00
Update the shader to work as it should :)
I always thought it whould be "light - point" :P. Also, in normal maps, 127 is 0.
This commit is contained in:
parent
c454b96d2a
commit
0fd2b01665
1 changed files with 2 additions and 2 deletions
|
@ -37,7 +37,7 @@ calc_light (vec3 n, int ind)
|
|||
light l = lights[ind];
|
||||
float mag;
|
||||
|
||||
d = position - l.position.xyz;
|
||||
d = l.position.xyz - position;
|
||||
mag = dot (d, n);
|
||||
mag = max (0.0, mag);
|
||||
return l.color.rgb * (l.position.w * mag / dot (d, d));
|
||||
|
@ -50,7 +50,7 @@ main (void)
|
|||
vec3 norm, l;
|
||||
vec4 col;
|
||||
|
||||
norm = texture2D (normalmap, st).xyz;
|
||||
norm = (texture2D (normalmap, st).xyz - vec3(0.5)) * 2.0;
|
||||
norm = tbn * norm;
|
||||
l = calc_light (norm, 0);
|
||||
l += calc_light (norm, 1);
|
||||
|
|
Loading…
Reference in a new issue