Shader Preset Wildcards

Coding for Retroarch is uncommonly difficult. (Or so HSM tells me.)

All the wildcard features are general in nature, they aren’t core specific.

To set up an NDS or 3DS rom to automatically use one (or another) mode requires a game override.

Since user action cannot be avoided, I see no benefit for any wildcard feature.

1 Like

I’m trying to use this wildcard: $GAME$.params It works fine with anything except game names that contain “&”. I tried replacing that with “_” and “-” and straight up “and”.

But nothing worked. Any tips?

Alright I solved this. It turned out that it was actually a long path/name problem, you’ll need to first load the shader with a short content path, set the override, then you can load any content normally even with long paths or weird characters like “&”.

1 Like

Can we see a little more info on exactly how you are using the wildcard?

If there is a path issue that shouldn’t exist it would be nice to call attention to it so @HyperspaceMadness can fix it.

1 Like

I have a GBA_Auto.slangp preset which has the following wildcards to override the bezel color based on my game or direcory:

$CONTENT-DIR$.params $GAME$.params

In the referenced params/auto folder there are directory_name.params files like:

Game Boy Advance (Grey).params

Which has the override to change the bezel:

bg_over = “…/…/…/textures/GBA_textures/GBA_Grey.png”

The games themselves are located in:

D:/Retro/Roms/Nintendo - Game Boy Advance/Game Boy Advance (Grey)/Castlevania - Aria of Sorrow (USA).zip

That won’t load GBA_Auto.slangp, but if I pick something with a shorter name, and located in one less folder depth, it works fine.

That is two changes made at the same time, which is not best practice when troubleshooting.

Does it work with only shortening the name?

or

Does it work with only lessening the folder depth?

What does the log say when it fails to load?


If I may?

I’m not exactly sure what HSM had in mind when he created the $CONTENT-DIR$ wildcard but if I were doing this I might try naming the texture “Game Boy Advance (Grey).png” and using

bg_over = “…/…/…/textures/GBA_textures/$CONTENT-DIR$.png”

to eliminate the need for the “Game Boy Advance (Grey).params” file.

1 Like

Hmm, I did more tests and it seems none of that works anymore, but here’s the log:

[WARN] [Shaders]: Could not load root preset for #reference entry: “D:\RETRO\RetroArch\shaders\koko-aio_packs\LodanZark\GBA_presets\params\auto$CONTENT-DIR$.params”. [ERROR] [GLCore]: Failed to create preset: “D:\RETRO\RetroArch\shaders\koko-aio_packs\LodanZark\GBA_presets\GBA_Auto.slangp”. [ERROR] [GLCore]: Failed to create filter chain: “D:\RETRO\RetroArch\shaders\koko-aio_packs\LodanZark\GBA_presets\GBA_Auto.slangp”. Falling back to stock. [INFO] [slang]: Building pass #0 (N/A) [INFO] [GLCore]: Not using frame history. [INFO] [GLCore]: Not using framebuffer feedback.

Edit: now I rememberd why I’m using a separate params file, it lets me or other users rename the params files to match their folder names without altering the image overlays, because those overlays are used by other non-auto presets (auto is just an optional preset and not practical for normal setups).

1 Like

It may be the formatting making the log hard to read but…

It looks like your syntax may be incorrect… you are missing a forward slash before the wildcard.

1 Like

It’s correct in the preset itself:

Screenshot_1

The funny thing is that by manually creating a slangp core override, the wildacrd works fine:

#reference ":/shaders/koko-aio_packs/LodanZark/GBA_presets/GBA_Auto.slangp"

So the problem only happens when trying to load the preset from RA’s menu.

1 Like

Any way you could zip up and get me just the needed files so I could try it on my end?

No need for any graphics, just the other files.

1 Like

There you go.

1 Like

You need an empty file named “$GAME$.params” in your auto folder.

The shader is looking for a game named params file. In it’s absence it needs a fallback file to continue compiling.

It might also be a good idea to have a “$CONTENT-DIR$.params” file containing just the

#reference "GBA_Indigo_main.slangp"

line.

That way no matter what game or content directory is used, the default will load.

1 Like

Fantastic, thank you very much.

Edit: having two empty files worked for me:

$CONTENT-DIR$.params

$GAME$.params

You are welcome!

I am a bit confused on your intent though.

My plans concerning the $CONTENT-DIR$ revolve around including various “Retroarch.slangp” global presets that intend users use suggested content directories. (Such as Batocera uses.)

This way users can copy the style of their choice into the root shaders folder to set every system up in one step.

The end result would be much like the decoration/shader profiles available in Batocera.

2 Likes

I’m mostly experimenting lol. But my GBA/GBC rom folders are organized based on matching colors for games, for example I have Kirby games in GBA Pink folder, so I prefer a pink overlay for them, and my Pokemon games are in their matching color folders, with their own customized overlays of course.

That’s brilliant.

1 Like

Hello everyone, I’m new to the forums but I use Retroarch for a looong time,

I understand that this is an old thread but I think that I might find my answer here rather anywhere else.

After updating Retroarch to version 1.20.0 I experience an issue with wildcard path replacement only with the $CORE$ (core name) wildcard. All the other wildcards I’m using works with no problem at all.

