diff --git a/src/main/java/org/saturnclient/impl/cosmetics/utils/ShaderUtils.java b/src/main/java/org/saturnclient/impl/cosmetics/utils/ShaderUtils.java index e6e737c..40bab50 100644 --- a/src/main/java/org/saturnclient/impl/cosmetics/utils/ShaderUtils.java +++ b/src/main/java/org/saturnclient/impl/cosmetics/utils/ShaderUtils.java @@ -26,6 +26,10 @@ import net.minecraft.client.renderer.blockentity.AbstractEndPortalRenderer; import net.minecraft.client.renderer.blockentity.TheEndPortalRenderer; *///?} import net.minecraft.resources.Identifier; +//? if >=26.1 { +/*import java.util.HashMap; +import java.util.Map; +*///?} public class ShaderUtils { // Render pipelines exist from 1.21.5; before that the layer names a shader program directly. @@ -87,10 +91,26 @@ public class ShaderUtils { } } + // Cosmetics are drawn unlit, without the lightmap or the directional shading, as the dragon's + // alpha pipeline drew them before 26.1. 26.1 dropped that pipeline, so this is the entity shader + // with its lighting and overlay turned off. + //? if >=26.1 { + /*public static final RenderPipeline UNLIT_CUTOUT_PIPELINE = RenderPipelines.register( + RenderPipeline.builder(new RenderPipeline.Snippet[] { + RenderPipelines.ENTITY_EMISSIVE_SNIPPET }) + .withLocation(Identifier.fromNamespaceAndPath("saturnclient", "pipeline/unlit_cutout")) + .withShaderDefine("ALPHA_CUTOUT", 0.1f) + .withShaderDefine("NO_CARDINAL_LIGHTING") + .withShaderDefine("NO_OVERLAY") + .withCull(false) + .build()); + private static final Map UNLIT_CUTOUT = new HashMap<>(); + *///?} + private static RenderType entityAlpha(Identifier texture) { - // 26.1 dropped the dragon's alpha pipeline; with opaque vertices it's an alpha cutout. //? if >=26.1 { - /*return RenderTypes.entityCutout(texture); + /*return UNLIT_CUTOUT.computeIfAbsent(texture, id -> RenderType.create("saturn_unlit_cutout", + RenderSetup.builder(UNLIT_CUTOUT_PIPELINE).withTexture("Sampler0", id).createRenderSetup())); *///?} else if >=1.21.11 { return RenderTypes.dragonExplosionAlpha(texture); //?} else