Schooled Uniforms

Expands on vanilla's Post-Effect system allowing lots of new uniform types for their shaders.

10 downloads 0 followers
 

Schooled Uniforms

      Patreon Link         Website Link         Discord Link  
 

Expanding Vanilla's Post Shaders

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:scoreboard Takes an objective and a name, and will return the value.
  • schooleduniforms:scoreboard_self Takes an objective and will return the client player's value.
  • schooleduniforms:scoreboard_array Takes an objective and an int length and will return an array, using the player names 0, 1, 2, etc to fill the values.

Automatic Uniforms:

These will simply give you access to some values from vanilla rendering.

  • schooleduniforms:camera_pos
  • schooleduniforms:projection
  • schooleduniforms:inv_projection
  • schooleduniforms:view
  • schooleduniforms:inv_view
  • schooleduniforms: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:

  • int
  • ivec3
  • float
  • vec2
  • vec3
  • vec4
  • matrix4x4
    You can also use the following array types, these require a length to be provided.
  • schooleduniforms:int_array
  • schooleduniforms:ivec3_array
  • schooleduniforms:float_array
  • schooleduniforms:vec2_array
  • schooleduniforms:vec3_array
  • schooleduniforms:vec4_array
  • schooleduniforms:matrix4x4_array

​
Bloom Hosting Banner

No gallery available for this project.

Version Minecraft Loader Download

1.0.0

26.3
fabric
Download