gonetz / GLideN64

A new generation, open-source graphics plugin for N64 emulators.
Other
770 stars 179 forks source link

Inaccurate dithering matrices #2359

Closed TorutheRedFox closed 3 years ago

TorutheRedFox commented 3 years ago

The matrices for dithering aren't accurate to hardware. The N64 doesn't use typical dithering matrices like most PC games and the PS1 for example.

GLideN64: image

AngryLion/hardware: image

oddMLan commented 3 years ago

@gizmo98 did you forget to submit the dither filter? I don't see glsl_DitherFilter.cpp in the source tree

gizmo98 commented 3 years ago

@oddMLan I was not sure if this feature will be used. Gonetz removed blur post processing a long time ago. Dither filter is more adaptive and will not smooth out edges or transitions to 2D elements. @gonetz Shall i do open a PR for dither filter feature?

fzurita commented 3 years ago

@gizmo98 I tried your dither post processing step in Android and I'm not really seeing much of a difference compared to regular output. Even at 1x resolution.

Is the difference really hard to see? I had FXAA disabled as well.

gizmo98 commented 3 years ago

@fzurita Branch blur2? You should see it at 1x and 2x native res in Mario64, Lylat Wars, Mario Golf and Castlevania if dithering is enabled.

fzurita commented 3 years ago

I used blur3 branch. I'll keep playing around with it.

Also, there is one difference with your I'm using your shader. I'm applying as a part processing step on Android instead of induce GLideN64.

fzurita commented 3 years ago

Raising the "limit" value to 0.8 makes the effect much more noticeable. I couldn't notice any blur without raising that value.

gonetz commented 3 years ago

@oddMLan I was not sure if this feature will be used. Gonetz removed blur post processing a long time ago. Dither filter is more adaptive and will not smooth out edges or transitions to 2D elements. @gonetz Shall i do open a PR for dither filter feature?

I removed my implementation of blur post processing because it was hard to port on the new architecture. Not a big loss. Reshade has better blur filter. Dither filter is more N64 specific, I have no objections against it. I would like to see comparison screen shots though, with pointers where to look at :)

gizmo98 commented 3 years ago

@fzurita It's really just a slight effect to blur dithering a little bit. You can use dither test rom http://mattpierce.info/n64-dither to enable and disable filter at runtime to see the effect. I just use the vertical values of a gauss filter at the moment. The vertical values of a average filter blur more.

@gonetz i will make some screenshots.

A not so accurate solutions would be to use bilateral filtering: https://www.shadertoy.com/view/4dfGDH