Build for Minecraft 26.1 #50
@@ -26,6 +26,10 @@ import net.minecraft.client.renderer.blockentity.AbstractEndPortalRenderer;
|
|||||||
import net.minecraft.client.renderer.blockentity.TheEndPortalRenderer;
|
import net.minecraft.client.renderer.blockentity.TheEndPortalRenderer;
|
||||||
*///?}
|
*///?}
|
||||||
import net.minecraft.resources.Identifier;
|
import net.minecraft.resources.Identifier;
|
||||||
|
//? if >=26.1 {
|
||||||
|
/*import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
*///?}
|
||||||
|
|
||||||
public class ShaderUtils {
|
public class ShaderUtils {
|
||||||
// Render pipelines exist from 1.21.5; before that the layer names a shader program directly.
|
// 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<Identifier, RenderType> UNLIT_CUTOUT = new HashMap<>();
|
||||||
|
*///?}
|
||||||
|
|
||||||
private static RenderType entityAlpha(Identifier texture) {
|
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 {
|
//? 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 {
|
*///?} else if >=1.21.11 {
|
||||||
return RenderTypes.dragonExplosionAlpha(texture);
|
return RenderTypes.dragonExplosionAlpha(texture);
|
||||||
//?} else
|
//?} else
|
||||||
|
|||||||
Reference in New Issue
Block a user