Replicating Mednafen's 'Goat' shader in Retroarch

Hey. So, Mednafen’s Goat shader is pretty much exactly what I’m looking for for MegaDrive/Genesis games (and most 16/32-bit consoles), but I can’t seem to replicate it using Retroarch’s shader library. The closest I’ve managed is to use crt-easymode or crt-geom with the geometry turned off and horizontal scanlines turned down, and tweaking some other bits, but it’s just not quite right.

Road Rash II - Mednafen - Goat OpenGL + scanlines (goatron mask pattern)

Road Rash II - Retroarch (Genesis Plus GX core) - crt-easymode

The big difference is that Goat gives a more fuzzy effect, and crt-easymode has an overbright luminescence/bloom.

Are there any existing shaders that can replicate that sweet, sweet Mednafen look in Retroarch?

shaders

i asked this once when goat shader was included. i think @hunterk has best know-how of the shaders

Does anyone have a link for Mednafen’s GOAT shader (the actual code) because that would help alot? I’ve been looking and I can’t find it, their github just has pre-compiled versions of the emulator, which makes this alot more difficult (for a multitude of reasons).

Apologies if this is not what you’re looking for, but I found the Mednafen shader C++ file on the OpenEmu github:

1 Like

Yeahhhhh… That’s close to what I was looking for, it seems like it’s a combo of that link and the shader.h, alongside a couple of files (that I haven’t tried to search for, on mobile and it’s having none of github).

This is over my head though, but having these links makes it easier for anyone thats willing/can to try and port it. Sorry, if I got your hopes up…

@hunterk can I cry about it? lmfao :joy:

So, instead of trying to decode the GOAT shader settings using Mednafen’s C++ & .h files, I went along and changed some parameters of the much-loved crt-easymode to give, what I think, is a lovely replication of the CRT displays I remember in my youth, where individual pixels were visible, and it was less scanline-intensive. I grew up with PAL games, using a big-ass SONY (Grundig? Ferguson?) aperture-grille (Trinitron?) woodgrain CRT television set, where scanlines really weren’t much of a thing, but pixel definition was particularly acute. But I digress.

I use this as a general preset for my arcade and 8/16-bit console emulators.

Arcade cabinet settings:

parameters = "SHARPNESS_H;SHARPNESS_V;MASK_STRENGTH;MASK_DOT_WIDTH;MASK_DOT_HEIGHT;MASK_STAGGER;MASK_SIZE;SCANLINE_STRENGTH;SCANLINE_BEAM_WIDTH_MIN;SCANLINE_BEAM_WIDTH_MAX;SCANLINE_BRIGHT_MIN;SCANLINE_BRIGHT_MAX;SCANLINE_CUTOFF;GAMMA_INPUT;GAMMA_OUTPUT;BRIGHT_BO OST;DILATION"
SHARPNESS_H = "0.500000"
SHARPNESS_V = "1.000000"
MASK_STRENGTH = "0.300000"
MASK_DOT_WIDTH = "1.000000"
MASK_DOT_HEIGHT = "1.000000"
MASK_STAGGER = "0.000000"
MASK_SIZE = "1.000000"
SCANLINE_STRENGTH = "1.000000"
SCANLINE_BEAM_WIDTH_MIN = "1.500000"
SCANLINE_BEAM_WIDTH_MAX = "1.500000"
SCANLINE_BRIGHT_MIN = "0.350000"
SCANLINE_BRIGHT_MAX = "0.650000"
SCANLINE_CUTOFF = "400.000000"
GAMMA_INPUT = "2.000000"
GAMMA_OUTPUT = "1.800000"
BRIGHT_BOOST = "1.200000"
DILATION = "1.000000"

8/16-bit console settings:

