xBR algorithm tutorial

Small update. I made an special super-xbr derivation called small-details which is less harsh to huds, fonts and dithering. It’s on repository already.

1 Like

Hyllian, we spoke about having xbr - filtering on everything, including the 3d elements when rendering at higher gpu resolution than native. But xbr could not detect it while pixels were different sizes on pre rendered backgrounds and 3d elements, right? So I just tought, would it be possible to have one usual 3d - super - xbr for the backgrounds and then another one for the high - res assets like 3d models? Just something I had my mind on :slight_smile: Maybe that way we could get xbr filtering on everything even on 4x and 8x internal res.

I added GLSL and slang ports of those to their respective repos. Rather than creating entirely new files, though, I made a “preserve details” parameter that toggles the values rather than creating entirely new files just to change those 1-2 #defines. Then I just set the toggle in the presets.

Changing from a macro to the parameters only cost ~1-2% performance.

It isn’t possible, because the shader receives just one composed input framebuffer. It does not know which parts are 2D or 3D, it’s just a frame. In fact, all things in the frame are 2D.

Interesting. I’ll look how you did this and maybe use this approach too.

Thanx for your answer Hyllian. Well, thats a shame. Anyway I have made a very nice preset now together with your recomendation about the aa - shader.

I also gotta ask you, have you heard about this? :slight_smile:

http://mmlab.ie.cuhk.edu.hk/projects/FSRCNN.html

Yes, I knew about it. Though I wouldn’t know how to put a complex algorithm like that in shader format. I’m more interested in developing something like the NGU technique present in madVR.

There’s a problem with this approach because the tweakable parameter XBR_EDGE_STR should increase to 2.0 when DETAILS is set to 1.0. But, as it’s tweakable, it shouldn’t be set by DETAILS. Can you confirm?

Ah, yes, that’s true. However, we can set XBR_EDGE_STR to 2.0 in the preset along with setting DETAILS to 1.0.

EDIT: like this:

1 Like

I see. Well thanx anyway.

It works and what should i say…WOW. Love your work ! thx alot

@hunterk where can i find the “3D” super xbr-shaders ?

Edith: sry for the late reply…had a exhausting week at work

Just wanted to show the results I am getting with your awesome shaders. It is my own combination of super - 4xbr - 3d, super - xbr, alot of deposterize and aa shader lastly. Over that I uses ReShades sharpening and alot of debanding and finaly some color and hdr presets. The most important part I do is I run this in 4k fullscreen with Nvidia’s DSR. It makes the scaling algorithm look better along with the debanding.

Glad you like it. If you use the cg versions, the 3D shaders are at the folder.

Nice pics!

I’ll update the 3D shaders with new parameters I found. With these, the fonts, huds and dithering are less rounded, which contribute to a more consistent image structure.

EDIT: I just updated repo with new versions of these 3D shaders using new parameters.

1 Like

I dont remember how I got them, but I prefer these, they make the backgrounds most rounded and clean I think. Maybe you can tell me why they are so different?

Not a big difference. Just a bit less rounded. If you like old version, keep it.

A new version called xbr-lv2-small-details.cg released today. It’s less harsh to dithering and textures in general.

Small-details: Standard: Small-details: Standard:

1 Like

Hello Hyllian, big fan of your work

I have request, can you please release a modified version of your “super-8xbr-3d-6p.glslp” with a bit sharper and lighter colors similar to “scalefx-hybrid.glslp” , here are pics of your “super-8xbr-3d-6p.glslp” and “scalefx-hybrid.glslp” at native

I wish I didn’t had to bump this thread as I’m unable to PM. That being said, I am one of a g’mic developer and I’m looking to add pixel art scaling tool to g’mic-qt so that gimp and krita users could get easy access to the tool. It is not clear what @Hyllian means by this

For that reason, from now on, all algorithm terms will be related to the down-right edge. You’ll have to apply the same rules to the other three edges by symmetry.

I know that you have to apply the same rules, but what condition should there be for accepting one edge or the other edge? Max difference?

You should see the shaders on Retroarch repository. There you’ll see the conditions. This tutorial is outdated.