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.03k stars 250 forks source link

List of broken shader profiles #150

Closed LazyBumHorse closed 5 years ago

LazyBumHorse commented 5 years ago

I've written a small python script to check for non-existing paths in shader profiles and it found a bunch of them. Here's the list of currently broken profiles:

cgp\n64-vifilter\vifilter-crt.cgp
non-existent path: ../../crt/shaders/crt-geom-flat.cg

crt\shaders\phosphorlut-v3\phosphorlut-4k-noblend.cgp
non-existent path: ../../misc/image-adjustment.cg

scalefx\shaders\old\scalefx_hybrid.cgp
non-existent path: ../../anti-aliasing/shaders/reverse-aa-noring.cg

scalefx\shaders\old\xsoft+scalefx+sharpsmoother.cgp
non-existent path: ../../blurs/sharpsmoother.cg
non-existent path: ../../xsoft/shaders/4xsoft.cg

scalefx\shaders\old\xsoft+scalefx.cgp
non-existent path: ../../xsoft/shaders/4xsoft.cg

scalefx\shaders\old\xsoft+scalefx_hybrid.cgp
non-existent path: ../../anti-aliasing/shaders/reverse-aa-noring.cg
non-existent path: ../../xsoft/shaders/4xsoft.cg

scalefx\shaders\old\xsofter+scalefx.cgp
non-existent path: ../../stock.cg
non-existent path: ../../xsoft/shaders/4xsoft.cg

scalefx\shaders\old\xsofter+scalefx_hybrid.cgp
non-existent path: ../../anti-aliasing/shaders/reverse-aa-noring.cg
non-existent path: ../../stock.cg
non-existent path: ../../xsoft/shaders/4xsoft.cg

test\cgp\2xbr-c-lv1-ra-dilation.cgp
non-existent path: ../../anti-aliasing/reverse-aa.cg
non-existent path: ../../warp/dilation.cg

test\cgp\2xbr-c-lv1-ra.cgp
non-existent path: ../../anti-aliasing/reverse-aa.cg

test\cgp\2xbr-lv3-ra.cgp
non-existent path: ../../anti-aliasing/reverse-aa.cg

test\live-borders\bigblur.cgp
non-existent path: ../stock.cg

test\live-borders\color-grid.cgp
non-existent path: ../stock.cg

test\live-borders\mudlord.cgp
non-existent path: ../stock.cg

test\live-borders\shiny-iterations.cgp
non-existent path: ../stock.cg

test\live-borders\voronoi.cgp
non-existent path: ../stock.cg

test\live-borders\zsnes-snow.cgp
non-existent path: ../stock.cg

xbr\shaders\xbr-lv2-multipass\xbr-lv2-dilation-a.cgp
non-existent path: ../../warp/dilation.cg

xbr\shaders\xbr-lv2-multipass\xbr-lv2-dilation-b.cgp
non-existent path: ../../warp/dilation.cg

xbr\shaders\xbr-lv2-multipass\xbr-lv2-dilation-c.cgp
non-existent path: ../../warp/dilation.cg

xbr\shaders\xbr-lv2-multipass\xbr-lv2-dilation-d.cgp
non-existent path: ../../warp/dilation.cg

xbr\shaders\xbr-lv2-multipass\xbr-lv2-noblend-dilation-c.cgp
non-existent path: ../../warp/dilation.cg

Most of them are 'old' or 'test', but there are some legitimate ones. From what it looks like, only crt-geom-flat.cg doesn't exist, there's a link to it on the emulation wiki, though I don't know if it actually works. The rest of the references are broken because of the directory structure.

There are also a bunch of broken GLSL and Slang profiles, I'll report it on these repositories too.

It's too bad it's not yet possible to cycle through all shaders in RetroArch itself. That was actually the original goal of the script, until I found this.

hizzlekizzle commented 5 years ago

Thanks for these. I think I got 'em all fixed up. Let me know if I missed anything.

LazyBumHorse commented 5 years ago

@hizzlekizzle There's something going on with both slangp and glslp sabr-hybrid-deposterize. The slangp has a missing reference to edge-detect.slang, weirdly doesn't use the actual sabr-hybrid-deposterize.slang shader with the same name and not to mention it looks like nothing because it ends with edge-detect. The glslp just uses sbar-hybrid.glsl (there's no deposter version), which also seems wrong, at least wrongly named.

There's probably more shenanigans going on, but it's hard to test all the profiles. Ideally I want to automatically collect screenshots for every shader in every language and compare them. The (horribly inefficient) script I'm writing collected 398 screenshots from the slang profiles, 162 of them broken due to something I missed while loading the profiles, but from the rest I just found that super-xbr-deposterize-small-details.slangp produces identical output to xbr-deposterize-small.slangp because it sets a DETAILS parameter to 1, which, if I understood the parameter system correctly, no shader actually uses. Here's a full list of profiles with unused DETAILS parameters:

super-xbr-6p-adaptive.cgp
super-xbr-2p-small-details.glslp
super-xbr-3p-smoother-small-details.glslp
super-xbr-2p-small-details.slangp
super-xbr-3p-smoother-small-details.slangp
super-xbr-deposterize-small-details.slangp

I'm not sure if this the parameter just isn't yet integrated in the shader, or if it's a relic of some old version or similar.

That's another thing that can be automatically checked, unused parameters, maybe there's more to be discovered.

hizzlekizzle commented 5 years ago

Alright, I think those should be all fixed up, too. IIRC, the DETAILS thing was something at one point but then got obsoleted by an update to the shaders and the presets were never updated/deleted to match.

LazyBumHorse commented 5 years ago

Just scanned for unused parameters, there are over 2000 of them.

Many of them do appear as constants in the shaders and they could be made into functioning parameters, but especially stuff like target_gamma, monitor_gamma, R, G, B, contrast, saturation, etc. seems to be superseeded by the image-adjustment shader.

At least I could find out what the DETAILS parameter in super-xbr was about: WP1, WP2, WP3, WP4, WP5, WP6 and DETAILS were all free parameters until they were replaced by 3 presets which are set through MODE. MODE = 1 would give you the old 'small-details' presets, at least in GLSL and Slang, seems like cg didn't get much treatment.

There's also presets which use nedi-jinc instead of jinc2 and set JINC2_WINDOW_SINC, JINC2_SINC and JINC2_AR_STRENGTH, but nedi-jinc uses a NEDI_ prefix. Not sure how nedi-jinc actually differs, the code is nearly identical.

crt-lottes-multipass-interlaced-glow and vector-glow set glowFactor, which doesn't even appear in any shader, which is concerning. vector-glow-alt-render sets trail_bright, which appears in glow-trails1, but this shader isn't used in any preset, weird.

I'm not yet sure what to do with all this information, some of it might indicate that the presets don't quite look like they are meant to look, but that is pretty minor when you can tweak the parameters in RetroArch yourself. The stuff that's a bit more concerning are the unused parameters that don't appear anywhere.

If you want to take a dive, here's the raw data: unused parameters.zip And of course, the script source.