RetroArch

RetroArch

 This topic has been pinned, so it's probably important
Shader Preset Megathread
If you have a shader preset you like to use and want to share it, please share it here.
Use the applicable shaders that are visible to your selected driver settings. ".slang" is used with Vulkan. ".cg" is used for D3d, and ".glsl" is used for OpenGL.
Due to the risk of viruses and shady download sites, please refrain from sharing your shader presets by straight up uploading them and providing a link. Screenshots are recommended.

Example format for screenshots:

[b][h1]SNES Hi-Res Blend with XBrz Freescale[/h1][/b]
Set the XBRz Free scaling to 2x for 16-bit games. Leave as is for 8-bit games.
https://imgur.com/a/msCULqf

Result:
SNES Hi-Res Blend with XBrz Freescale

Set the XBRz Free scaling to 2x for 16-bit games. Leave as is for 8-bit games.
https://imgur.com/a/msCULqf

Example Format for sharing code (please state the driver you are using in RA for the code to avoid confusion):

[b][h1]SNES Hi-Res Blend with XBrz Freescale[/h1][/b]
[u]Driver here (in this case "Vulkan" or ".slang"[/u]

["code"] Without Quotes on this line only
shaders = "2"
shader0 = "shaders_slang/crt/shaders/snes-hires-blend.slang"
filter_linear0 = "true"
wrap_mode0 = "clamp_to_border"
mipmap_input0 = "false"
alias0 = ""
float_framebuffer0 = "false"
srgb_framebuffer0 = "false"
scale_type_x0 = "source"
scale_x0 = "1.000000"
scale_type_y0 = "source"
scale_y0 = "1.000000"
shader1 = "shaders_slang/xbrz/shaders/xbrz-freescale.slang"
filter_linear1 = "true"
wrap_mode1 = "clamp_to_border"
mipmap_input1 = "false"
alias1 = ""
float_framebuffer1 = "false"
srgb_framebuffer1 = "false"
scale_type_x1 = "source"
scale_x1 = "1.000000"
scale_type_y1 = "source"
scale_y1 = "1.000000"
["/code"] Again Without Quotes on this line only

Result of Code sharing:
SNES Hi-Res Blend with XBrz Freescale

Driver here (in this case "Vulkan" or ".slang"
shaders = "2" shader0 = "shaders_slang/crt/shaders/snes-hires-blend.slang" filter_linear0 = "true" wrap_mode0 = "clamp_to_border" mipmap_input0 = "false" alias0 = "" float_framebuffer0 = "false" srgb_framebuffer0 = "false" scale_type_x0 = "source" scale_x0 = "1.000000" scale_type_y0 = "source" scale_y0 = "1.000000" shader1 = "shaders_slang/xbrz/shaders/xbrz-freescale.slang" filter_linear1 = "true" wrap_mode1 = "clamp_to_border" mipmap_input1 = "false" alias1 = "" float_framebuffer1 = "false" srgb_framebuffer1 = "false" scale_type_x1 = "source" scale_x1 = "1.000000" scale_type_y1 = "source" scale_y1 = "1.000000"
< >
Showing 1-15 of 18 comments
This is my favorite CRT shader, it gets the Sonic the Hedgehog waterfall transparency right that the Sega Genesis Classics releases here on Steam can't even with CRT scanlines activated: https://www.reddit.com/r/RetroArch/comments/hwdfte/sharing_my_crtroyalentsc_preset_for_1080p/

If you want to get rid of the curved screen edge set geometry - mode in the the UI to 0 and then save over the preset.
Originally posted by Yistaan:
This is my favorite CRT shader, it gets the Sonic the Hedgehog waterfall transparency right that the Sega Genesis Classics releases here on Steam can't even with CRT scanlines activated: https://www.reddit.com/r/RetroArch/comments/hwdfte/sharing_my_crtroyalentsc_preset_for_1080p/

If you want to get rid of the curved screen edge set geometry - mode in the the UI to 0 and then save over the preset.
Oh nice :-) Thanks for sharing. By the way, if you want the Steam version of Retorarch, it was released this morning on Steam :-)
https://steamcommunity.com/sharedfiles/filedetails/?id=2604157438

