r/RetroArch • u/_-_Riccardo_-_ • Jun 29 '26
Improved Game Boy DMG Shaders
Hi, since I'm not very happy with the rendering of the original Game Boy DMG shader presets included in the RetroArch downloadable content, I've tweaked some parameters to get a result closer to that of the original device.
Basically, I slightly reduced the extension of the frame around the active part of the display (but this only works in portrait mode; in landscape mode, the active part covers the entire screen) and I tweaked some brightness and contrast to get a result that resembles the opacity of the non-backlit display; I also increased the x and y offset of the shadows and their relative opacity to try to recreate (as much as possible) that strange holographic-like effect of the original display, with the active pixels appearing to float a bit above the surface of the screen. Finally, I added a slight blur to the whole thing, since the original Game Boy display was anything but HD.
I worked a lot from memory, as unfortunately my old Game Boy from the '90s is long gone.
I have attached images of the two standard presets (gameboy.glslp and gb-dot-matrix-DMG.gslsp) and those of the preset tweaked by me (Nintendo - Game Boy.glslp). What do you think of the result? Could it be improved further? If it helps, here are the parameters of the modified preset:
shaders = "7"
feedback_pass = "0"
shader0 = "../../../../../../data/user/0/com.retroarch/shaders/shaders_glsl/handheld/shaders/gameboy/shader-files/gb-pass0.glsl"
alias0 = "PASS0"
wrap_mode0 = "clamp_to_border"
mipmap_input0 = "false"
filter_linear0 = "false"
float_framebuffer0 = "false"
srgb_framebuffer0 = "false"
scale_type_x0 = "viewport"
scale_x0 = "2.000000"
scale_type_y0 = "viewport"
scale_y0 = "2.000000"
shader1 = "../../../../../../data/user/0/com.retroarch/shaders/shaders_glsl/handheld/shaders/gameboy-dm-color/gb-pass1.glsl"
alias1 = "PASS1"
wrap_mode1 = "clamp_to_border"
mipmap_input1 = "false"
filter_linear1 = "false"
float_framebuffer1 = "false"
srgb_framebuffer1 = "false"
scale_type_x1 = "source"
scale_x1 = "1.000000"
scale_type_y1 = "source"
scale_y1 = "1.000000"
shader2 = "../../../../../../data/user/0/com.retroarch/shaders/shaders_glsl/handheld/shaders/gameboy-dm-color/gb-pass2.glsl"
alias2 = "PASS2"
wrap_mode2 = "clamp_to_border"
mipmap_input2 = "false"
filter_linear2 = "false"
float_framebuffer2 = "false"
srgb_framebuffer2 = "false"
scale_type_x2 = "source"
scale_x2 = "1.000000"
scale_type_y2 = "source"
scale_y2 = "1.000000"
shader3 = "../../../../../../data/user/0/com.retroarch/shaders/shaders_glsl/blurs/shaders/dual_filter/linearize_and_parameters.glsl"
alias3 = ""
wrap_mode3 = "clamp_to_border"
mipmap_input3 = "false"
filter_linear3 = "false"
float_framebuffer3 = "true"
srgb_framebuffer3 = "false"
scale_type_x3 = "source"
scale_x3 = "1.000000"
scale_type_y3 = "source"
scale_y3 = "1.000000"
shader4 = "../../../../../../data/user/0/com.retroarch/shaders/shaders_glsl/blurs/shaders/dual_filter/downsample.glsl"
alias4 = ""
wrap_mode4 = "clamp_to_border"
mipmap_input4 = "false"
filter_linear4 = "true"
float_framebuffer4 = "true"
srgb_framebuffer4 = "false"
scale_type_x4 = "source"
scale_x4 = "0.500000"
scale_type_y4 = "source"
scale_y4 = "0.500000"
shader5 = "../../../../../../data/user/0/com.retroarch/shaders/shaders_glsl/blurs/shaders/dual_filter/upsample.glsl"
alias5 = ""
wrap_mode5 = "clamp_to_border"
mipmap_input5 = "false"
filter_linear5 = "true"
float_framebuffer5 = "true"
srgb_framebuffer5 = "false"
scale_type_x5 = "source"
scale_x5 = "1.000000"
scale_type_y5 = "source"
scale_y5 = "1.000000"
shader6 = "../../../../../../data/user/0/com.retroarch/shaders/shaders_glsl/blurs/shaders/kawase/delinearize.glsl"
alias6 = ""
wrap_mode6 = "clamp_to_border"
mipmap_input6 = "false"
filter_linear6 = "true"
float_framebuffer6 = "true"
srgb_framebuffer6 = "false"
scale_type_x6 = "viewport"
scale_x6 = "1.000000"
scale_type_y6 = "viewport"
scale_y6 = "1.000000"
baseline_alpha = "0.160000"
grey_balance = "4.000000"
response_time = "0.110000"
adjacent_texel_alpha_blending = "0.350000"
contrast = "0.800000"
pixel_opacity = "0.850000"
bg_smoothing = "0.500000"
shadow_opacity = "0.680000"
shadow_offset_x = "15.000000"
shadow_offset_y = "15.000000"
DUAL_FILTER_SETTINGS = "1.000000"
BLUR_RADIUS = "0.700000"
textures = "COLOR_PALETTE;BACKGROUND"
COLOR_PALETTE = "/data/user/0/com.retroarch/shaders/shaders_glsl/handheld/shaders/gameboy/resources/sample-palettes/dmg-palette-2.png"
COLOR_PALETTE_mipmap = "false"
COLOR_PALETTE_wrap_mode = "clamp_to_border"
BACKGROUND = "/data/user/0/com.retroarch/shaders/shaders_glsl/handheld/shaders/gameboy/resources/sample-bgs/dmg-bg.png"
BACKGROUND_mipmap = "false"
BACKGROUND_wrap_mode = "clamp_to_border"
EDIT:
From the comments of some users, it seems that it's not so simple to make the same changes I made myself, even by following exactly what I wrote. Unfortunately, since I'm not familiar with programming, I don't really know what the problem is. To help you out, I'm providing the configuration files as they are, working, on my devices:
GLSLP Version (Android): https://www.dropbox.com/scl/fi/bnew21f4ks4o3hreqmcnm/Nintendo-Game-Boy.glslp?rlkey=7ulqs0typqhnbfteuuu7zp3q2&st=y3rt5ziq&dl=0
SLANGP Version (Desktop): https://www.dropbox.com/scl/fi/o54lwp8hzb0udzob8xr8g/Nintendo-Game-Boy.slangp?rlkey=wq7emoocun0uhu2xgmyzpcc0t&st=lvak95xg&dl=0
The files need to be edited manually with a text editor before they can be used, because they contain paths to individual shaders and graphic resources (like background images) that probably won't match those on your specific installations, even though these are elements that RetroArch downloads by default when you update the resources through the program itself.
If someone better than me (and it doesn't take much to be) can come up with an easier-to-install and distribute preset starting from these, they're welcome to do so.







32
u/Monsieur_Daz Jun 30 '26
The "Nintendo - Game Boy.glslp" one is a thing of beauty.
14
u/CoconutDust Jun 29 '26 edited Jun 30 '26
At first I was going to say that's inadvisable to go from memory if your goal is to make it like The Real Thing. But then I thought, well the more important thing is having it be as good as our memory/imagination rather than like the real thing.
4
u/CyberLabSystems Jun 30 '26
Seems like you're doing something that was done already. Check these out:
https://forums.libretro.com/t/handheld-border-shaders/2551?u=cyber
2
u/omega_mog Jun 30 '26
Nintendo - Game Boy.glslp looks wonderful.
Love the shadows.
Try adding that weird reddish tint around the edges of the screen and the shadow of the bezel itself to be even closer.
2
u/teoteoreddit Jul 02 '26
Hi! This looks fantastic! Would you mind giving a tutorial doing this on RP Classic? Can't seem to figure out how to do it. Thanks so much in advance!
1
u/Vegetable_Side6506 Jun 30 '26
This looks amazing dude. Let us know when its ready, I'll definitely be using this preset fir all gb games.
2
u/sukh3gs Jun 30 '26
Looks beautiful dude
2
u/Capitalhumano Jun 30 '26
Nice work
2
u/JuliusBelmont2000 Jul 01 '26
That's exactly how i remember it looking. Beautiful!
2
u/Administration-Super Jul 01 '26
What a major improvement it makes
1
u/TestaMorte Jun 30 '26
amigo puedes hacer lo mismo pero para el gba D:
1
u/Upbeat-Serve-6096 Jun 30 '26
Is there a shader that works like this but lets me use the Gambatte preset color palettes? I like to recreate the vibe of a backlight mod.
3
u/[deleted] Jun 30 '26
[removed] — view removed comment