Uborder shaders

Hi @Hyllian. I’ve noticed reflection is kind of more “grainy” than HSM-MB and Koko-aio. At least to my eyes, those shaders look “softer”. I guess this is because of the code optimization. Am I right? Not something I worry though. Having 60 fps in my old i5 with an even older Radeon R5870 is all I wanted.

3 Likes

Yes, because the reflection implementation is completely different from those others. This is the fastest blur I could make in just one shader. It uses just 5 lookup textures per fragment and randomize the locations to give that grainy aspect (it’s an approximation of a 5x5 real blur). If I do a common blur with just 3 texture lookups per dimension, it’s 9 in total, which is almost 100% slower. There are some other approaches to get blur, like multipasses, mipmapping, etc.

It’s something that may be improved, yes, though it needs many trial and error tentatives to get something as fast as that and with better quality. Someone could say that using a multipass approach I could gain some performance, because I could reduce a normal 4-blur from 16 to just 8 texture lookups. But, using multipass has other costs/maintenance involved. For now, this is a “bread n’ butter” approach that keeps uborder very fast.

EDIT: I can make the num of blur iterations a param instead hardcoded. You could test if the gain of quality is worth the performance penalty by increasing it.

These two params from uborder_bezel_reflections.inc file inside include folder control the blur reflections (you may edit them and tell me if something improves):

blur-iter

Suggestion: change R_BLUR_ITER to 25 and see how it looks. You may increase or decrease R_BLUR_SIZE, but I think it’s already in the sweet spot. If the performance is ok for you, you keep it.

EDIT2: I just tested R_BLUR_ITER = 25 and it indeed improves quality. So, definitly this param must be calibrated by the user in the next version.

7 Likes

@K-rnivoro it is more grainy but playing around with reflection intensity, middle_bezel size and bezel colors, the “grainines” can be mitigated to be less distracting!

I quite liked the cabinet bezel posted by @Boz1978 and made some presets (crt-nobody), using a little border alpha to pull back on the reflection and scratches (on the monitor not the bezel one)

fr_zoom = "39.400005"
fr_center_y = "-0.200000"
bz_inner_bezel_x = "0.005000"
bz_inner_bezel_y = "0.005000"
bz_middle_bezel_x = "0.120000"
bz_middle_bezel_y = "0.120000"
bz_outer_bezel_x = "0.139000"
bz_outer_bezel_y = "0.103000"
bz_outer_curve = "1.000000"
bz_radius = "0.145000"
bz_red = "12.000000"
bz_green = "15.000000"
bz_blue = "26.000000"
bz_shine = "0.050000"
bz_shine_size = "0.950000"
bz_ambient = "0.110000"
bz_ambient_size = "0.900000"
border_alpha = "0.030000"
h_radius = "3.099999"

and a zoomed in variant

all_zoom = "108.000000"
fr_zoom = "43.000019"
fr_center_y = "-0.400000"
bz_inner_bezel_x = "0.005000"
bz_inner_bezel_y = "0.005000"
bz_middle_bezel_x = "0.100000"
bz_middle_bezel_y = "0.096000"
bz_outer_bezel_x = "0.053000"
bz_outer_bezel_y = "0.025000"
bz_outer_curve = "1.000000"
bz_radius = "0.145000"
bz_red = "12.000000"
bz_green = "15.000000"
bz_blue = "26.000000"
bz_shine = "0.050000"
bz_shine_size = "0.950000"
bz_ambient = "0.110000"
bz_ambient_size = "0.900000"
border_alpha = "0.030000"
h_radius = "3.099999"
CN_BRIGHTBOOST = "1.250000"
CN_VIG_BASE = "24.000000"
CN_VIG_EXP = "0.240000"

6 Likes

Ok, I made some changes to improve reflections. Now the blur is made in linear gamma. And a new user params was added to control the number of iterations for blur.

New release: Uborder-v0.1.0

  • Blur refletions done in linear gamma;
  • Added a param to control blur reflections quality/performance.
12 Likes

Wow! That`s fast!! Thanks @Hyllian, I´ll try it ASAIC.

2 Likes

koko-like

5 Likes

Looks awesome m8! :partying_face::partying_face::partying_face:

2 Likes

I tweaked it a bit further:

It seems like having the frame on top and then rising the Border Alpha works like a charm. Then making the bezel transparent and ramping up the reflection strength makes it more natural with the original image

fr_zoom = "44.000008"
fr_center_x = "-0.200000"
fr_center_y = "-0.300000"
bz_ref_str = "0.450000"
bz_inner_bezel_x = "0.036000"
bz_inner_bezel_y = "0.020000"
bz_middle_bezel_x = "0.105000"
bz_middle_bezel_y = "0.089000"
bz_outer_bezel_x = "0.000000"
bz_outer_bezel_y = "0.000000"
bz_transparent = "1.000000"
bz_outer_curve = "0.000000"
bz_radius = "0.110000"
ub_border_top = "0.000000"
border_alpha = "0.200000"
h_radius = "2.999999"
h_cornersize = "0.150000"
h_cornersmooth = "1.000000"
5 Likes

That looks very nice! :nerd_face:

Uborder is already very flexible allowing a great variety of looks while being very lightweight!

4 Likes

……Beautiful m8!! :star_struck::star_struck::star_struck:

1 Like

Yeah, the shader can be used in many ways. That’s how I’m updating some overlays from Orionsangel:

4 Likes

In case someone wants to download that:

https://mega.nz/folder/iOokHLoB#Enib3EO6SPkAV4HQeokcIA

4 Likes

Nice :slight_smile:

You know it’s good when the content doesn’t feel out of place with screenshots of real ones on the sides

1 Like

Forgive my ignorance bitman but where exactly do I put this? in what folder? Thank you

Inside uborder_packs

(if you don’t have it, create a uboder_packs folder inside your shaders directory. Not inside shaders_slang, but its parent folder “shaders”)

Let me know if it works

1 Like

Oh wow! This looks awesome! From someone who’s highly critical of the strange distortion of horizontal lines and fishbowl effect when scrolling in many examples of curvature emulation, I found something about this image to be very tasteful!

It “sells” the curvature effect but the horizontal lines look straight for the most part. The horizon does look slightly bent though but most other lines seemed to have retained their straightness.

1 Like

This curvature was carefully developed to not distort while scrolling. It’s easier to see that using cylinder.

On the curvature, I think h_radius = 4.0 is the sweet spot. And a good range is between 3.0 and 5.0.

2 Likes

Hello bitman, I have placed the folder inside shaders\uborder_packs\ and it gives me an error. Does it happen to anyone else? Greetings

I tried uborder-tool and it’s fantastic!! It works with verticals too!!! It saves me a lot of time with the position and size adjustments. Of course, some fine tuning is necessary, for example this Neo-Geo overlay with plastic bezel. In this case, Bezel Curvature looks better OFF, and Cylindrical Shape instead of sphere. And of course, Bezel Transparent is ON. I had to install some PIL modules in Python too. Maybe the Windows Executable file would make things easier @Hyllian. Also, I don’t know how to make a batch process for all my vertical overlays stored in a folder (actually two, one for horizontal CRT and one for vertical, as the 4K Vertical Overlay Community Contributions demands). If you could guide me I’ll be greatful.

3 Likes

…Awesome stuff m8! :star_struck::star_struck::star_struck:

1 Like