Shader parameter management

In developing Scanline Classic I have flexed the current parameter system quite a lot, some thoughts:

  • Parameters are shown in RetroArch (RA) UI as a giant list, long shader chains lead to a really long list

  • We can use dummy parameters as headers to help with organization and some shader developers are already doing this. RA could recognize headers with either a standardized string convention (e.g. starts with ‘##’) or recognizing that the parameter values are all zero

  • Duplicate parameters will work among different shaders as long as the definition matches and get merged; this is good

  • Proposal: RA organizes parameters found between header blocks as parameters going into a submenu.

Example:

#pragma parameter "First-level (no submenu) parameter" 0.0 1.0 10.0 1.0

#pragma parameter "## Basic Settings" 0.0 0.0 0.0 0.0
// Other parameters go here

#pragma parameter "## Advanced Settings" 0.0 0.0 0.0 0.0
// More settings go here

The UI would show the first-level parameters on the main parameter menu and then have submenus for basic and advanced in this example. I think this could work if RA could build a tree that places the parameters under an header. Duplicates would merge if they fall under the same header. I’m not sure how to handle the case where duplicate parameters end up under different headers; may be best to throw an error.

I am thinking of opening a feature request but don’t have experience with working on the RA UI. Any feedback about the feasibility or potential issues would be welcome.

On the preset creation end, I think I can come up with a graphical tool that will make building presets easier than working in a text editor. The shader passes would be represented as blocks and you can edit the parameters by double clicking on the blocks, then export a preset file.

7 Likes

To simply open a feature request, just go here, click on new issue and select the “feature request” template. Sometimes, a developer is on a roll and implements it, if it’s possible. It also serves as a suggestion for new developers on what to work.

But I won’t lie: that kind of thing tends to be on hold for quite a long time. It’s a good idea, anyway.

2 Likes

@HyperspaceMadness was going take a look at this a few years ago.

The Mega Bezel has so many parameters that he had to go into the code and increase the limit more than once, so he could implement more features in the shader.

4 Likes