xBR algorithm tutorial

I’ve got a bilateral filter running to combine jinc2 with xBR (standard). On low gradient regions it behaves like jinc2 with all color nuances. On high gradient edges it behaves like xbr. So it gets the best of both worlds.

Here are some screenshots:

002-250429-075118-250501-131058 002-250429-075118-250501-131054 002-250429-075118-250501-131050 002-250429-075118-250501-131046 002-250429-075118-250501-131041 003538-250501-090001 003538-250430-184255

It was uploaded to the repo: https://github.com/libretro/slang-shaders/pull/700/files

It isn’t just that, the same framework may be used with any other shader. Obviously some combinations don’t work well.

6 Likes

Fonts are pretty, it’s hard to get them right. I’ll test it later, but it already looks interesting. Seems more on the balanced side, which is advantageous to be an agnostic alternative for different kinds of contents.

2 Likes

Any reason for going back to working in gamma space?

1 Like

Read this topic and you’ll understand.

I’ll probably return to linear gamma the same way I did for some edge-smoothing non-separable filters in this update from yesterday.

2 Likes

:wave: Hiya! :wave: I’m not smart enough to work out xBR even with this tutorial. Thanks though, I bet it helps the community alot. I could maybe get someone to port it…

See, I was wondering if you could try porting xBR for a Gamemaker studio 2 shader, for drawing individual sprites.

I can pay you for the port? Needs to work at 2x and 20x scales and preferably work for both PC and Android.

Currently I’m working with “better scaling” shader sh_better_scaling_5xbra. Using full green for transparency. But it doesn’t work upon Android and PC version works at 2x but at 20x there is glitches.

Currently nothing draws on Android when trying to upscale a sprite with the shader. :slightly_frowning_face: I’m making a cross platform mobile/PC game and would like to use xbr upscaling with android and PC.

xBR scaled to 20x with the sh_better_scaling_5xbra shader on PC has some glitches when done upscaling… not visible at 2x (i think 2x works proper).