mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-29 23:52:22 +00:00
Scale the light level index correctly before colormap lookup.
With this, lighting seems to be working. I'm not certain the normals are 100% correct, but I can see something happening on rotating models.
This commit is contained in:
parent
e8f863c76f
commit
209c4cda8b
1 changed files with 2 additions and 1 deletions
|
@ -18,7 +18,8 @@ main (void)
|
|||
|
||||
d = dot (normal, lightvec);
|
||||
d = min (d, 0.0);
|
||||
light = 255.0 - light;
|
||||
light += d * shadelight;
|
||||
col = texture2D (colormap, vec2 (pix, light)).r;
|
||||
col = texture2D (colormap, vec2 (pix, light / 255.0)).r;
|
||||
gl_FragColor = texture2D (palette, vec2 (col, 0.5));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue