Wiki 9Minecraft Wiki 9Minecraft
Veil Lib Wiki › Guides › Create a Custom Shader Effect Using the Post-Processing Pipeline

Create a Custom Shader Effect Using the Post-Processing Pipeline

Set Up Your Shader Files

Veil Lib's post-processing pipeline lets you inject custom visual effects into the game without replacing core shaders. Start by creating your shader files in your mod's assets folder, organized by type (vertex, fragment, geometry). Use standard OpenGL syntax—Veil Lib supports all common shader types.

Configure Texture Binding

Define which textures your shader needs to access. The pipeline handles binding automatically when you specify texture slots in your configuration. Reference the game's built-in textures (like depth or normal maps) or bind custom framebuffer outputs from earlier passes.

Register Your Post-Processing Pass

Use Veil Lib's JSON-driven framebuffer system to declare your pass. Specify input and output framebuffers, which shader to use, and the order it runs relative to other effects. The straightforward texture binding system means you don't manually manage OpenGL state—declare what you need and the library handles it.

Test and Iterate

Load your mod and verify the effect applies correctly. Adjust shader uniforms and texture coordinates as needed. Veil Lib's pipeline lets you chain multiple passes together, so you can build complex effects by combining simpler ones.