DXGL r403 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r402‎ | r403 | r404 >
Date:19:27, 2 September 2013
Author:admin
Status:new
Tags:
Comment:
Properly bias 8-bit texture lookups to center of texel. Tested compatible with GeForce 6200 card on XP.
Modified paths:
  • /ddraw/shaders.cpp (modified) (history)

Diff [purge]

Index: ddraw/shaders.cpp
@@ -48,7 +48,7 @@
4949 void main() \n\
5050 { \n\
5151 vec4 myindex = texture2D(tex0, gl_TexCoord[0].xy); \n\
52 - vec2 index = vec2((myindex.x*((255.0/256.0)+(0.5/256.0))),0.5);\n\
 52+ vec2 index = vec2(((myindex.x*(255.0/256.0))+(0.5/256.0)),0.5);\n\
5353 vec4 texel = texture2D(pal, index); \n\
5454 gl_FragColor = texel; \n\
5555 } ";