Making a custom render type with a custom shader requires a number of things to exist at once:
- A ShaderInstance which references your shader json. The RegisterShadersEvent lets you define a ShaderInstance, and has a callback for when the shader is fully loaded from disk.
- A ShaderStateShard with a supplier that returns the ShaderInstance. The supplier exists so that shaders can reload themselves when you change resourcepacks or do a F3+T reload.
- A RenderType which uses the ShaderStateShard as its shader state.
- A shader json, which declares the shader properties and points to the shader programs (vsh and fsh).
- A vertex shader program, which describes how the vertex data is transformed before passing into the rasterizer and being turned into pixels.
- A fragment shader program, which describes how the interpolated values from the vertices get turned into color values before being passed into the output blending stage.
Note: The vanilla logic does not normally allow namespaces in the shader