Download Sodium Core Shader Support — Minecraft Mods — MetaMods

Sodium Core Shader Support

Active

Downloads

0

Last update

2 months ago

Versions

1.20.4 — 1.21.8
Client
Fabric
Neoforge
Game mechanics
Utils

Sodium Core Shader Support

This mod enables resource packs to replace Sodium's core shaders, similar to how resource packs can replace vanilla Minecraft's core shaders. It's important to understand that this doesn't mean automatic compatibility of all vanilla resource packs with Sodium - only those packs that explicitly state support for this mod will work.

For Users

If you're using a compatible resource pack, simply activate it like any regular resource pack. When reloading resources, Sodium may display an incompatibility message, but this can be ignored if the pack specifically supports Sodium Core Shader Support.

Compatible Resource Packs

Here are some resource packs that work with this mod:

  • Energy Shaders [Java]
  • Night Vision Shaders [Java]

For Shader Developers

Sodium uses its own shaders for blocks and clouds, located at:

- assets/sodium/shaders/
   | - clouds.fsh
   | - clouds.vsh
   | - blocks/
        | - block_layer_opaque.fsh
        | - block_layer_opaque.vsh
   | - include/
        | - fog.glsl 
        | - chunk_material.glsl
        | - chunk_matrices.glsl
        | - chunk_vertex.glsl

The block_layer_opaque files are usually the most important. The mod adds special definitions for different rendering types:

  • RENDER_PASS_SOLID: Solid blocks
  • RENDER_PASS_CUTOUT: Blocks like leaves, grass, glass
  • RENDER_PASS_TRANSLUCENT: Blocks with actual transparency (water, honey, slime)

Usage:

#ifdef RENDER_PASS_SOLID
    // special shading for solid objects
#endif

Specifying Compatible Versions

Since Sodium developers may change shaders without notice, it's important to specify compatible versions through a versions.json file in the assets/sodiumcoreshadersupport directory:

{
  "supported-versions": {
    "1.21": [ "0.5.11+mc1.21" ],
    "1.21.1": [ "0.5.11+mc1.21" ]
  }
}

File Imports

Sodium shaders must be located in assets/sodium/shaders, but you can import files from assets/minecraft/shaders using the #import directive:

#import <minecraft:include/test.glsl>

This allows creating shared GLSL files that can be used in both standard shaders and Sodium shaders.

Project members
linusdev

linusdev

Developer

Created: 11 Dec 2023

ID: 4330