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
..
2009-02-09 21:15:56 +00:00
2009-05-27 05:55:32 +00:00
2009-05-22 01:22:52 +00:00
2009-02-22 16:28:39 +00:00
2009-05-14 16:41:52 +00:00
2009-05-22 23:23:38 +00:00
2009-05-14 16:41:52 +00:00
2009-05-14 16:41:52 +00:00
2009-05-14 16:41:52 +00:00
2009-05-14 16:41:52 +00:00
2009-05-14 16:41:52 +00:00
2009-05-14 16:41:52 +00:00
2009-05-22 23:23:38 +00:00
2009-05-22 23:23:38 +00:00
2009-05-22 23:23:38 +00:00
2009-05-22 23:23:38 +00:00
2009-05-22 23:23:38 +00:00
2009-05-22 23:23:38 +00:00
2009-05-14 16:41:52 +00:00
2009-05-18 11:08:04 +00:00
2009-05-11 08:18:00 +00:00
2009-05-22 01:22:52 +00:00
2009-02-20 10:59:10 +00:00
2009-05-22 23:23:38 +00:00
2009-05-22 23:23:38 +00:00
2009-02-09 21:15:56 +00:00
2009-05-22 23:23:38 +00:00
2009-05-22 01:22:52 +00:00
2009-02-09 21:15:56 +00:00
2009-02-09 21:15:56 +00:00
2009-02-09 21:15:56 +00:00
2009-05-15 11:11:26 +00:00
2009-05-14 16:41:52 +00:00
2009-05-14 16:41:52 +00:00
2009-05-18 11:08:04 +00:00
2009-05-11 08:18:00 +00:00
2009-05-23 23:52:53 +00:00
2009-05-14 16:41:52 +00:00
2009-05-14 16:41:52 +00:00
2009-05-14 16:41:52 +00:00
2009-05-18 11:08:04 +00:00
2009-05-14 16:41:52 +00:00
2009-05-22 23:23:38 +00:00
2009-05-22 23:23:38 +00:00
2009-05-27 05:55:32 +00:00
2009-05-26 03:40:31 +00:00
2009-05-27 05:55:32 +00:00
2009-05-26 03:40:31 +00:00
2009-05-22 23:23:38 +00:00
2009-05-22 23:23:38 +00:00
2009-05-22 01:22:52 +00:00
2009-05-22 01:22:52 +00:00
2009-05-20 15:35:31 +00:00
2009-05-14 16:41:52 +00:00
2009-02-09 21:15:56 +00:00
2009-04-18 09:34:25 +00:00
2009-05-14 16:41:52 +00:00
2009-05-14 16:41:52 +00:00
2009-05-22 01:22:52 +00:00
2009-05-15 11:11:26 +00:00
2009-05-14 16:41:52 +00:00
2009-05-14 16:41:52 +00:00
2009-05-22 01:22:52 +00:00
2009-05-18 11:08:04 +00:00
2009-02-06 19:15:15 +00:00
2009-05-18 11:08:04 +00:00
2009-04-17 01:06:27 +00:00
2009-02-09 21:15:56 +00:00
2009-05-15 11:11:26 +00:00
2009-05-22 01:22:52 +00:00
2009-05-14 16:41:52 +00:00
2009-05-15 11:11:26 +00:00
2009-05-15 11:11:26 +00:00
2009-05-22 01:22:52 +00:00
2009-05-14 16:41:52 +00:00
2009-05-22 23:23:38 +00:00
2009-05-22 23:23:38 +00:00
2009-05-26 03:40:31 +00:00
2009-05-22 23:23:38 +00:00
2009-05-26 03:40:31 +00:00
2009-05-22 23:23:38 +00:00
2009-02-09 21:15:56 +00:00
2009-05-26 03:40:31 +00:00
2009-02-09 21:15:56 +00:00
2009-05-22 23:23:38 +00:00
2009-05-26 03:40:31 +00:00
2009-05-26 03:40:31 +00:00
2009-05-14 16:41:52 +00:00
2009-02-09 21:15:56 +00:00
2009-02-09 21:15:56 +00:00
2009-05-18 11:08:04 +00:00
2009-05-11 08:18:00 +00:00
2009-05-26 03:40:31 +00:00
2009-05-14 16:41:52 +00:00
2009-05-26 03:40:31 +00:00
2009-05-20 15:35:31 +00:00
2009-05-14 16:41:52 +00:00
2009-05-14 16:41:52 +00:00
2009-05-14 16:41:52 +00:00
2009-05-14 16:41:52 +00:00
2009-05-15 07:48:51 +00:00
2009-05-14 16:41:52 +00:00
2009-05-14 16:41:52 +00:00
2009-05-14 16:41:52 +00:00
2009-02-09 21:15:56 +00:00
2009-05-22 01:22:52 +00:00
2009-05-22 01:22:52 +00:00
2009-05-22 01:22:52 +00:00
2009-05-22 01:22:52 +00:00
2009-05-22 01:22:52 +00:00
2009-05-22 01:22:52 +00:00
2009-05-22 01:22:52 +00:00
2009-05-20 15:35:31 +00:00
2009-05-20 15:35:31 +00:00
2009-05-26 03:40:31 +00:00
2009-05-26 03:40:31 +00:00
2009-05-26 03:40:31 +00:00
2009-05-22 01:22:52 +00:00
2009-02-09 21:15:56 +00:00
2009-05-14 16:41:52 +00:00
2009-05-14 16:41:52 +00:00
2009-05-14 16:41:52 +00:00
2009-05-22 23:23:38 +00:00
2009-05-14 16:41:52 +00:00
2009-05-15 11:11:26 +00:00
2009-05-26 03:40:31 +00:00
2009-05-14 16:41:52 +00:00
2009-05-14 16:41:52 +00:00
2009-02-09 21:15:56 +00:00
2009-05-14 16:41:52 +00:00
2009-05-14 16:41:52 +00:00
2009-05-14 16:41:52 +00:00
2009-05-18 11:08:04 +00:00
2009-05-11 08:18:00 +00:00
2009-03-24 09:11:03 +00:00
2009-05-11 08:18:00 +00:00
2009-05-22 01:22:52 +00:00