parameters = "SHARPNESS_H;SHARPNESS_V;MASK_STRENGTH;MASK_DOT_WIDTH;MASK_DOT_HEIGHT;MASK_STAGGER;MASK_SIZE;SCANLINE_STRENGTH;SCANLINE_BEAM_WIDTH_MIN;SCANLINE_BEAM_WIDTH_MAX;SCANLINE_BRIGHT_MIN;SCANLINE_BRIGHT_MAX;SCANLINE_CUTOFF;GAMMA_INPUT;GAMMA_OUTPUT;BRIGHT_BOOST;DILATION"
SHARPNESS_H = "0.750000"
SHARPNESS_V = "0.750000"
MASK_STRENGTH = "0.500000"
MASK_DOT_WIDTH = "1.000000"
MASK_DOT_HEIGHT = "1.000000"
MASK_STAGGER = "1.000000"
MASK_SIZE = "1.000000"
SCANLINE_STRENGTH = "0.350000"
SCANLINE_BEAM_WIDTH_MIN = "2.000000"
SCANLINE_BEAM_WIDTH_MAX = "1.000000"
SCANLINE_BRIGHT_MIN = "0.250000"
SCANLINE_BRIGHT_MAX = "0.500000"
SCANLINE_CUTOFF = "225.000000"
GAMMA_INPUT = "2.000000"
GAMMA_OUTPUT = "2.000000"
BRIGHT_BOOST = "1.240000"
DILATION = "1.000000"

I’m sorta happy with these settings. They’re not as similar to Mednafen’s Goatron as I’d like, but they hit the aperture-grille nostalgia mark for me, so until such time as the GOAT shader can be 100% recreated in Retroarch, I’ll be using these settings, instead :wink:

1 Like

How do you actually do this? I loaded up the crt-easymode shader in retroarch and when I went to the shader parameters, it says “no shader parameters.”

Which video drivers are you using? I’m using gl and crt-easymode within shaders_glsl. Other shaders sometimes don’t have options under different drivers, so try switching to glslang shaders if you haven’t already - the options are there!

Still trying after all these years!

I’m currently using the MegaBezels Guest-DrVenom shaders for the cool reflections they provide, on everything from Atari 2700 to DreamCast, but no settings I try manage to recreate the GOATRON shader in mednafen …!

Here’s as close as I get:

image

The black in Goatron is much thicker and colours bleed more into the surrounding pixels. The white in MegaBezel is much brighter and fatter. The horizontal scanlines are also less pronounced in Goatron, and vertical lines between pixels are more visible. Fiddling with the parameters in RetroArch begins to bork the overall picture until there’s no way back but to reset the shader entirely, hence my frustration at being incapable of getting the nuances right!

Scanning the mednafen sourcecode I can see Goatron’s mask width=3 and height=1, but that’s about all I can glean, not being a codemonkey.

Also, the pixels in RetroArch seem wider? Though that’s probably down to me skewing the picture to fit the platform-specific screen overlays I’ve made (e.g.:

)

Other than that, I’m at a loss. There are so many variables in MegaBezel, it’s impossible to work out which ones tend towards aligning with the Goatron filter, and narrowing down the following parameters usually results in a stupidly warped and ruined picture:

Any help? Any better RetroArch filters I could be using?

Thanks!!

2 Likes

Maybe try working on crt-guest-advanced without the mega bezel involved, just to cut down your number of options. You might also check some of the other near-infinitely-configurable CRT shaders, like crt-geom-deluxe, mame_hlsl and crt-royale.

2 Likes

Yeah I would recommend this too, if the number of parameters is overwhelming.

If you find settings you like then you can use all these in the Mega Bezel later if you want.

3 Likes

This looks like you’re quite close already. I’m seeing an RGB phosphor pattern on the image on the left but the one on the right seems to be using a B&W Mask.

So you can start there. Masks are WYSIWYG so you can get close to your screen and simply go through the CRT Mask Types until you find one that looks similar.

This looks like an Aperture Grill Mask as well so you can start from Mask 5 and go all the way up to Mask 12, keeping the Mask Size at 1.

Be sure your Mask Strength is at least 50% or you may not be able to see the Mask colours clearly.

You can take a look at the following posts for some more information on the various Masks available in CRT-GUEST-ADVANCE and HSM Mega Bezel Reflection Shader.

2 Likes