PCSX2 - The Playstation 2 Emulator
Go to file
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
3rdparty Some work on variable type consistancy, and getting rid of 64 bit processor checks. 2009-05-17 21:57:24 +00:00
bin I don't think we really need someone's random Thumbs.db file on the SVN. 2009-03-31 10:21:22 +00:00
common Some quick fixes. 2009-05-24 04:34:23 +00:00
fps2bios FPS2BIOS. 2009-03-10 23:05:35 +00:00
pcsx2 microVU: 2009-05-27 05:33:36 +00:00
plugins GSdx: Even more alpha test voodoo magic, it must be nailed now! 2009-05-27 05:55:32 +00:00
build.sh ZeroPad: Refactor a bunch of code. Escape now sets the key value to 'Unknown' when configuring. Work some more on the hat code (still disabled). 2009-05-23 11:57:28 +00:00
pcsx2_suite_2008.sln Optimized vtlb direct path memory operations using some crafty asm code. Expect 2-3% speedups in most things, and perhaps more in some FMVs. 2009-05-06 02:15:43 +00:00