Page 1 of 1

Possible dithering issue - PSX owner needed!

Posted: Thu Jan 20, 2022 6:52 pm
by kalach.x
While playing with PSX core, as one does, I notices something strange in module called gpu_pixelpipeline. In table used for dithering pattern when I summed all values in any given column gave -2, -2, -2 and -2 respectively and when summed values in rows I got -6, -2, -6, -2. If SONY engineers wanted to utilize blur caused by composite video output to make dither patterns less visible they would rather make adjacent columns of pixel have biggest color difference and keep sum of the values in rows the same so that each scanline has the same brightness. Compared to how it is now implemented in PSX core they would rotate this table and make sure each line was the same brightness overall.

And sure enough when I made test build it gave better results. On first glance dither patterns look pretty much the same. There is however much less false-scanlines, especially when using some form of blending. To me it looks like a PSX core bug and dither pattern table should be rotated. Unfortunately I do not have real PSX at hand to test my hypothesis.

Images on internet are inconclusive and besides often people use emulation which is no good for comparison. Also is it true that different PSX models used different dithering patterns? If that is true then perhaps we should have option for dithering pattern?
Crash with PSX core pattern
Crash with PSX core pattern
crash_core.jpg (1.29 MiB) Viewed 7078 times
Crash with rotated pattern
Crash with rotated pattern
crash_rotated.jpg (1.18 MiB) Viewed 7078 times
Silent Hill with PSX core pattern - heavy blended
Silent Hill with PSX core pattern - heavy blended
hill_core.jpg (1.17 MiB) Viewed 7078 times
Silent Hill with rotated pattern - heavy blended
Silent Hill with rotated pattern - heavy blended
hill_rotated.jpg (1.12 MiB) Viewed 7078 times
And here some random Silent Hill on PSX photo I found. Not sure if from real hardware but I guess that yes.
Image

I made build with such option and four choices. Last one is my 'Genesis' dithering simulation. It is actually better for the smart blend feature I am developing. When blended it gives pretty much the same image as imho original pattern except for some edge cases where it has less artifacts. In any way it is cool to see "what might have been" if SONY used different dithering pattern. On composite it would look pretty much the same even if they did and on RGB it would look more like Genesis on RGB. I actually like it more than checkerboard with diamonds that SONY used :)

ps. values for rotated table

Code: Select all

(-4, +2, -3, +3),
(+0, -2, +1, -1),
(-3, +3, -4, +2),
(+1, -1, +0, -2)
ps2. @PSX owners
Which version of the pattern, current in PSX core or rotated (called "PSX?" in my build) looks like real hardware?

Re: Possible dithering issue - PSX owner needed!

Posted: Thu Jan 20, 2022 7:04 pm
by FPGAzumSpass
The table is taken from the unoficial documentation and i assume it's right:
https://psx-spx.consoledev.net/graphics ... /#gpu-misc

But sure it's worth checking it!

I could try, but my PSX with analog to hdmi adapter is so blurry, i cannot see it.
Would need a model with real digital out.


btw: i made some comments on your pullrequest, would be good if you could answer there :)

Re: Possible dithering issue - PSX owner needed!

Posted: Thu Jan 20, 2022 7:11 pm
by akeley
I've got quite a few "real deal" PSX shots in my collection, but they are all from RGB. Composite ones will be included in the next release, but if you really need some reference ones now I could shoot some over the next few days.

Re: Possible dithering issue - PSX owner needed!

Posted: Fri Jan 21, 2022 10:27 am
by terminator2k2
i have a ps1 digital and a elgato HD 60 , if you need any screen shots give me a shout of what your after

Re: Possible dithering issue - PSX owner needed!

Posted: Fri Jan 21, 2022 12:03 pm
by FPGAzumSpass
Thanks to Freddo in the discord we have digital capture of a 5502 pal Playstation

If someone likes, please take a unfiltered screen from the mister core with the same situation with the integrated screenshot tool of mister (not photo)
Screenshot_2022-01-21_11-07-19.png
Screenshot_2022-01-21_11-07-19.png (449.54 KiB) Viewed 6669 times

Re: Possible dithering issue - PSX owner needed!

Posted: Fri Jan 21, 2022 12:25 pm
by terminator2k2
psx core on the left, ps1 digital on the right

Re: Possible dithering issue - PSX owner needed!

Posted: Fri Jan 21, 2022 1:03 pm
by FPGAzumSpass
So the pattern is correct it seems?

Re: Possible dithering issue - PSX owner needed!

Posted: Fri Jan 21, 2022 9:44 pm
by kalach.x
Pattern does seem to be pixel perfect match

