Settings - jedlimlx/supplemental-patches GitHub Wiki

Supplemental Patches allows new settings to be added to the settings page. The structure of the settings page is defined by the directory structure of the settings folder. All these settings are placed under the Supplemental Patches Settings button within the shaderpack.

A sample directory is below.

.
โ”œโ”€โ”€ about
โ”‚   โ”œโ”€โ”€ info_1.json
โ”‚   โ””โ”€โ”€ info_2.json
โ”œโ”€โ”€ caverns_and_chasms
โ”‚   โ”œโ”€โ”€ glowing_mime_energy.json
โ”‚   โ”œโ”€โ”€ glowing_silver_ore.json
โ”‚   โ”œโ”€โ”€ glowing_soul_silver_ore.json
โ”‚   โ””โ”€โ”€ glowing_spinel_ore.json
โ”œโ”€โ”€ caverns_and_chasms.json
โ”œโ”€โ”€ divider.json
โ”œโ”€โ”€ doom_and_gloom
โ”‚   โ”œโ”€โ”€ fog
โ”‚   โ”‚   โ”œโ”€โ”€ aurora_visibility.json
โ”‚   โ”‚   โ”œโ”€โ”€ fog_bloom.json
โ”‚   โ”‚   โ”œโ”€โ”€ fog_intensity.json
โ”‚   โ”‚   โ””โ”€โ”€ sun_brightness.json
โ”‚   โ””โ”€โ”€ fog.json
โ”œโ”€โ”€ doom_and_gloom.json
โ”œโ”€โ”€ galosphere
โ”‚   โ”œโ”€โ”€ glowing_allurite.json
โ”‚   โ”œโ”€โ”€ glowing_lumiere.json
โ”‚   โ”œโ”€โ”€ glowing_pink_salt.json
โ”‚   โ”œโ”€โ”€ glowing_silver_ore.json
โ”‚   โ””โ”€โ”€ waving_rope.json
โ”œโ”€โ”€ galosphere.json
โ”œโ”€โ”€ general
โ”‚   โ”œโ”€โ”€ potion_effects.json
โ”‚   โ””โ”€โ”€ waving_rope.json
โ”œโ”€โ”€ general.json
โ”œโ”€โ”€ oreganized
โ”‚   โ”œโ”€โ”€ crystal_glass_opacity.json
โ”‚   โ”œโ”€โ”€ glowing_lead_ore.json
โ”‚   โ”œโ”€โ”€ glowing_silver_ore.json
โ”‚   โ”œโ”€โ”€ molten_lead
โ”‚   โ”‚   โ””โ”€โ”€ waviness.json
โ”‚   โ””โ”€โ”€ molten_lead.json
โ”œโ”€โ”€ oreganized.json
โ”œโ”€โ”€ quark
โ”‚   โ”œโ”€โ”€ glowing_oretortoise_mult.json
โ”‚   โ”œโ”€โ”€ oretortoise.json
โ”‚   โ””โ”€โ”€ situational_oretortoise.json
โ”œโ”€โ”€ quark.json
โ”œโ”€โ”€ shader_version.json
โ”œโ”€โ”€ upgrade_aquatic
โ”‚   โ””โ”€โ”€ upgrade_aquatic.json
โ”œโ”€โ”€ upgrade_aquatic.json
โ”œโ”€โ”€ wetland_whimsy
โ”‚   โ””โ”€โ”€ glowing_bloodcap.json
โ”œโ”€โ”€ wetland_whismy.json
โ”œโ”€โ”€ yungs_cave_biomes
โ”‚   โ”œโ”€โ”€ sandstorm
โ”‚   โ”‚   โ”œโ”€โ”€ sandstorm_fog_bloom.json
โ”‚   โ”‚   โ”œโ”€โ”€ sandstorm_fog_intensity.json
โ”‚   โ”‚   โ””โ”€โ”€ sandstorm_waving_intensity.json
โ”‚   โ””โ”€โ”€ sandstorm.json
โ””โ”€โ”€ yungs_cave_biomes.json

Within each folder, there should be .json files and subfolders. There should be one .json file per subfolder to indicate information about that subfolder. Other settings are represented by a single .json.

The JSON parameters are as follows. Bolded and italized parameters are required.

  • type - The type of setting. This is either directory, info, setting or divider.
  • name - The name of the setting within the code. This will be used to reference the setting within your code. Typically, the naming convention is to have this entirely in UPPERCASE_LETTERS with underscores.
  • <language_code> - The name of this parameter should be a language code, such as en_US, zh_CN or ja_JP. Under this parameter, there are other parameters that dependent on type. If not provided, the user-unfriendly name will be shown on screen.
  • priority - The priority of the JSON. Higher priorities will be shown first on the screen. Settings with equal priority are sorted by alphabetical order of their name.

More specific parameters are each type are below.

