Skip to content

Preliminary

Since 2.0.0

Custom Shader Material lets you fully control how rendering is performed.
Photon2 allows you to write materials using Minecraft Core Shaders.

Warning

This wiki is not a shader programming tutorial and will not teach Minecraft shader basics.
Please refer to the linked resources below for shader knowledge.


Photon2 and Ldlib2 extend Vanilla Minecraft Shader via ExtendedShader.
This extension adds:

  • Geometry shader (attach) support
  • Extra samplers and uniforms

For details, see the ExtendedShader page.


Shader Material Inspector

How to Use

  • Click Select Shader to choose your shader JSON.
  • Or specify the shader by its resource location.
  • After modifying your shader, click Reload Shader to recompile and reload.

Shader Path Requirement

Minecraft requires all shader files (GLSL + JSON) to be placed in:

assets/<namespace>/shaders/core/


Shader Settings

The Shader Settings panel displays all custom (non-built-in) samplers and uniforms.
You can edit them directly via the Inspector.


Sampler Curve / Sampler Gradient

Curve & Gradient

Photon2 lets you pass a Curve or Gradient to the shader.
They are encoded into a 128×128 sampler so you can sample them in the shader to get values.

For details, see ExtendedShader.