Respackopts/docs/Shaders.md

1.5 KiB

Usage in fabulous/canvas/frex shaders

Getting started

All you need to do to access respackotps values is paste the following in a file where you want them according to your renderer:

Renderer Include snippet
Canvas #include respackopts:config_supplier
Vanilla/Fabulous //include respackopts:config_supplier (this is done to avoid problems when loading shaders without respackopts)

However, usually you will want to still have a pack that works if respackotps is not present. In that case, canvas will still load the file, however, values that respackotps registers will not be available leading to compile errors. To avoid this, I recommend creating a source file in your own shader which will load default values if respackotps isn't present. You can do that as follows:

#include respackopts:config_supplier

#ifndef respackopts_loaded
// define your default values here
// Example:
// #define examplePack_someTexture
#endif

You will then need to include this file in the places you want to access its values.

Using the values

All values respackotps exposes follow the form: <id>_<entry> or <id>_<category>_<entry> To view the code respackotps generates for your pack, you can run the /rpo dump glsl command in minecraft (You must enable the debugCommands config option for this). This will create a frex.frag file in your .minecraft/respackotps directory containing the generated shader code (available since 2.7.0).