Compatibility
Minecraft: Java Edition
Platforms
Supported environments
Tags
Creators
Details
Expands on Vanilla's Post Shader system by allowing you more ways to pass data to your shaders.
Scoreboard Uniforms:
These give you access to scoreboard values as uniforms.
In order for the values to be synced to players you need to run the command:
/scoreboard objectives uniform <Objective> true
schooleduniforms:scoreboardTakes anobjectiveand aname, and will return the value.schooleduniforms:scoreboard_selfTakes anobjectiveand will return the client player's value.schooleduniforms:scoreboard_arrayTakes anobjectiveand an intlengthand will return an array, using the player names0,1,2, etc to fill the values.
Automatic Uniforms:
These will simply give you access to some values from vanilla rendering.
schooleduniforms:camera_posschooleduniforms:projectionschooleduniforms:inv_projectionschooleduniforms:viewschooleduniforms:inv_viewschooleduniforms:tick_delta
Modded Uniforms:
If used as a dependency this also allows you to write custom uniform values to any normal uniform.
To use this, you need to call HookedUniformManager.registerUniform(<name>, <biconsumer>)
The name is "<namespace>:<post_shader>/<pass_index>/<uniform_name>/<data_index>"
For example: "modname:myshader/0/PostShaderInfo/0"
And the biconsumer will give you a LevelExtractionContext and a Std140Builder, and all you need to do is write the data to the builder. Be sure that you write the same amount of data as the uniform's data type.
This works for any of the following:
intivec3floatvec2vec3vec4matrix4x4
You can also use the following array types, these require alengthto be provided.schooleduniforms:int_arrayschooleduniforms:ivec3_arrayschooleduniforms:float_arrayschooleduniforms:vec2_arrayschooleduniforms:vec3_arrayschooleduniforms:vec4_arrayschooleduniforms:matrix4x4_array


