xBR algorithm tutorial

Hi Hyllian,

Could you post it on pastebin so i can test it out, all the file sharing sites are blocked for me unfortunately.

Regards,

Spin

Sure. Iā€™ll give three shaders. Two are hybrid-crt candidates e and the last is a naked hybrid.

crt1: http://pastebin.com/q5bySjs4 crt2: http://pastebin.com/ku7tRvRc last: http://pastebin.com/yf4xJxF5

Iā€™d like to know which of the crt versions do you like more.

I think crt1 looks slightly better. crt2 seems a little more prone to odd behavior where scanlines intersect with in-game lines.

Hi, hunterk.

Could you use these two parameters from CRT1 in the CRT2 shader and see if the odd behaviors disappear?

    #define SPOT_HEIGHT 0.54
    #define COLOR_BOOST 1.48

@Hyllian That didnā€™t seem to fix it.

Hereā€™s a picture showing the issue: http://www.mediafire.com/download.php?t853jek3dc3jbbj

Itā€™s in PSD format, but GIMP should open it, too, if you donā€™t have Photoshop. Toggle the visibility of the top layer, which is crt1 and it will make the background layer, crt2, visible with circles drawn around some of the problem spots.

Are you sure itā€™s running at 1024x896? By the picture, Iā€™d say itā€™s a resolution issue.

These xBR-derived filters only work properly with integer multiple scale.

That could be. The pictures were taken in windowed mode, so I would assume I had set an even integer scale, but I can double-check.

It looks great, i cannot see a huge difference between CRT1 and 2. CRT1 does seem to look more clear to me.

Two more for tests:

Hybrid: http://pastebin.com/7mgmDPvi

CRT: http://pastebin.com/aBNLk9pb

Use the same config recommendations I made before.

This new hybrid is more clean than the last version (v4). Some comparison: http://minus.com/mbc77JLTpfZqQs

Thanks Hyllian, once i have some time i shall test it.

Thereā€™s another shader Iā€™m working called ddt.cg.

Today I tweaked a bit and added gamma correction based on ideas from someone from other forum. I think the results are interesting.

Hereā€™s a beta: http://pastebin.com/cJ9TPbHU

And now a ddt+gamma using xBR edge detection: http://pastebin.com/pZwerMr0

Added gamma correction to xBR:

https://github.com/libretro/common-shaders/tree/master/xBR

Theyā€™re the three files with ā€œgammaā€ in the name.

I just found an improved rule to detect corners. It gets the quality of C version without most of its artifacts.

Iā€™m implementing in shader only: http://pastebin.com/QMR4De9a

If the last version doesnā€™t work in your GPU, try this 3.7 modificated:

http://pastebin.com/iwX9u4eB

It looks good on my AMD/ATI card. Iā€™ll try it on Intel tomorrow.

Have you noticed improvements over 3.7c? (ex.: Super Mario World coins).

Added those two shaders to the repo:

https://github.com/libretro/common-shaders/blob/master/xBR/4xBR-v3.9.cg https://github.com/libretro/common-shaders/blob/master/xBR/5xBR-v3.7d.cg

The first LEVEL3 xBR shader is done!

An example is the Megaman X2 ramp, with LEVEL3 4.0 it get rid of macro jaggies:

http://imgur.com/m9UfqQA

On the repo (4xBR-v4.0 and 5xBR-v4.0): https://github.com/libretro/common-shaders/commit/c428ad0b4f01b45f6c0d63840175b9d8a6ce29a5

On my Radeon card, itā€™s getting some weird multicolor noise artifacts in the image: On the other hand, you can see from the inclined portion of the ground that itā€™s doing an amazing job of smoothing out those previously uncorrectable jaggies :open_mouth: