Before 26.1 they use the dragon's alpha pipeline, whose shader only samples the texture. entityCutout, which 26.1 used instead, applies the lightmap and directional shading, so shadows and light from the world showed on them. 26.1 builds the same unlit cutout from the entity shader: the emissive snippet without the lightmap, plus NO_CARDINAL_LIGHTING and NO_OVERLAY. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -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