Handheld Border Shaders

You can try using the feedback shader, like I just added to the slang version:

[QUOTE=hunterk;47032]You can try using the feedback shader, like I just added to the slang version: https://github.com/libretro/slang-shaders/blob/master/handheld/console-border/gba-4x.slangp[/QUOTE] Tried it, but the same thing happens. Either I have motion blur, or I have color correction.

Iā€™m not an expert on this, but thereā€™s something about color on the float4 value in the motion blur .cg file (in my previous post). Can it be that itā€™s canceling out the color correction from the other passes?

I think the problem is that the non-feedback motion blur shaders sample previous unfiltered frames (i.e., no color correction). The feedback shader samples a previous filtered frame (i.e., with the color correction applied). However, I forgot that the Cg feedback needs something added to the preset that slang does not. Hereā€™s what it should look like:

shaders = "4"

shader0 = "../../motionblur/shaders/feedback.cg"
scale_type0 = source
scale0 = 1.0
filter_linear0 = false
feedback_pass = 0

shader1 = "../shaders/color/gba-color.cg
filter_linear1 = false

shader2 = "../shaders/lcd_cgwg/lcd-grid.cg"
filter_linear2 = "false"
wrap_mode2 = "clamp_to_border"
scale_type_x2 = "source"
scale_x2 = "4.000000"
scale_type_y2 = "source"
scale_y2 = "4.000000"

shader3 = "shader-files/gb-pass-5.cg"
filter_linear3 = "true"
wrap_mode3 = "clamp_to_border"

parameters = "SCALE;OUT_X;OUT_Y;GRID_STRENGTH;mixfactor"
GRID_STRENGTH = "0.150000"
SCALE = "1.0"
OUT_X = "3200.0"
OUT_Y = "1600.0"
mixfactor = "0.50"

textures = "BORDER"
BORDER = "resources/gba-border-square-4x.png"
BORDER_linear = "true"
BORDER_wrap_mode = "clamp_to_border"
BORDER_mipmap = "false"

EDIT: well, maybe not because this oneā€“using motionblur-simpleā€“seems to work fine for me, too:

shaders = "4"

shader0 = "../../motionblur/shaders/motionblur-simple.cg"
scale_type0 = source
scale0 = 1.0
filter_linear0 = false

shader1 = "../shaders/color/gba-color.cg
filter_linear1 = false

shader2 = "../shaders/lcd_cgwg/lcd-grid.cg"
filter_linear2 = "false"
wrap_mode2 = "clamp_to_border"
scale_type_x2 = "source"
scale_x2 = "4.000000"
scale_type_y2 = "source"
scale_y2 = "4.000000"

shader3 = "shader-files/gb-pass-5.cg"
filter_linear3 = "true"
wrap_mode3 = "clamp_to_border"

parameters = "SCALE;OUT_X;OUT_Y;GRID_STRENGTH;mixfactor"
GRID_STRENGTH = "0.150000"
SCALE = "1.0"
OUT_X = "3200.0"
OUT_Y = "1600.0"
mixfactor = "0.50"

textures = "BORDER"
BORDER = "resources/gba-border-square-4x.png"
BORDER_linear = "true"
BORDER_wrap_mode = "clamp_to_border"
BORDER_mipmap = "false"

I donā€™t know what I did, but when I tried to use this code, wellā€¦ this happened.


In any case, I managed to make it work. I used this preset and inserted the GBA border in it.

Iā€™ll try to figure out what I did wrong with your code though.

Thanks for the assistance :slight_smile:


EDIT: I figured it out. Apparently, there was something wrong with the gba-color.cg file I was using. I swapped it for the one contained in ā€œshaders_cg\handheld\shaders\colorā€ and it worked like a charm.

Again, thank you!


[B]ā€“FINAL EDITā€“: I figured out the source of the whole problem. Turns out it all goes back to my utter lack of knowledge on how to edit .cgp files.

I didnā€™t change the numbers on the parameters when I added a new pass so that they would actually correlate to the shaders.

