diff --git a/plugins/zzogl-pg/opengl/ZZoglCreate.cpp b/plugins/zzogl-pg/opengl/ZZoglCreate.cpp index b481b0e776..caa46e8f11 100644 --- a/plugins/zzogl-pg/opengl/ZZoglCreate.cpp +++ b/plugins/zzogl-pg/opengl/ZZoglCreate.cpp @@ -417,7 +417,7 @@ void LoadglFunctions() inline bool TryBlockFormat(GLint fmt, const GLvoid* vBlockData) { g_internalFloatFmt = fmt; - glTexImage2D(GL_TEXTURE_2D, 0, g_internalFloatFmt, BLOCK_TEXWIDTH, BLOCK_TEXHEIGHT, 0, GL_RED, GL_FLOAT, vBlockData); + glTexImage2D(GL_TEXTURE_2D, 0, g_internalFloatFmt, BLOCK_TEXWIDTH, BLOCK_TEXHEIGHT, 0, GL_ALPHA, GL_FLOAT, vBlockData); return (glGetError() == GL_NO_ERROR); } @@ -611,10 +611,8 @@ bool ZZCreate(int _width, int _height) // We store block data on u16 rather float numbers. It's not so preciese, but ALPHA16 is OpenGL 2.0 standart // and use only 16 bit. Old zerogs use red channel, but it does not work. - - // Note: GL_ALPHA was dropped in GL3.0 in favor of GL_RED ... Time to upgrade -- gregory - glTexImage2D(GL_TEXTURE_2D, 0, g_internalFloatFmt, BLOCK_TEXWIDTH, BLOCK_TEXHEIGHT, 0, GL_RED, GL_UNSIGNED_SHORT, &vBlockData[0]); + glTexImage2D(GL_TEXTURE_2D, 0, g_internalFloatFmt, BLOCK_TEXWIDTH, BLOCK_TEXHEIGHT, 0, GL_ALPHA, GL_UNSIGNED_SHORT, &vBlockData[0]); if( glGetError() != GL_NO_ERROR ) { ZZLog::Error_Log("ZZogl ERROR: could not fill blocks"); return false; diff --git a/plugins/zzogl-pg/opengl/ps2hw.dat b/plugins/zzogl-pg/opengl/ps2hw.dat index 47e82b7c5a..2d3b43cae0 100644 Binary files a/plugins/zzogl-pg/opengl/ps2hw.dat and b/plugins/zzogl-pg/opengl/ps2hw.dat differ diff --git a/plugins/zzogl-pg/opengl/ps2hw.fx b/plugins/zzogl-pg/opengl/ps2hw.fx index b0b878c31d..0965c3adc3 100644 --- a/plugins/zzogl-pg/opengl/ps2hw.fx +++ b/plugins/zzogl-pg/opengl/ps2hw.fx @@ -96,7 +96,7 @@ float2 ps2memcoord(float2 realtex) off.xy = realtex.xy-fblock.xy; #ifdef ACCURATE_DECOMPRESSION - off.z = tex2D(g_sBlocks, g_fTexBlock.xy*fblock + g_fTexBlock.zw).r; + off.zw = tex2D(g_sBlocks, g_fTexBlock.xy*fblock + g_fTexBlock.zw).ar; off.x = dot(off.xy, g_fTexOffset.xy); float r = g_fTexOffset.w; float f = frac(off.x); @@ -105,7 +105,7 @@ float2 ps2memcoord(float2 realtex) off.x = frac(f + fadd + r); off.w -= off.x ; #else - off.z = tex2D(g_sBlocks, g_fTexBlock.xy*fblock + g_fTexBlock.zw).r; + off.z = tex2D(g_sBlocks, g_fTexBlock.xy*fblock + g_fTexBlock.zw).a; // combine the two off.x = dot(off.xyz, g_fTexOffset.xyz)+g_fTexOffset.w; @@ -135,10 +135,10 @@ void ps2memcoord4(float4 orgtex, out float4 off0, out float4 off1) float4 colors;// = tex2D(g_sBilinearBlocks, ftransblock.xy); // this is faster on ffx ingame - colors.x = tex2D(g_sBlocks, ftransblock.xy).r; - colors.y = tex2D(g_sBlocks, ftransblock.zy).r; - colors.z = tex2D(g_sBlocks, ftransblock.xw).r; - colors.w = tex2D(g_sBlocks, ftransblock.zw).r; + colors.x = tex2D(g_sBlocks, ftransblock.xy).a; + colors.y = tex2D(g_sBlocks, ftransblock.zy).a; + colors.z = tex2D(g_sBlocks, ftransblock.xw).a; + colors.w = tex2D(g_sBlocks, ftransblock.zw).a; float4 fr, rem; diff --git a/plugins/zzogl-pg/opengl/ps2hw.glsl b/plugins/zzogl-pg/opengl/ps2hw.glsl index 4cd47f66be..2e48e8caf9 100644 --- a/plugins/zzogl-pg/opengl/ps2hw.glsl +++ b/plugins/zzogl-pg/opengl/ps2hw.glsl @@ -141,7 +141,7 @@ float2 ps2memcoord(float2 realtex) off.xy = realtex.xy-fblock.xy; #ifdef ACCURATE_DECOMPRESSION - off.z = texture(g_sBlocks, g_fTexBlock[CTX].xy*fblock + g_fTexBlock[CTX].zw).r; + off.zw = texture(g_sBlocks, g_fTexBlock[CTX].xy*fblock + g_fTexBlock[CTX].zw).ar; off.x = dot(off.xy, g_fTexOffset[CTX].xy); float r = g_fTexOffset[CTX].w; float f = fract(off.x); @@ -150,7 +150,7 @@ float2 ps2memcoord(float2 realtex) off.x = fract(f + fadd + r); off.w -= off.x ; #else - off.z = texture(g_sBlocks, g_fTexBlock[CTX].xy*fblock + g_fTexBlock[CTX].zw).r; + off.z = texture(g_sBlocks, g_fTexBlock[CTX].xy*fblock + g_fTexBlock[CTX].zw).a; // combine the two off.x = dot(off.xyz, g_fTexOffset[CTX].xyz)+g_fTexOffset[CTX].w; @@ -180,10 +180,10 @@ void ps2memcoord4(float4 orgtex, out float4 off0, out float4 off1) float4 colors;// = texture(g_sBilinearBlocks, ftransblock.xy); // this is faster on ffx ingame - colors.x = texture(g_sBlocks, ftransblock.xy).r; - colors.y = texture(g_sBlocks, ftransblock.zy).r; - colors.z = texture(g_sBlocks, ftransblock.xw).r; - colors.w = texture(g_sBlocks, ftransblock.zw).r; + colors.x = texture(g_sBlocks, ftransblock.xy).a; + colors.y = texture(g_sBlocks, ftransblock.zy).a; + colors.z = texture(g_sBlocks, ftransblock.xw).a; + colors.w = texture(g_sBlocks, ftransblock.zw).a; float4 fr, rem; diff --git a/plugins/zzogl-pg/opengl/ps2hw_gl4.glsl b/plugins/zzogl-pg/opengl/ps2hw_gl4.glsl index 8227dae51e..f69dea94dd 100644 --- a/plugins/zzogl-pg/opengl/ps2hw_gl4.glsl +++ b/plugins/zzogl-pg/opengl/ps2hw_gl4.glsl @@ -193,7 +193,7 @@ float2 ps2memcoord(float2 realtex) off.xy = realtex.xy-fblock.xy; #ifdef ACCURATE_DECOMPRESSION - off.z = texture(g_sBlocks, g_fTexBlock.xy*fblock + g_fTexBlock.zw).r; + off.zw = texture(g_sBlocks, g_fTexBlock.xy*fblock + g_fTexBlock.zw).ar; off.x = dot(off.xy, g_fTexOffset.xy); float r = g_fTexOffset.w; float f = fract(off.x); @@ -202,7 +202,7 @@ float2 ps2memcoord(float2 realtex) off.x = fract(f + fadd + r); off.w -= off.x ; #else - off.z = texture(g_sBlocks, g_fTexBlock.xy*fblock + g_fTexBlock.zw).r; + off.z = texture(g_sBlocks, g_fTexBlock.xy*fblock + g_fTexBlock.zw).a; // combine the two off.x = dot(off.xyz, g_fTexOffset.xyz)+g_fTexOffset.w; @@ -232,10 +232,10 @@ void ps2memcoord4(float4 orgtex, out float4 off0, out float4 off1) float4 colors;// = texture(g_sBilinearBlocks, ftransblock.xy); // this is faster on ffx ingame - colors.x = texture(g_sBlocks, ftransblock.xy).r; - colors.y = texture(g_sBlocks, ftransblock.zy).r; - colors.z = texture(g_sBlocks, ftransblock.xw).r; - colors.w = texture(g_sBlocks, ftransblock.zw).r; + colors.x = texture(g_sBlocks, ftransblock.xy).a; + colors.y = texture(g_sBlocks, ftransblock.zy).a; + colors.z = texture(g_sBlocks, ftransblock.xw).a; + colors.w = texture(g_sBlocks, ftransblock.zw).a; float4 fr, rem;