Some shader announcements

OK. I’ve set up saved presets for the handheld cores I use at my resolution. This way I have been able to switch to vulkan full time, though I agree that the handheld glsl and Cg shaders do look sharper for some reason…

P

I made a straight port of the gb-pass-5 shader so you can see if that treats you any better.

I think the shaders look better now if not the same as the Cg versions (as long as I change the border scaling for my 1080p screen). I’m guessing I should substitute the gba-pass-5 shader for the border shader? If so, that didn’t work…

RetroArch [ERROR] :: [slang]: Non-semantic textures not supported yet.

P

Thanks, I tried it a bit but there is the same kind of problem. I get a big size picture that isn’t scaled well.

If you want to see for yourself:

shaders = 6

shader0 = ../gameboy/shader-files/gb-pass0.slang
filter_linear0 = false
scale_type0 = viewport
scale0 = 1.0
alias0 = "PASS0"

shader1 = ../gameboy/shader-files/gb-pass1.slang
filter_linear1 = false
scale_type1 = source
scale1 = 1.0
alias1 = "PASS1"

shader2 = ../gameboy/shader-files/gb-pass2.slang
filter_linear2 = false
scale_type2 = source
scale2 = 1.0
alias2 = "PASS2"

shader3 = ../gameboy/shader-files/gb-pass3.slang
filter_linear3 = false
scale_type3 = source
scale3 = 1.0
alias3 = "PASS3"

shader4 = ../gameboy/shader-files/gb-pass4.slang
filter_linear4 = false
scale_type4 = source
scale4 = 1.0
alias4 = "PASS4"

shader5 = shader-files/gb-pass-5.slang
filter_linear5 = false
scale_type5 = source
scale5 = 1.0
alias5 = "PASS5"

parameters = "video_scale;baseline_alpha;response_time;grey_balance;blending_mode;adjacent_texel_alpha_blending;shadow_blur1;shadow_blur2;contrast;screen_light;pixel_opacity;bg_smoothing;shadow_opacity;shadow_offset_x;shadow_offset_y;screen_offset_x;screen_offset_y;SCALE;OUT_X;OUT_Y"
baseline_alpha = "0.030000"
response_time = "0.200000"
grey_balance = "3.500000"
blending_mode = "0.000000"
adjacent_texel_alpha_blending = "0.380000"
shadow_blur1 = "2.000000"
shadow_blur2 = "2.000000"
contrast = "0.800000"
screen_light = "0.900000"
pixel_opacity = "0.950000"
bg_smoothing = "0.000000"
shadow_opacity = "0.900000"
shadow_offset_x = "-1.500000"
shadow_offset_y = "1.500000"
screen_offset_x = "0.000000"
screen_offset_y = "0.000000"
video_scale = "4.0"
SCALE = "1.0"
OUT_X = "3200.0"
OUT_Y = "1600.0"

textures = COLOR_PALETTE;BACKGROUND;BORDER
COLOR_PALETTE = resources/pocket-palette.png
COLOR_PALETTE_linear = false
BACKGROUND = resources/pocket-background.png
BACKGROUND_linear = true
BORDER = resources/pocket-border-square-4x.png
BORDER_linear = true

That’s where I noticed we don’t have the parameters I imported from the cgp in the pass0 of the slang gameboy shader. Notably the scale value that limits the integer scaling size. Are all our problems coming from this?

Tatsuya79,

I changed the paths in your code and the overlay image appears with the correct scaling but you can’t see the game anymore!

shaders = 6

shader0 = ../shaders/gameboy/shader-files/gb-pass0.slang
filter_linear0 = false
scale_type0 = viewport
scale0 = 1.0
alias0 = "PASS0"


shader1 = ../shaders/gameboy/shader-files/gb-pass1.slang
filter_linear1 = false
scale_type1 = source
scale1 = 1.0
alias1 = "PASS1"


shader2 = ../shaders/gameboy/shader-files/gb-pass2.slang
filter_linear2 = false
scale_type2 = source
scale2 = 1.0
alias2 = "PASS2"


