xBR algorithm tutorial

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/

Ok, first multipass xBR uploaded to common-shaders:

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

You just need to load one of the four presets (.cgp) there. They’re for corner detections a, b, c and d.

Any advantages to using these over, say, the xbr3.7d filters, etc.?

If so… how do I set these up?

If you have the time could you please compile these into filters for PS3 and upload them into a link (for us dummies -lol-who don’t know how to take that github code and turn into a filter)?

Do i just run these as a single pass? Or is this a preset that will do everything for me? In either case, if you could share this with us novices, most appreciated.

Sincerely, Devoted fan of your work!

You just need to download the “xBR-LV2-multipass” folder and all its files and put into the “xBR” folder of your PS3 Retroarch.

To run it, just use the “Load Shader Preset” and choose any of the four .cgp available inside that folder. It’ll load all shaders the right way!

The benefit is speed!

Don’t mean to bug you again. Maybe because of my computer (I dunno) it won’t let me download that folder from github in a practical way. When I click on it, it takes me to code. If I download it, it makes me download a link.

If it’s not TOO much to ask (haha) could you compile this for me and put into a zip folder and upload it?

Sorry to ask so much :-/ Unfortunately, it seems like the only way to enjoy your work!

Thanks again. Ciao!

Here you go: http://www.mediafire.com/download/gn6c9vix2i2vf2f/xBR-LV2-multipass.zip

Tks, hunterk!

Anyways, here’s another link: https://anonfiles.com/file/1c1427ba582b67e06196dfb0e8bceaca

Don’t mean to bug you again. Maybe because of my computer (I dunno) it won’t let me download that folder from github in a practical way. When I click on it, it takes me to code. If I download it, it makes me download a link.

If it’s not TOO much to ask (haha) could you compile this for me and put into a zip folder and upload it?

Sorry to ask so much :-/ Unfortunately, it seems like the only way to enjoy your work!

Thanks again. Ciao![/quote]

There is now a ‘Download ZIP’ option for every repo on Github.

My first rc for a xbr-hybrid multipass:

https://anonfiles.com/file/8576f48e46c8999c3eca71d60ca2de21

It is a 7 pass combination!! Works ok on PS3 and faster than the single pass versions.

Some advice please…

(1)With the new shaders and retroarch, what do you recommend as the best combo for Sega Genesis in your humble opinion?

(2) Also, any idea if the dithering filters will ever be fixed. They are GREAT in principle but mess up the text horribly. Have they been abandoned? If fixed, the make for a fine fix on the aging Genesis format.

My best combo SO FAR for Sega genesis: (Five pass) -mdpat pass 1 Nearest x1 -mdpat pass 2 Nearest x2 -3xbr 3.7c Nearest x3 -Quillex (note: doesnt work will all games and sometimes will make Retroarch freeze/crash, so I leave it out sometimes) Nearest x1 -Scanlines NONE NONE

I like this look but if you can offer something along these lines, but better, I’m all ears! Trying to stay away from presets that slow the thing down. Ruins if for me. At least that combo is full speed but you guys are the experts here.

Also, looking for a good suggestion for GBA since they always look terrible blown up to full screen.

So far, I use: -xbr2 light nearest x2 -xbr2 dark nearest x2 -quillez nearest x2 -Scanlines none none

(if dithering is an issue, I include the dithering from above for an extra 2 passes)

Again, any suggestions for GBA would be appreciated…

Thx! Alwayz a fan, :slight_smile:

P.S. If you have anything cool on the horizon (experimental filters, or upgrades, would love to hear about it!)

As you’re at it, try this combo and tell me if it works:

https://anonfiles.com/file/8bb54f60db03cdf8280fce45ead52acc

Copy the folder inside the zip to your xbr shader folder in retroarch.

Try this new xBR variant I’m working. It’s called xbr-dilation:

https://anonfiles.com/file/1b551bb99c1c068b95c87672f6b5f40c

Additionally to what xBR does, the dilation narrow a bit more dark edges and stretch light edges. It’s very good with cartoons.

For now it’s just single pass and based on 3.7c. I intend to make a multipass faster. It works best at 5x, but if it’s slow, then use 3x and a second shader as scale2x.cg, for example.

Try this new xBR variant I’m working. It’s called xbr-dilation:

https://anonfiles.com/file/1b551bb99c1c068b95c87672f6b5f40c

Additionally to what xBR does, the dilation narrow a bit more dark edges and stretch light edges. It’s very good with cartoons.

For now it’s just single pass and based on 3.7c. I intend to make a multipass faster. It works best at 5x, but if it’s slow, then use 3x and a second shader as scale2x.cg, for example.[/quote]

Simply amazing. Works great! This was my missing ingredient for solving a multitude of little yet nagging perfectionist issues with my custom shader passes. Bravo!

P.S. If they ever fix the dither passes (i.e. the way they mess with text, and introduce artifacts, etc.) then as far as Im concerned you’ve perfected this for the PS3 crowd (that is, looking to give their games a believable HD makeover).

Thank you so much!

Tks, so I added to common-shaders repository along a multipass version.