Possible dithering issue - PSX owner needed!

kalach.x
Posts: 54
Joined: Thu Dec 02, 2021 3:12 pm
Has thanked: 17 times
Been thanked: 22 times

Possible dithering issue - PSX owner needed!

Unread post 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 7067 times
Crash with rotated pattern
Crash with rotated pattern
crash_rotated.jpg (1.18 MiB) Viewed 7067 times
Silent Hill with PSX core pattern - heavy blended
Silent Hill with PSX core pattern - heavy blended
hill_core.jpg (1.17 MiB) Viewed 7067 times
Silent Hill with rotated pattern - heavy blended
Silent Hill with rotated pattern - heavy blended
hill_rotated.jpg (1.12 MiB) Viewed 7067 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?
Attachments
Presentation on "Genesis" dithering pattern
Presentation on "Genesis" dithering pattern
crash_no_blend_genesis.jpg (5.05 MiB) Viewed 7067 times
PSX.rbf
PSX build for dithering issue demonstration
(3.51 MiB) Downloaded 143 times
FPGAzumSpass
Core Developer
Posts: 385
Joined: Sat May 23, 2020 12:55 pm
Has thanked: 42 times
Been thanked: 414 times

Re: Possible dithering issue - PSX owner needed!

Unread post 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 :)
akeley
Top Contributor
Posts: 1441
Joined: Mon May 25, 2020 7:54 pm
Has thanked: 496 times
Been thanked: 467 times

Re: Possible dithering issue - PSX owner needed!

Unread post 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.

CRT SCR$ Project - building a collection of high-quality photos of CRT displays
CRT ART Books - retro-gaming books with authentic CRT photos

User avatar
terminator2k2
Posts: 36
Joined: Sun May 24, 2020 6:46 pm
Has thanked: 27 times
Been thanked: 22 times

Re: Possible dithering issue - PSX owner needed!

Unread post 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
FPGAzumSpass
Core Developer
Posts: 385
Joined: Sat May 23, 2020 12:55 pm
Has thanked: 42 times
Been thanked: 414 times

Re: Possible dithering issue - PSX owner needed!

Unread post 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 6658 times
User avatar
terminator2k2
Posts: 36
Joined: Sun May 24, 2020 6:46 pm
Has thanked: 27 times
Been thanked: 22 times

Re: Possible dithering issue - PSX owner needed!

Unread post by terminator2k2 »

psx core on the left, ps1 digital on the right
Attachments
Screenshot 2022-01-21 11-36-28.png
Screenshot 2022-01-21 11-36-28.png (1.46 MiB) Viewed 6633 times
FPGAzumSpass
Core Developer
Posts: 385
Joined: Sat May 23, 2020 12:55 pm
Has thanked: 42 times
Been thanked: 414 times

Re: Possible dithering issue - PSX owner needed!

Unread post by FPGAzumSpass »

So the pattern is correct it seems?
kalach.x
Posts: 54
Joined: Thu Dec 02, 2021 3:12 pm
Has thanked: 17 times
Been thanked: 22 times

Re: Possible dithering issue - PSX owner needed!

Unread post 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 6424 times
20220121_204037-screen_fixed.png
20220121_204037-screen_fixed.png (77.45 KiB) Viewed 6424 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 6424 times
20220121_204139-screen_blend_fixed.png
20220121_204139-screen_blend_fixed.png (90.66 KiB) Viewed 6424 times
Other example from Tenchu
20220121_212707-tenchu_blend_psx.png
20220121_212707-tenchu_blend_psx.png (85.2 KiB) Viewed 6424 times
20220121_212724-tenchu_blend_fixed.png
20220121_212724-tenchu_blend_fixed.png (86.11 KiB) Viewed 6424 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.
kalach.x
Posts: 54
Joined: Thu Dec 02, 2021 3:12 pm
Has thanked: 17 times
Been thanked: 22 times

Re: Possible dithering issue - PSX owner needed!

Unread post 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 6280 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 6280 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 6280 times
Gran Turismo PSX core alpha-blending tweaked
Gran Turismo PSX core alpha-blending tweaked
20220123_212719-gt-fix.png (68.21 KiB) Viewed 6280 times
Quake 2 PSX core defaults
Quake 2 PSX core defaults
20220123_213056-q2-original.png (181.77 KiB) Viewed 6280 times
Quake 2 PSX core alpha-blending tweaked
Quake 2 PSX core alpha-blending tweaked
20220123_213103-q2-fix.png (184.98 KiB) Viewed 6280 times
Syphon Filter PSX core defaults
Syphon Filter PSX core defaults
20220123_213338-Syphon-Filter-original.png (141 KiB) Viewed 6280 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 6280 times
Vagrant Story PSX core defaults
Vagrant Story PSX core defaults
20220123_213558-Vagrant-Story-original.png (71.69 KiB) Viewed 6280 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 6280 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 6280 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.
blacklistedcard
Posts: 91
Joined: Mon Jun 08, 2020 1:54 am
Has thanked: 3 times
Been thanked: 11 times

Re: Possible dithering issue - PSX owner needed!

Unread post by blacklistedcard »

I must be officially old. I can't see any differences in any of the screenshots.
User avatar
LamerDeluxe
Top Contributor
Posts: 1239
Joined: Sun May 24, 2020 10:25 pm
Has thanked: 887 times
Been thanked: 284 times

Re: Possible dithering issue - PSX owner needed!

Unread post 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.
Post Reply