In other words, I changed shader0 to shader1, but didnā€™t change alias0 to alias1, scale_x0 to scale_x1, and so on. After fixing this, I was able to successfully add a motion blur pass to OPā€™s .cgp files.[/B]

Borders with background pictures made by damageinc86: The mega link is down.

Thanks!! All of you did a great job with these shaders.

Glad you like them.

Iā€™ll remove the link as I donā€™t have a copy for those.

Would it be possible to convert GBA-LUT to slang? I love the way it looks but sadly it doesnā€™t seem to work with Vulkan.

You would have to ask the author of this shader in his thread:

Iā€™m not able to convert those shaders myself. I tried making a glsl/vulkan version but ran into issues with several of the converted ones.

Hi!

Thank you for these great Handheld Shaders. Is there a way to disable the screen glare? I find this effect very distracting while playing.

Youā€™ll have to erase it on the png picture.

I donĀ“t see that effect on the GBA PNG.

edit: Just found it

Iā€™ve just installed and set these shaders and Iā€™ve gotta say that they look pretty nice! There are a few problems that Iā€™d like to point out, though:

  • The somewhat muted colors on the LCD grid shaders are a bit of a problem for games whose palettes were built around the backlit GBA SP or the DS, such as Kirby and the Amazing Mirror.

  • The DS shaders seem to be scaled pretty oddly on my monitor compared to the other shaders (I have a 15.6ā€™ā€™ Dell Inspiron 15 laptop). To be more specific, using the 4x variants cause the image to clip past what my monitor is capable of displaying, meaning I can only see half of each screen, while the 2x and 3x variants position the screens in such a way that the middle of the DS border cuts through them (the two video feeds appear to be oriented in such a way that they are directly adjacent with each other, similarly to how they are oriented with the standard LCD shader).

  • For some reason the Game Gear shaders make RetroArch slow down significantly, both in the RGUI and when playing a game (I assume this is due to the graphics for the Game Gear border being uncompressed); I havenā€™t seen this issue with the WonderSwan shaders or the Neo Geo Pocket Color ones because I havenā€™t installed any games to use them with yet.

Aside from these issues, Iā€™m mostly satisfied with how these shaders look on my computer. Keep up the good work!

For the DS shader, there should be a core option to increase the separation between the two images to fit the border better.

Dunno about the game gear slowdown. I havenā€™t noticed any issues with it but I also havenā€™t used it much.

Youā€™re probably using a particular resolution (768p for that Dell?). I could only test with my 1080p screen here.

The only particular thing the Game Gear shader does is stretching the horizontal resolution by 1.2 as the pixels arenā€™t square. Not sure if thatā€™s enough to make a difference and if you need to force performance in your Video drivers or energy profiles.

Alright, Iā€™ve finally gotten around to following your suggestion and itā€™s worked like a charm! There is some apparent overscan with New Super Mario Bros. and Mario Kart DS, but theyā€™re just minor problems that donā€™t bug me too much.

I still havenā€™t figured out why the Game Bear borders slow down RetroArch so badly for me or how to fix the problem; for now, Iā€™ll just have to make do with other shaders.

In regards to my laptopā€™s resolution, the label by the scratchpad says ā€œ15.6ā€™ā€™ Full HD Displayā€ and lists HDMI compatibility as a feature, so I assume itā€™s a 1080p display. Not sure what kind of role that plays in the Game Gear shader issues, though.

Only the AMD file works with my card but every shader comes out looking like the GB shader. Replacing the lcd-grid.cg with the ā€œv2ā€ one in the standard files made it work for me, in case anyone is having a similar problem. Fantastic stuff!

2 things. Is it possible to remove the screen reflection? And any solution to rotates WS?

By ā€œscreen reflectionsā€, are you talking about the tiny bit of glare in the upper-right corner of each shader? Because thatā€™s part of the original border asset. If you want to get rid of that, youā€™ll have to either edit the border yourself or replace it with a border that doesnā€™t have the glare present (similarly to Tatsuya79ā€™s described process for replacing the black GBC border with the purple one).

Just updated the megalink to be current. The files are in the resources folder.

https://mega.nz/#F!7UJyEKwD!2U3PKfxI3LO9ppOGPUaXqw