DXGL r402 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r401‎ | r402 | r403 >
Date:14:27, 24 August 2013
Author:admin
Status:new
Tags:
Comment:
Index palette entries to middle of texel in palette texture. Fixes compatibility with old Geforce 6 series GPUs.
Modified paths:
  • /ddraw/shaders.cpp (modified) (history)

Diff [purge]

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