libretro / common-shaders

Collection of commonly used Cg shaders. These shaders are usable by either HLSL and/or Cg runtime compilers. The cg2glsl script will translate most of these into GLSL shaders.
http://www.libretro.com
1.05k stars 253 forks source link

mdapt dedithering doesn't blend very well with bigger grids #156

Open whatwwkd4496 opened 5 years ago

whatwwkd4496 commented 5 years ago

Original Original mdapt mdapt gdapt gdapt cbod cbod

infact none of the available shaders able to blend the dithering in this scene. for reference purposes heres what it looks like with kawase0:

kawase0 kawase0

blur7 blur7 blur7 completely blends checkerboard pattern

whatwwkd4496 commented 4 years ago

i've done some manual tinkering of this scene to get an idea on how it would turned out manual tinkering manual tinkering by splitting odd and even pixels verticaly and horizontaly and further splitting halved pixels to quarter size to get 4 split images then blend them into two final look. and the bottom right is the combination of two final images to get one combined final-final look.

hizzlekizzle commented 4 years ago

yeah, mdapt is pretty cautious about dithering detection. gdapt is from the same author as mdapt and is designed to catch more patterns at the cost of more false-positives.

GTUv50 is another good shader for handling dithering. You can drop the horizontal/vertical signal bandwidth until the dithering starts to blend. It's basically a blur that you can fine-tune: image

whatwwkd4496 commented 4 years ago

could you make an edge preserving dedithering with two variants, one is for graphics priority with more aggressive blending with more errors, and another is for text priority with subtle blending without causing text errors. so two needs can be satisfied. i'm guessing the text priority part is already exist and fullfilled its purpose. because fighting games like this could benefit more from graphics than text.

hizzlekizzle commented 4 years ago

It's possible, but it's not just text that gets blended with false positives; any small detail like eyes can get averaged away.

whatwwkd4496 commented 4 years ago

yes please.

whatwwkd4496 commented 4 years ago

i've been thinking. this dithering is basicly checkerboard rendering of two layer of frames that overlays on top of each other to produce transparency effect, so it's two half-pixel-frames that needs to be upscaled to full frames and overlaid on top of each. so we already have upscaling filters like scalex, xbr, and nnedi3. first we need to upscale odd and even pixels separately then blend them to a single frame. is anyone willing to attempt that approach?

whatwwkd4496 commented 3 years ago

i found something good Eternal Champions (USA)-210627-205759-1x_DitherDeleterV3-Smooth- 32 _115000_G_4x but its an ESRGAN model (DitherDeleterV3) and rendering time is terrible.