Specifically I use a shader preset inside “:/shaders” folder so that when I cycle through my custom presets (using the N,M buttons) at some point by selecting it, it reverts the shader back to its “default” preset inside the “:/config/core_name” preset I’ve set up ether as Content Directory or as Core Name or as Game/Rom Name.

So this is how my shader folder looks like:

My Custom Shaders Presets

And this is the “[DEFAULT SHADER].slangp” file reference line:

#reference ":/config/$CORE$/[Revert_Default_Shader].slangp"

The “[Revert_Default_Shader].slangp” file resides inside every “:/config/Core_Name” and its contents are:

// Use by uncommenting the line of code you want, deleting the leading // only.

//#reference "$GAME$.slangp"

#reference "$CONTENT-DIR$.slangp"

//#reference "$CORE$.slangp"

//#reference "[Specific].slangp"

So by uncommenting the specific line the path looks for ether the local ‘Game-Rom Name’ or the ‘Content Directory’ or the ‘Core_Name’ or a ‘Specific/Custom’ slangp preset witch I’ve set-up as default when the game starts.

The issue is that ONLY the $CORE$ wildcard does not work (which used to work back in Retroarch version 1.19.1) ether on “[DEFAULT SHADER].slangp” nor the “[Revert_Default_Shader].slangp” file.

I’ve tasted it intensively by changing the folders name to match either one of the above setups.

After all I hope I’m using the wildcards feature the right way and didn’t miss anything along the way.

I also want to mention that I use @HyperspaceMadness Mega-Bezel shaders and the other “Mega_Bezel_Packs” (@Duimon, MagicHat (which by the way works as intended with Orionsangel bezels), kokoko3k, p3st, soqueroeu, TheNamec etc.) all working perfectly.

As a bonus question specifically to @HyperspaceMadness relative to my issue is how to actually use your “resource/wildcard-examples” because every slangp preset I use neither the ‘fallback’ image or the ‘success’ image appear but the “Ref-Base.slangp” loads fine!

Please if anyone has any information about this issue please share.

Finally I would like to thank EVERYONE and I mean EVERYONE in the community who participates in pushing our Retro Gaming experience on another level !!

THANK YOU ! :smiley:

Welcome to the forum!

Before the Mega Bezel I was also a long time lurker :wink:

I’m glad you have been getting some use out of the wildcards!

This issue has been brought to my attention just recently. There’s something which must have changed in Retroarch with this particular wildcard, I’ll have to look into it to see what exactly is going on.

If it used to work then stopped working when you moved to retroarch 2.0 then you were using it correctly before and something has changed or broken in the retroarch 2.0 as the shader has not changed in months.

I’ll also have to take a look at the “resource/wildcard-examples” basically if you have particular criteria in use, e.g. if loading Preset-03-VideoDriver.slangp and you are using the glcore video driver you should see the success image, any other driver and you should see the fallback image.

Is the shader loading but you see something else? Or does the shader fail to load?

Thanks for coming along on this journey of pixels!

Thats great news @HyperspaceMadness this means that everything will hopefully return to “normal” and peace will prevail in my mind at last. :innocent:

As of right now I’m in front of my SUPER-POTATO machine so the shader crashes Retroarch (which i think is normal, considering the specs of this SUPER-POTATO pc:

Intel Core i3-3220 CPU @ 3.30GHz with 4,00 GB RAM and a monitor with 1360x768 resolution.

Most of the super-light-weight shaders work on this machine on glcore driver but not the Mega-Bezel ones… :sob:

If i remember the shader was loading correctly the ‘Ref-Base.slangp’ part but later in the evening (on this part of the world :earth_africa:) i will report back from my other not so SUPER-POTATO pc with glcore and Vulkan support and the truth will unveil ! :crossed_swords:

I will also try the Preset-03-VideoDriver.slangp you mentioned.

Thanks for the super-fast reply!

1 Like

Ok, here are some new findings using my second not so SUPER-POTATO pc:

[Intel® Core™ i5-6500 CPU @ 3.20GHz with 8,00 GB RAM]

Only the below resource presets give “Wildcard Success” message:

  • Preset-04-CoreRequestedRotation,
  • Preset-06-VideoUserRotation,
  • Preset-07-VideoFinalRotation,
  • Preset-08-ScreenOrientation,
  • Preset-09-ViewportAspectOrientation,
  • Preset-10-CoreAspectOrientation,
  • Preset-11-PresetDir,
  • Preset-12-PresetName,
  • Preset-13-VideoDriverPresetExtension, and
  • Preset-14-VideoDriverShaderExtension

Everything else return “Wilcard Fallback”.

I’ve test them under both glcore and Vulkan drivers (although i dont think that it matters except perhaps the ‘Preset-03-VideoDriver.slang’) both returning “Wilcard Fallback” message!

The shader itself seems to load fine under both drivers on this pc.

Hope I helped somehow but if you need anything else from me to try please ask and i post back as quickly as possible. :slightly_smiling_face:

1 Like

Hello there, i’ m back to just report that the $CORE$ wildcard issue in RetroArch 1.21.0 has been fixed!

I saw a while back this issue opened by @Starman99x that got fixed from @kokoko3k here, but i thought it is a good idea now that the new version is up to confirm the fix.

Thanks a lot to all who participated. :smile:

7 Likes