shader3 = ../shaders/gameboy/shader-files/gb-pass3.slang
filter_linear3 = false
scale_type3 = source
scale3 = 1.0
alias3 = "PASS3"


shader4 = ../shaders/gameboy/shader-files/gb-pass4.slang
filter_linear4 = false
scale_type4 = source
scale4 = 1.0
axxlias4 = "PASS4"


shader5 = shader-files/gb-pass-5.slang
filter_linear5 = false
scale_type5 = source
scale5 = 1.0
alias5 = "PASS5"


parameters = "video_scale;baseline_alpha;response_time;grey_balance;blending_mode;adjacent_texel_alpha_blending;shadow_blur1;shadow_blur2;contrast;screen_light;pixel_opacity;bg_smoothing;shadow_opacity;shadow_offset_x;shadow_offset_y;screen_offset_x;screen_offset_y;SCALE;OUT_X;OUT_Y"
baseline_alpha = "0.030000"
response_time = "0.200000"
grey_balance = "3.500000"
blending_mode = "0.000000"
adjacent_texel_alpha_blending = "0.380000"
shadow_blur1 = "2.000000"
shadow_blur2 = "2.000000"
contrast = "0.800000"
screen_light = "0.900000"
pixel_opacity = "0.950000"
bg_smoothing = "0.000000"
shadow_opacity = "0.900000"
shadow_offset_x = "-1.500000"
shadow_offset_y = "1.500000"
screen_offset_x = "0.000000"
screen_offset_y = "0.000000"
video_scale = "4.0"
SCALE = "1.0"
OUT_X = "3200.0"
OUT_Y = "1600.0"


textures = COLOR_PALETTE;BACKGROUND;BORDER
COLOR_PALETTE = resources/pocket-palette.png
COLOR_PALETTE_linear = false
BACKGROUND = resources/pocket-background.png
BACKGROUND_linear = true
BORDER = resources/pocket-border-square-4x.png
BORDER_linear = true

[QUOTE=pepedopolous;45241]Tatsuya79,

