Uborder shaders

Ok m8 I’ll have a think :+1:

2 Likes

Not sure if this helps, but it’s pretty easy to viewport zoom in or out if you just want to do one and let the user replace the viewport setting. I keep my set zoomed in, but it wouldn’t be to hard to change it.

1 Like

Yeah it’s only the positioning really. One thing I will say is because the viewports on these overlays aren’t all central you will also need to move the overlay and bezel in y.

1 Like

Yeah, that’s true. It would be cool if there was a way to automate “resetting” the center of monitor and then zooming in a set amount.

1 Like

I’m releasing a command line tool I was using to analyze transparent overlays (32-bit png file) and calculate or guess the location of the transparent portion (a rectangle). Obviously, it only works if there’s only one transparent portion, which is the majority of the overlays out there.

It’s a python script, so you need to know how to use python.

uborder-tool v1.0.0

To know how to use the script, open a prompt and call the script with -h or -help to get some instructions. There’s only one required parameter: the image file (a 32-bit png). The rest is optional.

python.exe uborder-tool.py -h

usage: uborder-tool.exe [-h] [-o OUTPUT] [-s INT[1,100]] [-t INT[1,255]] [-p] image_file

Estimates coordinates from the inner rectangle based on alpha transparent image.

positional arguments:
  image_file            input file (32-bit png)

options:
  -h, --help            show this help message and exit
  -o OUTPUT, --output OUTPUT
                        output file (file to output uborder params)
  -s INT[1,100], --step INT[1,100]
                        search step size (bigger is faster, though less precise).
  -t INT[1,255], --threshold INT[1,255]
                        threshold below which transparent pixel is detected.
  -p, --preview         print results and show an image with detected points in green.

If you use the option -o, it’ll print some results in a file with name and path defined by the user. The output file is optional and it’ll print scaling and aspect ratio params recommended to be used with uborder. So I usually save the output as a *.params or *.slangp file. If you know how to edit the script you can change what the script will write to the output.

Example of usage with image.png and output.params as output file:

python.exe uborder-tool.py "image.png" -o "output.params"

If you know how to process in batch, you can analyze hundreds of overlays in seconds or minutes and get all params you need.

OBS1: I may distribute a windows executable made by pyinstaller if python is a limitation and someone is interested.

OBS2: if you use the --preview option, it’ll open your default image app to load a temporary png identical to the input with the points detected in green.

Practical example: From Orionsangel-Original-Console pack, let’s analyze the atariplain.png overlay.

The overlay:

Using the script with default params and printing preview:

After running, it’ll show the input image with green point where the rectangle was detected:

It works with default params. If the showed points don’t make sense, you need to adjust params or see if the image has transparent watermarks in some hidden places. In this case you need to lower the threshold below the watermark alpha values or just delete the watermark just temporarily to get correct results.

9 Likes

I just noticed, while making presets for system specific bezel, that the background get flipped in flycast @480.

probably not related to uborder: I guess something similar was reported here:

1 Like

Yes, some cores run mirrored. Swanstation using hardware and internal upscaled does that too.

Use the background mirror option to adjust the backgorund.

1 Like

oh, I didn’t realize that option was there :nerd_face:, that solved it!

2 Likes

This problem only occurs with glcore driver, try Vulkan or D3D.

2 Likes

Testing border transparency with vector games and other games that use “blackgrounds”:

7 Likes

Didn’t know that was a thing!

1 Like

New release: Uborder-v0.0.8

  • Added new param to allow transparent background over content (black pixels). It turn possible to use with vector games, for example.
  • Added newpixie-crt (use base presets to access it).
  • Fiz some bugs.

No need to update any packs, the new param doesn’t affect the inner workings of the old ones.

I think the user parameters are solid now, so I’ll freeze them (internal names) as they are, so that packs from other people don’t break on future updates. If a new feature is added, it’ll have its own param and won’t affect the existent ones. I think this will encourage other colleagues to make their own packs without any concerns of being outdated.

The new feature is used by tweaking these two params below:

Using 1.0, 1.0 (fully transparent):

Using: 0.5, 1.0 (so that you blends only half, creating a transparent effect):

8 Likes

Awesome news, I 'll give it a try later today :smile:

Will this v0.0.8 of Uborder shaders be available also through the updater via RetroArch? Together with the packs only using the github link? (if i got this correctly)

Huge thanks!

1 Like

Never mind… got it :grin:

Thank you.!!! :smiley:

1 Like

Wasn’t already in? coincidentally just yesterday I made the “tv & monitor” presets also for new pixy :nerd_face:

Nice! I will try it! are there any coesive pack of backgrounds to refer to?

1 Like

It was, but now it’s oficial! :stuck_out_tongue:

You can get many things in this place (look for backdrop and overlay): https://www.mameworld.info/mrdo/mame_artwork_ingame.php

I don’t know a pack that concentrates everything in just one file, though.

2 Likes

Just tried and it seems to work very well!

here with backdrop

this one stitching (roughly) together: invad169, invadbd and invaders_moon_taito

:+1:

3 Likes

That looks excellent and just what I’m looking for! Are you planning to add tilt parameters?

1 Like

When I port crt-geom again to uborder. It has built in tilt features.

2 Likes

again, using resources from mr.do, I just reduced contrast and brightness of the background image

Any suggestion on how to handle vector games? used crt-nobody here just to do a quick try!

2 Likes