Type Usage Parameters
directory Used to create subfolders to organise settings. - folder - The name of the subdirectory this .json file is linked to.
- <language_code>/screen - The name of this settings folder within the shaderpack settings GUI.
- <language_code>/comment - A comment describing the settings within the folder. Will appear as a tooltip.
info Used to provide information about the shaderpack. - <language_code>/option - The name of this information box within the shaderpack settings GUI.
- <language_code>/comment - A comment containing the information. Will appear as a tooltip.
setting Used to enable settings to be changed. -file - The settings file the settings should be placed in. When not specified, defaults to common.glsl.

- default - The default value of the setting. Can be a number or a boolean.
- conditions - Conditions that can be placed to modify the default value of the setting. Do not use with default. Comes as a list of dictionaries with if (containing conditions) and then (containing the value).

- values - Contains the values that the setting can take up. Not necessary if the setting can only be set to true and false.
- slider - Should the setting be a slider. Useful if there are a large number of values. If not, values will cycle when the setting button is clicked.

- <language_code>/option - The name of this setting within the shaderpack settings GUI.
- <language_code>/comment - A comment describing this setting. Will appear as a tooltip.
- <language_code>/value.<value> - Replace <value> with a value that the setting can take. Typically used for settings with a small number of options.
divider Used as a divider, to breakup the settings page into different parts. None

Examples

An example of a setting containing a small number of possible values.

{  
  "type": "setting",  
  "name": "GLOWING_PINK_SALT",  
  "default": 2,  
  "values": [0, 1, 2, 3],  
  "en_US": {  
    "option": "Glowing Pink Salt",  
    "value.0": "ยงcOFF",  
    "value.1": "Cluster",  
    "value.2": "Cluster & Berserker",  
    "value.3": "Cluster & Berserker & Preserved"  
  }  
}

An example of using the conditions option.

{  
  "type": "setting",  
  "name": "GLOWING_ORE_SILVER_G",  
  "conditions": [  
    {  
      "if": "GLOWING_ORE_MASTER == 2 || SHADER_STYLE == 4 && GLOWING_ORE_MASTER == 1",  
      "then": true  
    }  
  ],  
  "en_US": {  
    "option": "Glowing Silver Ore ยงe[*]ยงr",  
    "comment": "ยงe[*]ยงr This setting will only affect the silver ore added by Galosphere."  
  }  
}

An example of a slider.

{  
  "type": "setting",  
  "name": "FOG_INTENSITY",  
  "default": 0.150,  
  "slider": true,  
  "values": [  
    0.025, 0.050, 0.075, 0.100,  
    0.125, 0.150, 0.175, 0.200,  
    0.225, 0.250, 0.275, 0.300  
  ],  
  "en_US": {  
    "option": "Fog Intensity",  
    "comment": "Determines intensity of the fog."  
  }  
}

An example of a setting that can only be set to either true or false.

{  
  "type": "setting",  
  "name": "GLOWING_POTION_EFFECT",  
  "default": true,  
  "en_US": {  
    "option": "Glowing Potion Effects",  
    "comment": "Enables glowing potion effect particles."  
  }  
}

Settings Files

In Euphoria Patches 1.6, settings files were introduced to decrease the time taken for the shader to recompile after settings are changed. Instead of placing all settings within common.glsl, the settings are instead placed in various files under /lib/shaderSettings, which are included where they are needed.

The list of default settings files is below:

  • activateSettings.glsl
  • bedrockNoise.glsl
  • bloom.glsl
  • blueScreen.glsl
  • clouds.glsl
  • cloudsAndLighting.glsl
  • colorMult.glsl
  • composite.glsl
  • composite2.glsl
  • composite3.glsl
  • composite5.glsl
  • deferred1.glsl
  • emissionMult.glsl
  • emissiveFlowers.glsl
  • endBeams.glsl
  • enderStars.glsl
  • entities.glsl
  • entityMaterials.glsl
  • final.glsl
  • interactiveFoliage.glsl
  • lightAndAmbientColors.glsl
  • longExposure.glsl
  • mainFog.glsl
  • mainLighting.glsl
  • materials.glsl
  • overworldBeams.glsl
  • raindropColor.glsl
  • settingsFileDefines.glsl
  • shockwave.glsl
  • stars.glsl
  • volumetricLight.glsl
  • water.glsl
  • wavingBlocks.glsl
  • worldMotionBlur.glsl

Custom Settings Files

New settings files can be specified using JSON files placed within the euphoria/settings_files folder.

The JSON parameters are as follows. Bolded and italized parameters are required.

  • name - The name of the settings file. Should end in .glsl.
  • files - A list of files the settings should be included in. For example, a settings file containing particle settings should be placed in program/gbuffered_textured.glsl.
โš ๏ธ **GitHub.com Fallback** โš ๏ธ