I changed the paths in your code and the overlay image appears with the correct scaling but you can’t see the game anymore! [[/QUOTE] Oh yeah I forgot to put:

blending_mode = “1.000000”

It seems to be needed in slang while it wasn’t with cg.

For the paths it’s up to where you copy the slangp. Mine was in the shaders_slang\handheld\console-border folder.

OK, so that brings the game back, but too big! http://imgur.com/a/4Yg1Y

Yeah, that’s the problem I was talking about.

And it’s not good too; you can see the pixels are wrongly scaled.

It doesn’t seem to scale the game image at all. It’s exactly the same image as when you run the gameboy-pocket shader that doesn’t have a border. The image is scaled to the height of the screen…

P

No it’s not.

The Game boy fullscreen shader without border has a better rendering. Take a screenshot of both and zoom in a bit, you’ll see that.

Ah, yeah, r5 was trying to avoid unnecessary duplication of the gameboy shader in the console-border directory by just pointing to the identical passes in the regular gameboy shader directory, but he must have missed that there’s an additional option in the first pass. I’ll see about adding that option back in with a default value that won’t interfere with the non-console-border version.

Some progress…

In the fullscreen gameboy-pocket shader, you can now set ‘Enable Console Border’ which does this: -

If you do that with Tatsuya79’s code, you get an overlay with the correct dimensions but there is unwanted ‘garbage’ at the edges and upon closer inspection, the pixels are now rounded…

Yeah, I just added that in but had to run to a meeting before I could post here to mention it. Glad you found it :stuck_out_tongue:

If you set enable_console_border = “1.0” in the preset, it should avoid the extra garbage stuff, which is just leftover from the original scaling.

Doesn’t change the border issue sadly.

Thanks. Now the preset looks like this. Does it need all those parameters? Any idea why the pixels are rounded?

shaders = 6

shader0 = ../shaders/gameboy/shader-files/gb-pass0.slang
filter_linear0 = false
scale_type0 = viewport
scale0 = 1.0
alias0 = "PASS0"


shader1 = ../shaders/gameboy/shader-files/gb-pass1.slang
filter_linear1 = false
scale_type1 = source
scale1 = 1.0
alias1 = "PASS1"


shader2 = ../shaders/gameboy/shader-files/gb-pass2.slang
filter_linear2 = false
scale_type2 = source
scale2 = 1.0
alias2 = "PASS2"


shader3 = ../shaders/gameboy/shader-files/gb-pass3.slang
filter_linear3 = false
scale_type3 = source
scale3 = 1.0
alias3 = "PASS3"


shader4 = ../shaders/gameboy/shader-files/gb-pass4.slang
filter_linear4 = false
scale_type4 = source
scale4 = 1.0
alias4 = "PASS4"


shader5 = shader-files/gb-pass-5.slang
filter_linear5 = false
scale_type5 = source
scale5 = 1.0
alias5 = "PASS5"


parameters = "console_border_enable;video_scale;baseline_alpha;response_time;grey_balance;blending_mode;adjacent_texel_alpha_blending;shadow_blur1;shadow_blur2;contrast;screen_light;pixel_opacity;bg_smoothing;shadow_opacity;shadow_offset_x;shadow_offset_y;screen_offset_x;screen_offset_y;SCALE;OUT_X;OUT_Y"
baseline_alpha = "0.030000"
response_time = "0.200000"
grey_balance = "3.500000"
blending_mode = "1.000000"
adjacent_texel_alpha_blending = "0.380000"
shadow_blur1 = "2.000000"
shadow_blur2 = "2.000000"
contrast = "0.800000"
screen_light = "0.900000"
pixel_opacity = "0.950000"
bg_smoothing = "0.000000"
shadow_opacity = "0.900000"
shadow_offset_x = "-1.500000"
shadow_offset_y = "1.500000"
screen_offset_x = "0.000000"
screen_offset_y = "0.000000"
video_scale = "4.0"
SCALE = "1.0"
OUT_X = "3200.0"
OUT_Y = "1600.0"
console_border_enable = "1.00000"


textures = COLOR_PALETTE;BACKGROUND;BORDER
COLOR_PALETTE = resources/pocket-palette.png
COLOR_PALETTE_linear = false
BACKGROUND = resources/pocket-background.png
BACKGROUND_linear = true
BORDER = resources/pocket-border-square-4x.png
BORDER_linear = true

Aha! I think the pixels were rounded due to “neighbour blending”. Should be:

adjacent_texel_alpha_blending = "0.180000" 

instead of

adjacent_texel_alpha_blending = "0.380000" 

Ok, try them now. I reduced the adjacent texel alpha blending and it looks correct now to me.

They look fine to my eye. Thanks very much! Can the gbc and gba presets also use the gb-pass5.slang shader? Their border scaling is still wrong.

Also is it me or are these slang shaders less demanding on my laptop?

P

The other color systems that use CGWG-lcd are fine. I took screenshots to compare them with the gl versions. They just lack a grid parameter. The border can be adjusted with border_zoom parameters.

The gameboy shaders are a bit better but that’s a workaround. They’re still not as crisp as the gl ones and lost some contrast.

On the left is OpenGL/Cg. On the right is Vulkan/slang. Yes, the slang looks like it has less contrast…

Based on how the Cg, GLSL presets work, I thought that the user simply had to choose the shader size (2x, 3x, etc) and the gameboy border image should scale accordingly. Not sure if that can work for any resolution though…

So my gbc-4x.slangp looks like this

shaders = "2"

shader0 = "../shaders/lcd-cgwg/lcd-grid.slang"
filter_linear0 = "false"
wrap_mode0 = "clamp_to_border"
scale_type_x0 = "source"
scale_x0 = "4.000000"
scale_type_y0 = "source"
scale_y0 = "4.000000"

shader1 = shader-files/gb-pass-5.slang

parameters = "SCALE;OUT_X;OUT_Y;"
SCALE = "1.0"
OUT_X = "3200.0"
OUT_Y = "1600.0"
adjacent_texel_alpha_blending = "0.14"
pixel_opacity = "0.80"
shadow_opacity = "0.80"

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


P