Lottes multipass settings for Slang aka vulcan video driver.

Give it a go it has a Trinitron look.
It's rare that a shader doesn't dim the screen too much.

Change shadowmask if you would prefer pixels over scanlines.
This is just default CRT-Royale but with gdapt loaded beforehand for the dithering effect a lot of SEGA Genesis games rely on.
Here's a comparison with gdapt on and off, respectivelly:
https://steamcommunity.com/sharedfiles/filedetails/?id=2605865816
https://steamcommunity.com/sharedfiles/filedetails/?id=2605865998
I'm using glcore so it uses slang shaders, it should be placed in the root shaders folder (e.g. Steam\steamapps\common\RetroArch\shaders)
# IMPORTANT: # Shader passes need to know details about the image in the mask_texture LUT # files, so set the following constants in user-preset-constants.h accordingly: # 1.) mask_triads_per_tile = (number of horizontal triads in mask texture LUT's) # 2.) mask_texture_small_size = (texture size of mask*texture_small LUT's) # 3.) mask_texture_large_size = (texture size of mask*texture_large LUT's) # 4.) mask_grille_avg_color = (avg. brightness of mask_grille_texture* LUT's, in [0, 1]) # 5.) mask_slot_avg_color = (avg. brightness of mask_slot_texture* LUT's, in [0, 1]) # 6.) mask_shadow_avg_color = (avg. brightness of mask_shadow_texture* LUT's, in [0, 1]) # Shader passes also need to know certain scales set in this preset, but their # compilation model doesn't currently allow the preset file to tell them. Make # sure to set the following constants in user-preset-constants.h accordingly too: # 1.) bloom_approx_scale_x = scale_x2 # 2.) mask_resize_viewport_scale = vec2(scale_x6, scale_y5) # Finally, shader passes need to know the value of geom_max_aspect_ratio used to # calculate scale_y5 (among other values): # 1.) geom_max_aspect_ratio = (geom_max_aspect_ratio used to calculate scale_y5) shaders = "14" # Set an identifier, filename, and sampling traits for the phosphor mask texture. # Load an aperture grille, slot mask, and an EDP shadow mask, and load a small # non-mipmapped version and a large mipmapped version. # TODO: Test masks in other directories. textures = "mask_grille_texture_small;mask_grille_texture_large;mask_slot_texture_small;mask_slot_texture_large;mask_shadow_texture_small;mask_shadow_texture_large" mask_grille_texture_small = "shaders_slang/crt/shaders/crt-royale/TileableLinearApertureGrille15Wide8And5d5SpacingResizeTo64.png" mask_grille_texture_large = "shaders_slang/crt/shaders/crt-royale/TileableLinearApertureGrille15Wide8And5d5Spacing.png" mask_slot_texture_small = "shaders_slang/crt/shaders/crt-royale/TileableLinearSlotMaskTall15Wide9And4d5Horizontal9d14VerticalSpacingResizeTo64.png" mask_slot_texture_large = "shaders_slang/crt/shaders/crt-royale/TileableLinearSlotMaskTall15Wide9And4d5Horizontal9d14VerticalSpacing.png" mask_shadow_texture_small = "shaders_slang/crt/shaders/crt-royale/TileableLinearShadowMaskEDPResizeTo64.png" mask_shadow_texture_large = "shaders_slang/crt/shaders/crt-royale/TileableLinearShadowMaskEDP.png" mask_grille_texture_small_wrap_mode = "repeat" mask_grille_texture_large_wrap_mode = "repeat" mask_slot_texture_small_wrap_mode = "repeat" mask_slot_texture_large_wrap_mode = "repeat" mask_shadow_texture_small_wrap_mode = "repeat" mask_shadow_texture_large_wrap_mode = "repeat" mask_grille_texture_small_linear = "true" mask_grille_texture_large_linear = "true" mask_slot_texture_small_linear = "true" mask_slot_texture_large_linear = "true" mask_shadow_texture_small_linear = "true" mask_shadow_texture_large_linear = "true" mask_grille_texture_small_mipmap = "false" # Mipmapping causes artifacts with manually resized masks without tex2Dlod mask_grille_texture_large_mipmap = "true" # Essential for hardware-resized masks mask_slot_texture_small_mipmap = "false" # Mipmapping causes artifacts with manually resized masks without tex2Dlod mask_slot_texture_large_mipmap = "true" # Essential for hardware-resized masks mask_shadow_texture_small_mipmap = "false" # Mipmapping causes artifacts with manually resized masks without tex2Dlod mask_shadow_texture_large_mipmap = "true" # Essential for hardware-resized masks # Pass0: gdapt pass 0 shader0 = shaders_slang/dithering/shaders/gdapt/gdapt-pass0.slang filter_linear0 = false scale_type0 = source scale0 = 1.0 # Pass1: gdapt pass 1 shader1 = shaders_slang/dithering/shaders/gdapt/gdapt-pass1.slang filter_linear1 = false scale_type1 = source scale1 = 1.0 # Pass2: Linearize the input based on CRT gamma and bob interlaced fields. # (Bobbing ensures we can immediately blur without getting artifacts.) shader2 = "shaders_slang/crt/shaders/crt-royale/src/crt-royale-first-pass-linearize-crt-gamma-bob-fields.slang" alias2 = "ORIG_LINEARIZED" filter_linear2 = "false" scale_type2 = "source" scale2 = "1.0" srgb_framebuffer2 = "true" # Pass3: Resample interlaced (and misconverged) scanlines vertically. # Separating vertical/horizontal scanline sampling is faster: It lets us # consider more scanlines while calculating weights for fewer pixels, and # it reduces our samples from vertical*horizontal to vertical+horizontal. # This has to come right after ORIG_LINEARIZED, because there's no # "original_source" scale_type we can use later. shader3 = "shaders_slang/crt/shaders/crt-royale/src/crt-royale-scanlines-vertical-interlacing.slang" alias3 = "VERTICAL_SCANLINES" filter_linear3 = "true" scale_type_x3 = "source" scale_x3 = "1.0" scale_type_y3 = "viewport" scale_y3 = "1.0" srgb_framebuffer3 = "true" # Pass4: Do a small resize blur of ORIG_LINEARIZED at an absolute size, and # account for convergence offsets. We want to blur a predictable portion of the # screen to match the phosphor bloom, and absolute scale works best for # reliable results with a fixed-size bloom. Picking a scale is tricky: # a.) 400x300 is a good compromise for the "fake-bloom" version: It's low enough # to blur high-res/interlaced sources but high enough that resampling # doesn't smear low-res sources too much. # b.) 320x240 works well for the "real bloom" version: It's 1-1.5% faster, and # the only noticeable visual difference is a larger halation spread (which # may be a good thing for people who like to crank it up). # Note the 4:3 aspect ratio assumes the input has cropped geom_overscan (so it's # *intended* for an ~4:3 aspect ratio). shader4 = "shaders_slang/crt/shaders/crt-royale/src/crt-royale-bloom-approx.slang" alias4 = "BLOOM_APPROX" filter_linear4 = "true" scale_type4 = "absolute" scale_x4 = "320" scale_y4 = "240" srgb_framebuffer4 = "true" # Pass5: Vertically blur the input for halation and refractive diffusion. # Base this on BLOOM_APPROX: This blur should be small and fast, and blurring # a constant portion of the screen is probably physically correct if the # viewport resolution is proportional to the simulated CRT size. shader5 = "shaders_slang/blurs/blur9fast-vertical.slang" filter_linear5 = "true" scale_type5 = "source" scale5 = "1.0" srgb_framebuffer5 = "true" # Pass6: Horizontally blur the input for halation and refractive diffusion. # Note: Using a one-pass 9x9 blur is about 1% slower. shader6 = "shaders_slang/blurs/blur9fast-horizontal.slang" alias6 = "HALATION_BLUR" filter_linear6 = "true" scale_type6 = "source" scale6 = "1.0" srgb_framebuffer6 = "true" # Pass7: Lanczos-resize the phosphor mask vertically. Set the absolute # scale_x7 == mask_texture_small_size.x (see IMPORTANT above). Larger scales # will blur, and smaller scales could get nasty. The vertical size must be # based on the viewport size and calculated carefully to avoid artifacts later. # First calculate the minimum number of mask tiles we need to draw. # Since curvature is computed after the scanline masking pass: # num_resized_mask_tiles = 2.0; # If curvature were computed in the scanline masking pass (it's not): # max_mask_texel_border = ~3.0 * (1/3.0 + 4.0*sqrt(2.0) + 0.5 + 1.0); # max_mask_tile_border = max_mask_texel_border/ # (min_resized_phosphor_triad_size * mask_triads_per_tile); # num_resized_mask_tiles = max(2.0, 1.0 + max_mask_tile_border * 2.0); # At typical values (triad_size >= 2.0, mask_triads_per_tile == 8): # num_resized_mask_tiles = ~3.8 # Triad sizes are given in horizontal terms, so we need geom_max_aspect_ratio # to relate them to vertical resolution. The widest we expect is: # geom_max_aspect_ratio = 4.0/3.0 # Note: Shader passes need to know this! # The fewer triads we tile across the screen, the larger each triad will be as a # fraction of the viewport size, and the larger scale_y5 must be to draw a full # num_resized_mask_tiles. Therefore, we must decide the smallest number of # triads we'll guarantee can be displayed on screen. We'll set this according # to 3-pixel triads at 768p resolution (the lowest anyone's likely to use): # min_allowed_viewport_triads = 768.0*geom_max_aspect_ratio / 3.0 = 341.333333 # Now calculate the viewport scale that ensures we can draw resized_mask_tiles: # min_scale_x = resized_mask_tiles * mask_triads_per_tile / # min_allowed_viewport_triads # scale_y7 = geom_max_aspect_ratio * min_scale_x # # Some code might depend on equal scales: # scale_x8 = scale_y7 # Given our default geom_max_aspect_ratio and min_allowed_viewport_triads: # scale_y7 = 4.0/3.0 * 2.0/(341.33333 / 8.0) = 0.0625 # IMPORTANT: The scales MUST be calculated in this way. If you wish to change # geom_max_aspect_ratio, update that constant in user-preset-constants.h! shader7 = "shaders_slang/crt/shaders/crt-royale/src/crt-royale-mask-resize-vertical.slang" filter_linear7 = "true" scale_type_x7 = "absolute" scale_x7 = "64" scale_type_y7 = "viewport" scale_y7 = "0.0625" # Safe for >= 341.333 horizontal triads at viewport size #srgb_framebuffer7 = "false" # mask_texture is already assumed linear # Pass8: Lanczos-resize the phosphor mask horizontally. scale_x8 = scale_y7. # TODO: Check again if the shaders actually require equal scales. shader8 = "shaders_slang/crt/shaders/crt-royale/src/crt-royale-mask-resize-horizontal.slang" alias8 = "MASK_RESIZE" filter_linear8 = "false" scale_type_x8 = "viewport" scale_x8 = "0.0625" scale_type_y8 = "source" scale_y8 = "1.0" #srgb_framebuffer8 = "false" # mask_texture is already assumed linear # Pass9: Resample (misconverged) scanlines horizontally, apply halation, and # apply the phosphor mask. shader9 = "shaders_slang/crt/shaders/crt-royale/src/crt-royale-scanlines-horizontal-apply-mask.slang" alias9 = "MASKED_SCANLINES" filter_linear9 = "true" # This could just as easily be nearest neighbor. scale_type9 = "viewport" scale9 = "1.0" srgb_framebuffer9 = "true" # Pass 10: Compute a brightpass. This will require reading the final mask. shader10 = "shaders_slang/crt/shaders/crt-royale/src/crt-royale-brightpass.slang" alias10 = "BRIGHTPASS" filter_linear10 = "true" # This could just as easily be nearest neighbor. scale_type10 = "viewport" scale10 = "1.0" srgb_framebuffer10 = "true" # Pass 11: Blur the brightpass vertically shader11 = "shaders_slang/crt/shaders/crt-royale/src/crt-royale-bloom-vertical.slang" filter_linear11 = "true" # This could just as easily be nearest neighbor. scale_type11 = "source" scale11 = "1.0" srgb_framebuffer11 = "true" # Pass 12: Blur the brightpass horizontally and combine it with the dimpass: shader12 = "shaders_slang/crt/shaders/crt-royale/src/crt-royale-bloom-horizontal-reconstitute.slang" filter_linear10 = "true" scale_type10 = "source" scale10 = "1.0" srgb_framebuffer10 = "true" # Pass 13: Compute curvature/AA: shader13 = "shaders_slang/crt/shaders/crt-royale/src/crt-royale-geometry-aa-last-pass.slang" filter_linear11 = "true" scale_type11 = "viewport" mipmap_input11 = "true" texture_wrap_mode11 = "clamp_to_edge"
I cant apply shaders to my games, how do i do it?
Haven't played in a few months, but my CRT shaders don't load now. Was there an update that broke everything?
Originally posted by CozmicNonsense:
Haven't played in a few months, but my CRT shaders don't load now. Was there an update that broke everything?
Yeah there was. I had to readjust some of the ones I used and re-save others. Most of the ROyale shaders still work IIRC, espeically the XM29 Plus....which is the one I use for NES and SNES titles.
Originally posted by TehSpoopyKitteh:
Originally posted by CozmicNonsense:
Haven't played in a few months, but my CRT shaders don't load now. Was there an update that broke everything?
Yeah there was. I had to readjust some of the ones I used and re-save others. Most of the ROyale shaders still work IIRC, espeically the XM29 Plus....which is the one I use for NES and SNES titles.
The Royale shaders are the ones that aren't working for me :(
Originally posted by CozmicNonsense:
Originally posted by TehSpoopyKitteh:
Yeah there was. I had to readjust some of the ones I used and re-save others. Most of the ROyale shaders still work IIRC, espeically the XM29 Plus....which is the one I use for NES and SNES titles.
The Royale shaders are the ones that aren't working for me :(
The composite Royal shaders don’t work for me, but the XM29+ shader still works if I load the base of it from the “Slang/Presets” folder (I use the Vulkan API). I think they took out the bubble geometry effects in some of them.
Been a while since anyone posted in here. I’ve found a new set of shader presets by one HyperspaceMadness. I’ve been dorking around and tweaking some of the MegaBezel presets. I’m not about to post 40+ lines of shader assemblyâ€Ķ


