Satin Api Mod
Satin API Mod (1.19.4, 1.19.2) is a simple library allowing modders to add interesting graphical effects to their mods. Its main feature is to significantly simplify the use of Minecraft’s data-driven shader system (that is, the one used by super secret settings, mob vision, and spectral arrows). It is a lightweight library for OpenGL shader usage.
Changes to Vanilla
- Simply having Satin installed alters the game in a few ways, mainly related to ShaderEffects.
- Uniform fix: Using a vector of integers as a uniform crashes the game in Vanilla because of a bad copy paste. Satin redirects a call to upload the right buffer.
Shader locations: Satin patches shader processors to accept a resource domain in the specification of a program name and of a fragment/vertex shader file.
Readable depth: Satin offered access to a Framebuffer’s depth texture before it was cool (superseded in 1.16).
- Satin does not set the shader in GameRenderer, except if a mod registers a PickEntityShaderCallback.
- Satin’s main feature is the Shader Effect management facility.
- ShaderEffect is a Minecraft class implementing data driven post processing shaders, with a few caveats. First, those shader effects are initialized immediately at construction, but they must be initialized after the game has finished loading to avoid gl errors. Then, they must be updated each time the game’s resolution changes. Finally, they do not have any way of setting uniforms from external code.
- Satin can manage a shader effect for you, giving you a ManagedShaderEffect object. This shader effect is lazily initialized – although it can be initialized manually at any time. Initialized shader effects will be automatically reloaded each time the game’s resolution changes, and during resource reloading. It also provides a number of access methods to set uniforms dynamically.
- The ManagedFramebuffer and ManagedShaderProgram classes have methods to obtain clones of existing RenderLayer objects, with a custom Target. This target causes draw calls to happen on the ManagedFramebuffer for the former, or using the shader program for the latter. This can be notably used to render custom effects on entities and block entities.
- Regular blocks do not support custom render layers. For advanced shader materials, you should consider using an alternative renderer like Canvas.
- Satin has a few utility classes and methods to facilitate working with shaders, not limited to ShaderEffect. ShaderLoader provides a way to load, create and link OpenGL shader programs through a single method call, GlPrograms offer helper methods that operate on those programs, and the matrix package helps with matrix retrieval and manipulation.
How to install:
Don’t miss out today’s latest Minecraft Mods