xBR algorithm tutorial

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:

Humm.

Could you try the 5xBR-v4.0-noblend? I think it’ll run ok in 5x scale.

Another thing, you can try the cg2xml from maister, it was updated recently.

ah, yeah, the noblend version looks much better. It still has some minor issues (different from the picture i posted) but I’ll see if cg2xml fixes those.

I would love to use some of these on Retroarch PS3. Alas when I try to download them and install them onto my PS3 they don’t work.

Maybe I don’t know how to download them right from the github?

Im a noobie to ALL of this.

If you could post a link with a .zip or pack to some of these, then that would be awesome. :slight_smile:

Wanting to try these on Retroarch PS3 -5xBR-v4.0-noblend -4xBR-v4.0.cg -4xBR-v3.9.cg -5xBR-v3.7d.cg

And any other new ones you would recommend. You mentioned that some of the new ones are better at corner detection? Any recommendations are appreciated as always. And thanks for your hard work.

Like I said, not sure if I’m downloading them wrong (installing them wrong). But when i download what I think I install it just doesn’t register with Retroarch PS3.

Or maybe they are not meant to work yet with this version?

In any case… if it simply a case of the stupids with me, maybe you could post a link with these files properly compiled for us dummies.haha

Thanx again! :slight_smile:

RetroArch 0.9.9 (for all platforms) should be hopefully released by the end of this week.

I know that the PS3 port will be a total rewrite that will beef up the shader capabilities considerably - going from fixed 2-pass shaders to full 8-pass shaders setup through our CGP preset format.

Here they are:

EDIT, fixed a bug. New file upload: http://s000.tinyupload.com/index.php?file_id=80067435116502163478

[quote=“Hyllian”]

Here they are: https://anonfiles.com/file/a59429d630d244017473093fa6dbc4aa[/quote]

You rock! 5xBR-v3.7d.cg is my fav so far!

Some advice though?

On the genesis emulator, do you notice some slow down?

I tried this with X5 and the stock.cg but the emu slows down.

Any suggested combos?

I’ve been using the 5xBR filter on X4 with stock.cg.

Any suggestions for a good second shader on genesis?

AND does anyone think that this newest Retroarch 0.9.9 release will enhance performance for the gen emulator so that we can use bigger shaders on X5 without slowdown?

THanx again for all your knowledge!

The stock shader does nothing, so it’s best to turn off Dual Shader to gain some speed. Try this, and use the resize option along custon aspect ratio to get the desired resolution. For example, for genesis i use:

viewport X: 1600 viewport Y: 1120

EDIT: To gain even more speed, before turning off Dual Shaders option, put scale factor at 1X. For some reason it works!

I’ve fixed a little bug in the last shaders uploaded.

So, here’s the fix: http://s000.tinyupload.com/index.php?file_id=80067435116502163478

I’ve updated the repo.

[quote=“Hyllian”]

The stock shader does nothing, so it’s best to turn off Dual Shader to gain some speed. Try this, and use the resize option along custon aspect ratio to get the desired resolution. For example, for genesis i use:

viewport X: 1600 viewport Y: 1120

EDIT: To gain even more speed, before turning off Dual Shaders option, put scale factor at 1X. For some reason it works![/quote]

Thank you! You truly are an artist.

However, for some reason when I try to use the custom aspect with viewport X and Y I get a black screen. I can still get sound but the screen goes bye bye.

Any thoughts about what Im doing wrong? Again, this is with X5 scale, the new 5xBR filter, dual shaders option off and the custom X and Y config you recommended. Am I missing something here? Thanks!

I’m sorry, I made a mistake!

Actually, in resize option you need to use this:

Viewport X: #160 Viewport Y: #-20 Viewport Width: #1600 Viewport Height: #1120

Some genesis games run at 256x224 (ex: castlevania bloodlines), in this case you have one solution: 1- decrease width from 1600 to 1280;

Of these 4 shaders, what are the differences?

-5xBR-v4.0-noblend -4xBR-v4.0.cg -4xBR-v3.9.cg -5xBR-v3.7d.cg

More to the point, is one better than the other? I know this can be a matter of taste, but curious what you think.

As far as RETROARCH settings go… which settings are best for these filters?

Also can any of them be successfully used with dual shaders on the genesis emu. If so, what combination + settings do you recommend for the best look?

Thanx again for your insight! :slight_smile:

Features:

5xBR-v4.0-noblend

  • noblend means no new colors are created by mixing existing ones.
  • This is the first level3 xBR shader I’ve got running in shader format and noblend.
  • new corner detection

4xBR-v4.0.cg

  • Level 3
  • it has anti-aliasing embedded.
  • new corner detection

4xBR-v3.9.cg

  • Level2
  • anti-aliasing
  • new corner detection

5xBR-v3.7d.cg

  • Level2
  • new corner detection
  • noblend too

The level2 shaders are more mature. I can’t improve it much more than this. The level3 versions are new and have potencial to be very good, theoretically. Though the best level2 ones are better in image quality (for now). That’s because I had to make some adaptations to the level3 ones to run in fullspeed. When they’re full fledged, they’ll be better.

Level1 means only ramps of 45 degrees are completely smoothed. Level2 means ramps of 30, 45 and 60 degres are completely smoothed. Level3 means ramps of 15, 30, 45, 60 amd 75 degrees are completely smoothed.

I like them as single shaders.

But, if you wanna use those 4xBR at higher than 4x native resolutions, put some linear shader as second shader (ex: ddt.cg, bicubic-fast.cg or lanczos16.cg). They are good as second.

Hi there,

First off – thanks a lot Hyllian for this amazing shader. My favorite by far for all the emulators that support.

This being said, I have an odd question for anyone here who has expertise… I’d like to apply the xBR filter to a VIDEO. Not within an emulator; I actually have a video file (MP4/AVI) of some gameplay and would like to apply the filter to it. I’m using tools such as VirtualDub to edit the video, and did find an HQ4X plugin for VirtualDub, but couldn’t find anything for xBR. By any chance, anyone ever tried that?

Hi!

I don’t use virtualdub and don’t have time to support it.

I can point some CPU implementation of xBR filter, so that you or anyone interested can port it to virtualdub:

xBRz (it was made by Zenju) C++ sources in HqMame: http://sourceforge.net/projects/hqxmame/