This tweak modified several assembly linesâ€Ķbut this one perfectly blends the waterfalls in Sonic 1 and Shinobi III. I replaced some lines. This goes into the “slang/bezel” folder.

https://github.com/HyperspaceMadness/Mega_Bezel

The tweaks I made for one of the presets replaced 3 lines of the assembly.

Shader#6 should be “xbrz-freescale.slang”

Shader#9 needs to be “g-sharp_resampler.slang” (found in the “slang/dither” folder.

Shader#12 should be “sgenpt-mix.slang” (also found in the same folder as shader #9)
https://cdn.discordapp.com/attachments/1059938939491860601/1061465249506656347/MBZ_2_ADV-NO-REFLECT_Gsharp-Resampler_Freescale-xBRz-NTSC.slangp

After all that, if you want to mess with the preset I modified, you need to go to the shader perimeters, set the aspect ratio to 3:2, set the NTSC quality to 2-Phase S-Video, lower the NTSC brightness to 0.95, and get rid of the curve.
Originally posted by TehSpoopyKitteh:
The tweaks I made for one of the presets replaced 3 lines of the assembly.
Curious to know what this looks like but it would have been better to copy paste the lines as this is confusing.
Originally posted by VirtuaTyKing:
Originally posted by TehSpoopyKitteh:
The tweaks I made for one of the presets replaced 3 lines of the assembly.
Curious to know what this looks like but it would have been better to copy paste the lines as this is confusing.
I have recent screenshots.
Originally posted by TehSpoopyKitteh:
Originally posted by VirtuaTyKing:
Curious to know what this looks like but it would have been better to copy paste the lines as this is confusing.
I have recent screenshots.
Yeah be good to have a look.
Google didn't helped, but maybe someone here can help...
Is there a way to use these shaders outside of RetroArch? Like system-wide, or particular Windows game?
< >
Showing 1-15 of 18 comments
Per page: 1530 50