pcsx2/plugins/GSdx
gabest11 3e12966919 GSdx: Even more alpha test voodoo magic, it must be nailed now!
And there is even an explanation. 

The tfx functions calculate At * Af >> 7, which means modulating by 0x80 should return At as the result. 

With the evil floating point pixel shader however 0x80 translates to 128/255 (0.502), not exactly 0.5, modulation as At' * Af' * 2 (' means 0 - 1.0 range) is not the same as with integers.

At' = Af' = 0.502
At' * Af' * 2 = 0.504

If the alpha test happens to be "not equal to 0x80", then abs(0.504 - 128/255) < 0.5/255 will just miss.

Solution is to re-scale those values to the integer range, do the calculations, and then back to float again, but in the end it just simplifies down to At' * Af' * 255/128, doh...

At * Af >> 7 => ((At' * 255) * (Af' * 255) / 128) / 255 => At' * Af' * 255/128

At' = Af' = 0.502
0.502 * 0.502 * 255/128 = 0.502 (w00t!)


git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1272 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-05-27 05:55:32 +00:00
..
baseclasses Re-Added eol-style:native properties to the repository. The settings got lost when we merged from Playground to Official. 2009-02-09 21:15:56 +00:00
res GSdx: Even more alpha test voodoo magic, it must be nailed now! 2009-05-27 05:55:32 +00:00
vsprops GSdx: converted a few template classes to pointers and virtual functions, the dll got more than 100k smaller, since there were many changes, backup your old version first :P 2009-05-22 01:22:52 +00:00
vtune GSdx: vtune JIT code profiling support (somebody should implement this in pcsx2 too, see iJIT_NotifyEvent(iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED, ...), plzkthx :P) and other minor fixes/optimizations. 2009-02-22 16:28:39 +00:00
xbyak GSdx: more refactoring (aka search and replace) 2009-05-14 16:41:52 +00:00
GPU.cpp GSdx: more source cleanup and something interesting on F7 2009-05-22 23:23:38 +00:00
GPU.h GSdx: more refactoring (aka search and replace) 2009-05-14 16:41:52 +00:00
GPUDrawScanline.cpp GSdx: more refactoring (aka search and replace) 2009-05-14 16:41:52 +00:00
GPUDrawScanline.h GSdx: more refactoring (aka search and replace) 2009-05-14 16:41:52 +00:00
GPUDrawScanlineCodeGenerator.cpp GSdx: more refactoring (aka search and replace) 2009-05-14 16:41:52 +00:00
GPUDrawScanlineCodeGenerator.h GSdx: more refactoring (aka search and replace) 2009-05-14 16:41:52 +00:00
GPUDrawingEnvironment.h GSdx: more refactoring (aka search and replace) 2009-05-14 16:41:52 +00:00
GPULocalMemory.cpp GSdx: more source cleanup and something interesting on F7 2009-05-22 23:23:38 +00:00
GPULocalMemory.h GSdx: more source cleanup and something interesting on F7 2009-05-22 23:23:38 +00:00
GPURenderer.cpp GSdx: more source cleanup and something interesting on F7 2009-05-22 23:23:38 +00:00
GPURenderer.h GSdx: more source cleanup and something interesting on F7 2009-05-22 23:23:38 +00:00
GPURendererSW.cpp GSdx: more source cleanup and something interesting on F7 2009-05-22 23:23:38 +00:00
GPURendererSW.h GSdx: more source cleanup and something interesting on F7 2009-05-22 23:23:38 +00:00
GPUScanlineEnvironment.h GSdx: more refactoring (aka search and replace) 2009-05-14 16:41:52 +00:00
GPUSettingsDlg.cpp GSdx: now I think only the window classes of mfc are left to be replaced (main window, config dialog), trying to get familiar with wx... 2009-05-18 11:08:04 +00:00
GPUSettingsDlg.h GSdx: trying to get rid of windows dependencies, still many classes to replace :P 2009-05-11 08:18:00 +00:00
GPUSetupPrimCodeGenerator.cpp GSdx: converted a few template classes to pointers and virtual functions, the dll got more than 100k smaller, since there were many changes, backup your old version first :P 2009-05-22 01:22:52 +00:00
GPUSetupPrimCodeGenerator.h GSdx: completed the ps1 renderer conversion for xbyak, GSRasterizer::Draw* functions should be next. 2009-02-20 10:59:10 +00:00
GPUState.cpp GSdx: more source cleanup and something interesting on F7 2009-05-22 23:23:38 +00:00
GPUState.h GSdx: more source cleanup and something interesting on F7 2009-05-22 23:23:38 +00:00
GPUVertex.h Re-Added eol-style:native properties to the repository. The settings got lost when we merged from Playground to Official. 2009-02-09 21:15:56 +00:00
GS.cpp GSdx: more source cleanup and something interesting on F7 2009-05-22 23:23:38 +00:00
GS.h GSdx: converted a few template classes to pointers and virtual functions, the dll got more than 100k smaller, since there were many changes, backup your old version first :P 2009-05-22 01:22:52 +00:00
GSAlignedClass.cpp Re-Added eol-style:native properties to the repository. The settings got lost when we merged from Playground to Official. 2009-02-09 21:15:56 +00:00
GSAlignedClass.h Re-Added eol-style:native properties to the repository. The settings got lost when we merged from Playground to Official. 2009-02-09 21:15:56 +00:00
GSBlock.cpp Re-Added eol-style:native properties to the repository. The settings got lost when we merged from Playground to Official. 2009-02-09 21:15:56 +00:00
GSBlock.h GSdx: fixed a few more typos in GSVector4i, the black screen bug should be gone 2009-05-15 11:11:26 +00:00
GSCapture.cpp GSdx: more refactoring (aka search and replace) 2009-05-14 16:41:52 +00:00
GSCapture.h GSdx: more refactoring (aka search and replace) 2009-05-14 16:41:52 +00:00
GSCaptureDlg.cpp GSdx: now I think only the window classes of mfc are left to be replaced (main window, config dialog), trying to get familiar with wx... 2009-05-18 11:08:04 +00:00
GSCaptureDlg.h GSdx: trying to get rid of windows dependencies, still many classes to replace :P 2009-05-11 08:18:00 +00:00
GSClut.cpp GSdx: dx9 hw mode got a vertex buffer too (as dx10), it was an old TODO... 2009-05-23 23:52:53 +00:00
GSClut.h GSdx: more refactoring (aka search and replace) 2009-05-14 16:41:52 +00:00
GSCodeBuffer.cpp GSdx: more refactoring (aka search and replace) 2009-05-14 16:41:52 +00:00
GSCodeBuffer.h GSdx: more refactoring (aka search and replace) 2009-05-14 16:41:52 +00:00
GSCrc.cpp GSdx: now I think only the window classes of mfc are left to be replaced (main window, config dialog), trying to get familiar with wx... 2009-05-18 11:08:04 +00:00
GSCrc.h GSdx: more refactoring (aka search and replace) 2009-05-14 16:41:52 +00:00
GSDevice.cpp GSdx: more source cleanup and something interesting on F7 2009-05-22 23:23:38 +00:00
GSDevice.h GSdx: more source cleanup and something interesting on F7 2009-05-22 23:23:38 +00:00
GSDevice7.cpp GSdx: more source cleanup and something interesting on F7 2009-05-22 23:23:38 +00:00
GSDevice7.h GSdx: more source cleanup and something interesting on F7 2009-05-22 23:23:38 +00:00
GSDevice9.cpp GSdx: Even more alpha test voodoo magic, it must be nailed now! 2009-05-27 05:55:32 +00:00
GSDevice9.h GSdx: bit more work on the vertex buffer, and broken ffxii fmv fixed again. 2009-05-26 03:40:31 +00:00
GSDevice10.cpp GSdx: Even more alpha test voodoo magic, it must be nailed now! 2009-05-27 05:55:32 +00:00
GSDevice10.h GSdx: bit more work on the vertex buffer, and broken ffxii fmv fixed again. 2009-05-26 03:40:31 +00:00
GSDeviceNull.cpp GSdx: converted a few template classes to pointers and virtual functions, the dll got more than 100k smaller, since there were many changes, backup your old version first :P 2009-05-22 01:22:52 +00:00
GSDeviceNull.h GSdx: converted a few template classes to pointers and virtual functions, the dll got more than 100k smaller, since there were many changes, backup your old version first :P 2009-05-22 01:22:52 +00:00
GSDirtyRect.cpp GSdx: optimized local-local transfer a bit, it boosts fps in games like ffxii or ico, which do a lot of moves in local memory. 2009-05-20 15:35:31 +00:00
GSDirtyRect.h GSdx: more refactoring (aka search and replace) 2009-05-14 16:41:52 +00:00
GSDrawScanline.cpp GSdx: more refactoring (aka search and replace) 2009-05-14 16:41:52 +00:00
GSDrawScanline.h GSdx: more refactoring (aka search and replace) 2009-05-14 16:41:52 +00:00
GSDrawScanlineCodeGenerator.cpp GSdx: converted a few template classes to pointers and virtual functions, the dll got more than 100k smaller, since there were many changes, backup your old version first :P 2009-05-22 01:22:52 +00:00
GSDrawScanlineCodeGenerator.h GSdx: fixed a few more typos in GSVector4i, the black screen bug should be gone 2009-05-15 11:11:26 +00:00
GSDrawingContext.h Re-Added eol-style:native properties to the repository. The settings got lost when we merged from Playground to Official. 2009-02-09 21:15:56 +00:00
GSDrawingEnvironment.h GSdx: adapted to ref's changes to the image transfer, it was a bug in GSdx but not triggered by the old way, also the data overflow is now ignored, no idea what it may cause, look out for missing or fixed textures. 2009-04-18 09:34:25 +00:00
GSDump.cpp GSdx: more refactoring (aka search and replace) 2009-05-14 16:41:52 +00:00
GSDump.h GSdx: more refactoring (aka search and replace) 2009-05-14 16:41:52 +00:00
GSFunctionMap.cpp Re-Added eol-style:native properties to the repository. The settings got lost when we merged from Playground to Official. 2009-02-09 21:15:56 +00:00
GSFunctionMap.h GSdx: fixed a few more typos in GSVector4i, the black screen bug should be gone 2009-05-15 11:11:26 +00:00
GSLocalMemory.cpp GSdx: converted a few template classes to pointers and virtual functions, the dll got more than 100k smaller, since there were many changes, backup your old version first :P 2009-05-22 01:22:52 +00:00
GSLocalMemory.h GSdx: more refactoring (aka search and replace) 2009-05-14 16:41:52 +00:00
GSPerfMon.cpp GSdx: fixed a few more typos in GSVector4i, the black screen bug should be gone 2009-05-15 11:11:26 +00:00
GSPerfMon.h GSdx: fixed a few more typos in GSVector4i, the black screen bug should be gone 2009-05-15 11:11:26 +00:00
GSRasterizer.cpp GSdx: converted a few template classes to pointers and virtual functions, the dll got more than 100k smaller, since there were many changes, backup your old version first :P 2009-05-22 01:22:52 +00:00
GSRasterizer.h GSdx: more refactoring (aka search and replace) 2009-05-14 16:41:52 +00:00
GSRenderer.cpp GSdx: more source cleanup and something interesting on F7 2009-05-22 23:23:38 +00:00
GSRenderer.h GSdx: more source cleanup and something interesting on F7 2009-05-22 23:23:38 +00:00
GSRendererHW.cpp Re-Added eol-style:native properties to the repository. The settings got lost when we merged from Playground to Official. 2009-02-09 21:15:56 +00:00
GSRendererHW.h GSdx: bit more work on the vertex buffer, and broken ffxii fmv fixed again. 2009-05-26 03:40:31 +00:00
GSRendererHW9.cpp GSdx: bit more work on the vertex buffer, and broken ffxii fmv fixed again. 2009-05-26 03:40:31 +00:00
GSRendererHW9.h GSdx: more source cleanup and something interesting on F7 2009-05-22 23:23:38 +00:00
GSRendererHW10.cpp GSdx: bit more work on the vertex buffer, and broken ffxii fmv fixed again. 2009-05-26 03:40:31 +00:00
GSRendererHW10.h GSdx: more source cleanup and something interesting on F7 2009-05-22 23:23:38 +00:00
GSRendererNull.cpp Re-Added eol-style:native properties to the repository. The settings got lost when we merged from Playground to Official. 2009-02-09 21:15:56 +00:00
GSRendererNull.h GSdx: more source cleanup and something interesting on F7 2009-05-22 23:23:38 +00:00
GSRendererSW.cpp GSdx: bit more work on the vertex buffer, and broken ffxii fmv fixed again. 2009-05-26 03:40:31 +00:00
GSRendererSW.h GSdx: bit more work on the vertex buffer, and broken ffxii fmv fixed again. 2009-05-26 03:40:31 +00:00
GSScanlineEnvironment.h GSdx: more refactoring (aka search and replace) 2009-05-14 16:41:52 +00:00
GSSetting.cpp Re-Added eol-style:native properties to the repository. The settings got lost when we merged from Playground to Official. 2009-02-09 21:15:56 +00:00
GSSetting.h Re-Added eol-style:native properties to the repository. The settings got lost when we merged from Playground to Official. 2009-02-09 21:15:56 +00:00
GSSettingsDlg.cpp GSdx: now I think only the window classes of mfc are left to be replaced (main window, config dialog), trying to get familiar with wx... 2009-05-18 11:08:04 +00:00
GSSettingsDlg.h GSdx: trying to get rid of windows dependencies, still many classes to replace :P 2009-05-11 08:18:00 +00:00
GSSetupPrimCodeGenerator.cpp GSdx: bit more work on the vertex buffer, and broken ffxii fmv fixed again. 2009-05-26 03:40:31 +00:00
GSSetupPrimCodeGenerator.h GSdx: more refactoring (aka search and replace) 2009-05-14 16:41:52 +00:00
GSState.cpp GSdx: bit more work on the vertex buffer, and broken ffxii fmv fixed again. 2009-05-26 03:40:31 +00:00
GSState.h GSdx: optimized local-local transfer a bit, it boosts fps in games like ffxii or ico, which do a lot of moves in local memory. 2009-05-20 15:35:31 +00:00
GSTables.cpp GSdx: more refactoring (aka search and replace) 2009-05-14 16:41:52 +00:00
GSTables.h GSdx: more refactoring (aka search and replace) 2009-05-14 16:41:52 +00:00
GSTexture.cpp Re-Added eol-style:native properties to the repository. The settings got lost when we merged from Playground to Official. 2009-02-09 21:15:56 +00:00
GSTexture.h GSdx: converted a few template classes to pointers and virtual functions, the dll got more than 100k smaller, since there were many changes, backup your old version first :P 2009-05-22 01:22:52 +00:00
GSTexture7.cpp GSdx: more refactoring (aka search and replace) 2009-05-14 16:41:52 +00:00
GSTexture7.h GSdx: more refactoring (aka search and replace) 2009-05-14 16:41:52 +00:00
GSTexture9.cpp GSdx: this should fix d3d9 mode and the aspect ratio bug 2009-05-15 07:48:51 +00:00
GSTexture9.h GSdx: more refactoring (aka search and replace) 2009-05-14 16:41:52 +00:00
GSTexture10.cpp GSdx: more refactoring (aka search and replace) 2009-05-14 16:41:52 +00:00
GSTexture10.h GSdx: more refactoring (aka search and replace) 2009-05-14 16:41:52 +00:00
GSTextureCache.cpp GSdx: converted a few template classes to pointers and virtual functions, the dll got more than 100k smaller, since there were many changes, backup your old version first :P 2009-05-22 01:22:52 +00:00
GSTextureCache.h GSdx: converted a few template classes to pointers and virtual functions, the dll got more than 100k smaller, since there were many changes, backup your old version first :P 2009-05-22 01:22:52 +00:00
GSTextureCache9.cpp GSdx: converted a few template classes to pointers and virtual functions, the dll got more than 100k smaller, since there were many changes, backup your old version first :P 2009-05-22 01:22:52 +00:00
GSTextureCache9.h GSdx: converted a few template classes to pointers and virtual functions, the dll got more than 100k smaller, since there were many changes, backup your old version first :P 2009-05-22 01:22:52 +00:00
GSTextureCache10.cpp GSdx: converted a few template classes to pointers and virtual functions, the dll got more than 100k smaller, since there were many changes, backup your old version first :P 2009-05-22 01:22:52 +00:00
GSTextureCache10.h GSdx: converted a few template classes to pointers and virtual functions, the dll got more than 100k smaller, since there were many changes, backup your old version first :P 2009-05-22 01:22:52 +00:00
GSTextureCacheSW.cpp GSdx: optimized local-local transfer a bit, it boosts fps in games like ffxii or ico, which do a lot of moves in local memory. 2009-05-20 15:35:31 +00:00
GSTextureCacheSW.h GSdx: optimized local-local transfer a bit, it boosts fps in games like ffxii or ico, which do a lot of moves in local memory. 2009-05-20 15:35:31 +00:00
GSTextureFX9.cpp GSdx: bit more work on the vertex buffer, and broken ffxii fmv fixed again. 2009-05-26 03:40:31 +00:00
GSTextureFX9.h GSdx: bit more work on the vertex buffer, and broken ffxii fmv fixed again. 2009-05-26 03:40:31 +00:00
GSTextureFX10.cpp GSdx: bit more work on the vertex buffer, and broken ffxii fmv fixed again. 2009-05-26 03:40:31 +00:00
GSTextureFX10.h GSdx: converted a few template classes to pointers and virtual functions, the dll got more than 100k smaller, since there were many changes, backup your old version first :P 2009-05-22 01:22:52 +00:00
GSTextureNull.cpp Re-Added eol-style:native properties to the repository. The settings got lost when we merged from Playground to Official. 2009-02-09 21:15:56 +00:00
GSTextureNull.h GSdx: more refactoring (aka search and replace) 2009-05-14 16:41:52 +00:00
GSThread.cpp GSdx: more refactoring (aka search and replace) 2009-05-14 16:41:52 +00:00
GSThread.h GSdx: more refactoring (aka search and replace) 2009-05-14 16:41:52 +00:00
GSUtil.cpp GSdx: more source cleanup and something interesting on F7 2009-05-22 23:23:38 +00:00
GSUtil.h GSdx: more refactoring (aka search and replace) 2009-05-14 16:41:52 +00:00
GSVector.cpp GSdx: fixed a few more typos in GSVector4i, the black screen bug should be gone 2009-05-15 11:11:26 +00:00
GSVector.h GSdx: bit more work on the vertex buffer, and broken ffxii fmv fixed again. 2009-05-26 03:40:31 +00:00
GSVertex.h GSdx: more refactoring (aka search and replace) 2009-05-14 16:41:52 +00:00
GSVertexHW.h GSdx: more refactoring (aka search and replace) 2009-05-14 16:41:52 +00:00
GSVertexList.cpp Re-Added eol-style:native properties to the repository. The settings got lost when we merged from Playground to Official. 2009-02-09 21:15:56 +00:00
GSVertexList.h GSdx: more refactoring (aka search and replace) 2009-05-14 16:41:52 +00:00
GSVertexSW.cpp GSdx: more refactoring (aka search and replace) 2009-05-14 16:41:52 +00:00
GSVertexSW.h GSdx: more refactoring (aka search and replace) 2009-05-14 16:41:52 +00:00
GSWnd.cpp GSdx: now I think only the window classes of mfc are left to be replaced (main window, config dialog), trying to get familiar with wx... 2009-05-18 11:08:04 +00:00
GSWnd.h GSdx: trying to get rid of windows dependencies, still many classes to replace :P 2009-05-11 08:18:00 +00:00
GSdx.cpp GSdx: now I think only the window classes of mfc are left to be replaced (main window, config dialog), trying to get familiar with wx... 2009-05-18 11:08:04 +00:00
GSdx.def git-svn-id: http://pcsx2.googlecode.com/svn/trunk@411 96395faa-99c1-11dd-bbfe-3dabce05a288 2009-02-06 19:15:15 +00:00
GSdx.h GSdx: now I think only the window classes of mfc are left to be replaced (main window, config dialog), trying to get familiar with wx... 2009-05-18 11:08:04 +00:00
GSdx.rc GSdx: reworked the gs transfer function a bit, and removed the nloop hack, which does not seem to be necessary anymore. 2009-04-17 01:06:27 +00:00
GSdx_vs2008.vcproj GSdx: converted a few template classes to pointers and virtual functions, the dll got more than 100k smaller, since there were many changes, backup your old version first :P 2009-05-22 01:22:52 +00:00
resource.h GSdx: disabled blurring can be re-enabled in the settings or with the END key, the image shifting is corrected back to 1 pixel even if the internal rendering resolution is upscaled. 2009-03-24 09:11:03 +00:00
stdafx.cpp GSdx: trying to get rid of windows dependencies, still many classes to replace :P 2009-05-11 08:18:00 +00:00
stdafx.h GSdx: converted a few template classes to pointers and virtual functions, the dll got more than 100k smaller, since there were many changes, backup your old version first :P 2009-05-22 01:22:52 +00:00