ScaleNx - Artifact Removal and Algorithm Improvement

It’s OK regarding my included shaders, they are already GPL v2 or later. But you can use them nevertheless if there is a license discrepancy.

1 Like

Fine, thank you so much :smiley:

ScaleFX Scaler - shaders with preset

Have been working on the next iteration of the excellent ScaleFX algorithm (from @Sp00kyFox) upscaling. I tried some new methods and the results are very nice. I have been able to do a working upscaler, because the algorithm itself doesn’t interpolate colors and is therefore very friendly towards enhancements. I think it’s more advanced than existing methods. You can try the composition by the following link.

Download link: (Edit: not working any more)

https://mega.nz/file/pkIEgRQL#RJ1PStY-XAbp3P5MHCdzH2DhQfcRR8CIn-bw6OREohY

4 Likes

Nice, any screens showing improvements?

This deblur is specific for these shaders or is a general solution that can replace the regular one find on repo? (I see that it uses some loop structures, which can be less compatible with “toasters” running Retroarch)

2 Likes

Everyone and their damn toasters XD

Seems like toaster users make up the majority of our user base, or at least the vocal part of it anyway lmfao

Indeed. My PS3, for example, can run loops only if the iteration variable is fixed (LOL). Shader languages have been a mess up development over the years.

A big issue is allowing “legacy” support to go on for so long imho.

A legacy folder for each shader (folder) should be a good way to support toasters. I mean, when a big change/refactoring of a known filter is under way, the old one should be put on a legacy folder. I did it once for xbr, the legacy folder is still there.

1 Like

It should work nicely with any no-blend scaler, but it uses lookups from different passes, so the specific version is preset based.

Loop structures are supported as a part of the GLSL spec. since 30-April-2004. :grin:

1 Like

Indeed, though some toasters only run cg language. The messed up shader language development let the cg only toasters on a cold and lonely place. Kkk :cold_face:

1 Like

I think a very fast deblur might be possible for smoothened shaders, need to test it first though. Otherwise i’m pretty fond with the vulkan in libretro and npot texture sizes… Makes life much more easier.

Edit: unfortunately, some bulkier code is needed for reshaping, otherwise it leaves a dull impression.

2 Likes

I think it works with smoothened shaders if you get rid of AA passes.

What I’m used to do: if the scaler is only a line doubler, I put some stock or quilez to scale to 4x and then use deblur for the final touch. If the scaler is already at 4x, I skip the stock/quilez pass and uses just deblur.

Deblur works very well on 4x scaled screens.

1 Like

This special version of deblur does not like interpolation layers, maybe it could work on vanilla PSX 2x or so, but it’s a bit limited.

Oh, i forgot xbr-lvl3-noblend, my fauvorite :grin:. Works very well and is almost as fast at 1080p:

1 Like

It looks great too!

Here’s a shot of regular deblur over sxbr running on PS3:

1 Like

Many of the GLSL shaders have #ifdef VERSION <130, etc. to specify toaster-friendly codeblocks, frequently unrolled loops and non-constant arrays and other messy stuff. Sometimes it just isn’t possible to make it work, though, and I’m fine with old/legacy subdirectories, especially when the new version looks significantly different (like the old ScaleFx)

1 Like

The scaler also seems to be compatible with the rAA (hybrid) code. It wasn’t that nice in my expectations, because old deblur made line ‘invasion’ more apparent etc. But it looks better than i expected.

Two versions are possible with the rAA code, a sharp, which handles aliased graphic nicer, and regular, which does it much nicer, but also adds some blur.

Anyway, both are included.

Download link:

https://mega.nz/file/J0hCGSgC#_gT0t1aqtRjCZp5sRvjITCZVq71QzcWVojIgYNlDZjs

3 Likes

Have you considered making a blend of scalenx + CRT shaders? There are a couple of presets available but I’d be interested in your take.

2 Likes

I have been typically a fan of scaling shaders with a crt mask only. xBR/xBRZ + smoothing + mask is a very nice combo, at least for me. Unfortunately emulators are taking a very slow pace with pixel shader texture upscaling, which could take on scalefx, for example. I like vanilla ‘scaling’ with crt for older retro games better though.

2 Likes

You didn’t ask me, but I’ll try to help you making a preset:

After scaling to 3x using scalefx, you should use another shader to downscale the result to 2x1 (use 0.667 and 0.333 factors, respectively). After that, use any crt shader to viewport.

To downscale, use just stock.cg and linear sampling.

I didn’t test 3x1, though. Maybe it can bring good results.

The tip to combine any shader with crt is to bring back The scaling vertically to 1x.

If the result is still too rough, use an aa shader at 1x to soft scalefx output before The downscale pass. A good AA shader is fxaa at 1x and linear.

Another good downscaler is quilez shader.

3 Likes

I didn’t want to spoil, but it’s quite nice and very adjustable.

4 Likes