Mdapt & gdapt - dithering treatment [Updated 06/06/14]

hmm… the only thing common I can see is the huge amount of accessed pixels. maybe it’s a problem with the TEX-function. ok, try this. open mdapt-pass2.cg of v2.7 and replace in line 19

#define TEX(dx,dy) tex2D(decal, VAR.texCoord+float2((dx),(dy))*VAR.t1)

with

#define TEX(dx,dy) tex2D(decal, VAR.texCoord+float2((dx),(dy))*VAR.t1).xy

and see if it works now at this pass. I was kinda lame since it worked on my system and I took it for granted. but maybe this causes unusual behavior on other systems.

Thank you, it now fails at pass3.

thanks for the feedback, that’s very good to know. I’m really suprised that I nailed the problem with the first guess. ok, I’m gonna check the rest of the passes for similar problems and post a package for you to test. stay tuned :wink:

please try this. if it works I’m gonna ask the admin to update the files on the shader repo: https://mega.co.nz/#!SE5SEaQZ!EzfgRn73J … BF7ZdHKDtU

Fail again at pass3. I was afraid the problem was my card not powerful or compatible enough. I got more non working shaders so I thought that could be the reason, probably Quadro cards work differently to geforce?

hmm, too bad. I don’t know the specific differences between the gpu types myself, seems there are some differences which profiles are supported. well, here is another try: https://mega.co.nz/#!GdBREbwT!NzC4QzXce … 3qwQAEv5OI

no luck, pass3 again, everything turns green, then black at SMW intro.

sry, don’t know what else to try. I think it has something to do with the access support to the original texture, since pass3 is the first one in mdapt which uses it. that’s something the devs of retroarch must fix, if it is a bug anyway. quadro is probably just a too obscure gpu, maybe you can try it again sometimes if you’re using a geforce or radeon gpu.

ok, no prob. Thanks for the help.

and I’m back with an update. the new mdapt version fixes an issue which prevented it from working correctly on nvidia GPUs. both mdapt and gdapt support the new shader parameter feature, so you can configure them with the retroarch GUI (make sure you use a recent version). there is a “adjust view” mode where you can better observe how the parameters influence the result. additionally gdapt now has a custom “error prevention level” which is basicially a tradeoff between getting all the dithering and false detections.

it’s not yet available on the common shaders repository but you can download my shaders here already. included is also my own attempt of a morphing shader (dilation/erosion) which I is called smart-morph now. check it out:

https://anonfiles.com/file/36cf845bd92b … e7503278a0

edit: it’s available now at the shader repo.

Hello Sp00kyFox, I can’t test your new version with my old card since I got a GTX 750 Ti now, but it doesn’t work either, I used build dated 16-05, do I need a more recent build? gdapt works though.

check out the link in the first post: viewtopic.php?f=25&t=993

most recent version is “RetroArch-Win64-2014-06-05.7z”, works fine here with a GTX 760 in OpenGL.

Didn’t work either. I also use OpenGL. From the dithering folder the only one that worked was mdapt-4p, then I tried mdapt-5xbr.cgp and RA crashed and closed.

there is no mdapt-4p. neither in the file I uploaded nor on the common shader repository. the shaders bundled with the test versions are outdated, make sure you use the one I uploaded and post an error log if it crashes. if it doesn’t work correctly make a screenshot and see at which pass the problem occurs.

Yes, there was mdapt-4p, and I used as a way to help you see what was different from current version, I tested your new version on new RA build, on GL and did render black as stated a few pages back. Now I tested again to reproduce the crash and the thing worked, no surprise here, I get different results from first attempts than in later uses, it looks like the card needs some “learning” or something… Anyway effect is too soft for Jurassic Park at least, I tried tweaking through RGUI without success.

jurassic park is a special case like with some other SNES games. it uses the hi resolution mode of the system for the hud elements. by that non-hud pixels like the dithering on the ground are actually doubled and can’t be detected by my dithering shaders. you have to do some tricks to make pixelart based shaders work together with these games. see aliaspiders post for that:

viewtopic.php?p=3521#p3521

I was about to comment that about the ground pattern. I tested aliaspider approaches, but the mdapt-pass files it requires must be some old versions. I knew that set of images since long ago, and found them incredible, but I was never targeting to xbr so left it apart, now I know it’s rather about hires transparency.

aliaspider recently made the gtu shader, could that be the new version of that old mdapt workaround? I actually tested over the Jurassic Park game and looks quite great, although with some minor glitches.

yeah, that post by aliaspider is quite old. but the approach is still the same. create a new file “mdapt-hires-downscale.cgp” in your shaders\dithering\mdapt folder with the following content:

shaders = 6

shader0 = ../../stock.cg
filter_linear0 = true
scale_type_x0 = source
scale_x0 = 0.5

shader1 = passes/mdapt-pass0.cg
filter_linear1 = false
scale_type1 = source
scale1 = 1.0

shader2 = passes/mdapt-pass1.cg
filter_linear2 = false
scale_type2 = source
scale2 = 1.0

shader3 = passes/mdapt-pass2.cg
filter_linear3 = false
scale_type3 = source
scale3 = 1.0

shader4 = passes/mdapt-pass3.cg
filter_linear4 = false
scale_type4 = source
scale4 = 1.0

shader5 = passes/mdapt-pass4.cg
filter_linear5 = false
scale_type5 = source
scale5 = 1.0

which gives me this nice result with default parameters:

Thank you, it looks great, I only get half screen when I enable the last mdapt pass.

edit: your update worked, thanks!

oh nice to hear. I though it was related to you using snes9x, since that emulator handles hires games in another way. I’d recommend using one of the bsnes cores anyway.