Shaders - MehVahdJukaar/polytone GitHub Wiki
Custom Post Shaders
This feature is 1.21.11+
This feature is a work in progress, more will come in the future.
Example image of a custom screen space godray shader added in the Sample Pack as an example. You can also try this texture pack I made here.
This feature lets you add custom post shaders to the game.
To do so you'll need 3 files:
- polytone post shader file in
[pack namespace]/polytone/post_shaders - post chain vanilla file in
[pack namespace]/post_effect - additional shadaer files in
[pack namespace]/shaders/post
The polytone file is super simple and can look like this
{
"post_chain": "minecraft:creeper",
"activation_condition": "g.dimensionType() == "minecraft:overworld"
}
this will simply apply the existing creeper post chain to the game. Activation Condition field is optional.
Multiple post chains can be applied by different packs so be sure to make use of polytone configs and polytone priority fields that are explained on the main page to make sure the order in which they render is what you want.
Refer to the mc wiki for info on how to construct those 2.
Extra Shader Uniforms
Polytone adds new uniforms to your post shaders. These work on ANY post shaders and can be aded as follows by adding the following block to your shader file.
Once added you can then use those parameters. They are very useful to construct extra effects using matrices that are usually only available in core shaders. For example you can use the World projection matrix, PolyProjMat
layout (std140) uniform PolyGlobals {
mat4 PolyProjMat;
mat4 PolyModelViewMat;
float PolySunAngle;
};