On RGB and especially when viewing it on LCD there isn't much of a difference
20220121_204028-screen_psx.png
20220121_204028-screen_psx.png (80.4 KiB) Viewed 6435 times
20220121_204037-screen_fixed.png
20220121_204037-screen_fixed.png (77.45 KiB) Viewed 6435 times
When some blending is applied the rotated version looks more correct hence the topic
20220121_204130-screen_blend_psx.png
20220121_204130-screen_blend_psx.png (89.82 KiB) Viewed 6435 times
20220121_204139-screen_blend_fixed.png
20220121_204139-screen_blend_fixed.png (90.66 KiB) Viewed 6435 times
Other example from Tenchu
20220121_212707-tenchu_blend_psx.png
20220121_212707-tenchu_blend_psx.png (85.2 KiB) Viewed 6435 times
20220121_212724-tenchu_blend_fixed.png
20220121_212724-tenchu_blend_fixed.png (86.11 KiB) Viewed 6435 times
In most games rotated patterns looks better and I will use either it or Genesis pattern because it looks pretty cool :lol:
One example for the contrary is Silent Hill where fog effect looks more uniform despite false scanlines and presumably exactly because of these false scan lines.

Anyways, big thanks for providing shots.

Re: Possible dithering issue - PSX owner needed!

Posted: Sun Jan 23, 2022 10:07 pm
by kalach.x
I found another strange thing in the code which didn't make any sense
Silent Hill PSX core alpha-blending tweaked
Silent Hill PSX core alpha-blending tweaked
20220123_200305-silent-hill-original.png (49.8 KiB) Viewed 6291 times
can easily become this
Silent Hill PSX core defaults
Silent Hill PSX core defaults
20220123_200316-silent-hill-fix.png (47.58 KiB) Viewed 6291 times
with simple trick with inverting (pluses become minuses and -1 from this because it goes from -4 to 3) dither pattern for alpha blended textures with additive draw modes.
Pretty much all games look better with this change
Gran Turismo PSX core defaults
Gran Turismo PSX core defaults
20220123_212702-gt-original.png (68.92 KiB) Viewed 6291 times
Gran Turismo PSX core alpha-blending tweaked
Gran Turismo PSX core alpha-blending tweaked
20220123_212719-gt-fix.png (68.21 KiB) Viewed 6291 times
Quake 2 PSX core defaults
Quake 2 PSX core defaults
20220123_213056-q2-original.png (181.77 KiB) Viewed 6291 times
Quake 2 PSX core alpha-blending tweaked
Quake 2 PSX core alpha-blending tweaked
20220123_213103-q2-fix.png (184.98 KiB) Viewed 6291 times
Syphon Filter PSX core defaults
Syphon Filter PSX core defaults
20220123_213338-Syphon-Filter-original.png (141 KiB) Viewed 6291 times
Syphon Filter PSX core alpha-blending tweaked
Syphon Filter PSX core alpha-blending tweaked
20220123_213353-Syphon-Filter-fix.png (133.74 KiB) Viewed 6291 times
Vagrant Story PSX core defaults
Vagrant Story PSX core defaults
20220123_213558-Vagrant-Story-original.png (71.69 KiB) Viewed 6291 times
Vagrant Story PSX core alpha-blending tweaked
Vagrant Story PSX core alpha-blending tweaked
20220123_213605-Vagrant-Story-fix.png (71.52 KiB) Viewed 6291 times
And for the last one shots with some more tweaks to remove pesky dithering
Vagrant Story PSX core alpha-blending tweaked + rotated dithering pattern + normal dithering filter enabled
Vagrant Story PSX core alpha-blending tweaked + rotated dithering pattern + normal dithering filter enabled
20220123_213619-Vagrant-Story-fix-blend-rotated.png (95.15 KiB) Viewed 6291 times
These shots were made using this core:
PSX.rbf
PSX core with blending and dithering fixes based on 230122 code
(3.59 MiB) Downloaded 130 times
As usual in this tread, would be good for some real PSX comparisons to confirm.

Re: Possible dithering issue - PSX owner needed!

Posted: Mon Jan 24, 2022 2:15 pm
by blacklistedcard
I must be officially old. I can't see any differences in any of the screenshots.

Re: Possible dithering issue - PSX owner needed!

Posted: Mon Jan 24, 2022 3:18 pm
by LamerDeluxe
blacklistedcard wrote: Mon Jan 24, 2022 2:15 pm I must be officially old. I can't see any differences in any of the screenshots.
Open them in separate tabs and zoom in. The difference is subtle, but an improvement.