From 11aa9a8633df62abf3cf29295244171b0839ce1f Mon Sep 17 00:00:00 2001 From: itsmeow Date: Mon, 24 May 2021 03:00:36 -0400 Subject: [PATCH] Improve shader support for eye glow on zotzpyre and hidebehind --- .../client/init/ClientLifecycleHandler.java | 16 ++-------------- .../client/renderer/entity/layer/LayerEyes.java | 3 ++- .../textures/entity/hidebehind_glow.png | Bin 499 -> 501 bytes .../textures/entity/hidebehind_open_glow.png | Bin 577 -> 583 bytes .../textures/entity/zotzpyre_eyes.png | Bin 328 -> 329 bytes 5 files changed, 4 insertions(+), 15 deletions(-) diff --git a/src/main/java/dev/itsmeow/whisperwoods/client/init/ClientLifecycleHandler.java b/src/main/java/dev/itsmeow/whisperwoods/client/init/ClientLifecycleHandler.java index 966bdec..4c6f10f 100644 --- a/src/main/java/dev/itsmeow/whisperwoods/client/init/ClientLifecycleHandler.java +++ b/src/main/java/dev/itsmeow/whisperwoods/client/init/ClientLifecycleHandler.java @@ -44,25 +44,13 @@ public class ClientLifecycleHandler { public static RenderFactory R = IMDLibClient.getRenderRegistry(WhisperwoodsMod.MODID); public static class RenderTypes extends RenderType { - protected static final RenderState.WriteMaskState NO_WRITE = new RenderState.WriteMaskState(false, false); - private static final RenderType TRANSLUCENT_DEPTH_MASK_OFF = makeType("translucent_depth_mask_off", DefaultVertexFormats.BLOCK, 7, 262144, true, true, RenderType.State.getBuilder().shadeModel(SHADE_ENABLED).lightmap(LIGHTMAP_ENABLED).texture(BLOCK_SHEET_MIPPED).transparency(TRANSLUCENT_TRANSPARENCY).target(OUTLINE_TARGET).writeMask(COLOR_WRITE).build(true)); - public RenderTypes() { super(null, null, 0, 0, false, false, null, null); } - public static RenderType getEyesDepthMaskOff(ResourceLocation locationIn) { - RenderState.TextureState renderstate$texturestate = new RenderState.TextureState(locationIn, false, false); - return makeType("eyes_depth_mask_off", DefaultVertexFormats.ENTITY, 7, 256, false, true, RenderType.State.getBuilder().texture(renderstate$texturestate).cull(CULL_DISABLED).transparency(ADDITIVE_TRANSPARENCY).writeMask(COLOR_WRITE).fog(BLACK_FOG).build(false)); - } - public static RenderType getEyesEntityCutoutNoCullDepthMaskOff(ResourceLocation locationIn) { RenderState.TextureState renderstate$texturestate = new RenderState.TextureState(locationIn, false, false); - return makeType("eyes_entity_cutout_no_cull_depth_mask_off", DefaultVertexFormats.ENTITY, 7, 256, false, true, RenderType.State.getBuilder().texture(renderstate$texturestate).cull(CULL_DISABLED).transparency(ADDITIVE_TRANSPARENCY).writeMask(COLOR_WRITE).fog(BLACK_FOG).diffuseLighting(DIFFUSE_LIGHTING_ENABLED).alpha(DEFAULT_ALPHA).lightmap(LIGHTMAP_ENABLED).overlay(OVERLAY_ENABLED).build(false)); - } - - public static RenderType getTranslucentDepthMaskOff() { - return TRANSLUCENT_DEPTH_MASK_OFF; + return makeType("eyes_entity_cutout_no_cull_depth_mask_off", DefaultVertexFormats.ENTITY, 7, 256, false, true, RenderType.State.getBuilder().texture(renderstate$texturestate).cull(CULL_DISABLED).transparency(ADDITIVE_TRANSPARENCY).writeMask(COLOR_WRITE).fog(BLACK_FOG).diffuseLighting(DIFFUSE_LIGHTING_ENABLED).alpha(DEFAULT_ALPHA).lightmap(LIGHTMAP_DISABLED).overlay(OVERLAY_ENABLED).build(false)); } } @@ -84,7 +72,7 @@ public void render(MatrixStack matrixStackIn, IRenderTypeBuffer bufferIn, int pa matrixStackIn.push(); this.getEntityModel().setLivingAnimations(entity, limbSwing, limbSwingAmount, partialTicks); this.getEntityModel().setRotationAngles(entity, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch); - this.getEntityModel().render(matrixStackIn, bufferIn.getBuffer(entity.getOpen() ? RenderTypes.getEyesDepthMaskOff(ModResources.HIDEBEHIND_OPEN_GLOW) : RenderTypes.getEyesDepthMaskOff(ModResources.HIDEBEHIND_GLOW)), 15728640, OverlayTexture.NO_OVERLAY, 1.0F, 1.0F, 1.0F, 1.0F); + this.getEntityModel().render(matrixStackIn, bufferIn.getBuffer(entity.getOpen() ? RenderTypes.getEyesEntityCutoutNoCullDepthMaskOff(ModResources.HIDEBEHIND_OPEN_GLOW) : RenderTypes.getEyesEntityCutoutNoCullDepthMaskOff(ModResources.HIDEBEHIND_GLOW)), 15728640, OverlayTexture.NO_OVERLAY, 1.0F, 1.0F, 1.0F, 1.0F); matrixStackIn.pop(); } } diff --git a/src/main/java/dev/itsmeow/whisperwoods/client/renderer/entity/layer/LayerEyes.java b/src/main/java/dev/itsmeow/whisperwoods/client/renderer/entity/layer/LayerEyes.java index 4cd8a1e..e63bfbd 100644 --- a/src/main/java/dev/itsmeow/whisperwoods/client/renderer/entity/layer/LayerEyes.java +++ b/src/main/java/dev/itsmeow/whisperwoods/client/renderer/entity/layer/LayerEyes.java @@ -1,6 +1,7 @@ package dev.itsmeow.whisperwoods.client.renderer.entity.layer; import com.mojang.blaze3d.matrix.MatrixStack; +import dev.itsmeow.whisperwoods.client.init.ClientLifecycleHandler; import net.minecraft.client.renderer.IRenderTypeBuffer; import net.minecraft.client.renderer.RenderType; import net.minecraft.client.renderer.entity.MobRenderer; @@ -16,7 +17,7 @@ public class LayerEyes> extends La public LayerEyes(MobRenderer baseRenderer, ResourceLocation texture) { super(baseRenderer); - this.GLOW_STATE = RenderType.getEyes(texture); + this.GLOW_STATE = ClientLifecycleHandler.RenderTypes.getEyesEntityCutoutNoCullDepthMaskOff(texture); } @Override diff --git a/src/main/resources/assets/whisperwoods/textures/entity/hidebehind_glow.png b/src/main/resources/assets/whisperwoods/textures/entity/hidebehind_glow.png index 6ea1b07b421d8b47272799e94ea774a9229a086c..677ac24e98fc4b48cfa3ef4e15f285a26d0d6742 100644 GIT binary patch literal 501 zcmeAS@N?(olHy`uVBq!ia0vp^4Is?H1|$#LC7uRSEa{HEjtmSN`?>!lvI6;>1s;*b z3=DkxL735kHCP2GC{f}XQ4*Y=R#Ki=l*&+$n3-3imzP?iV4`QJXZF{R^92I~W3i`; zV@O5Z+mjnP8ypypUbrnky@+x9#wnlQFyHbDvax&8Z<&6?;23kV4MoJio0U1)KdSfq vHIw-NZr3-{`@1ENRV4JVk2oUYOd)efg|FX5Mn)xI6ft!lvI6;>1s;*b z3=Dh+K$tP>S|=w^P@=>&q9iy!t)x7$D3zfgF*C13FE6!3!9>qc&+M-s=L-e~#zIdQ z$B>G+w!lvI6;>1s;*b z3=Dh+K$tP>S|=w^P@=>&q9iy!t)x7$D3zfgF*C13FE6!3!9>qc&+M-s=L-e~#-pAt zjv*CsZ*OhPJ!~Mt5ct0T%|y#h4#!TgX$DF3L<)4gbgufiuA-qJlQ)iznolNjz>e zl*2)Mbonfo5XUC?S(fpb@Ky$%$DPk6WO9bxzrX!J#UinWM4OAhf;+?x{F%&gOn5Ep zkKHWUKXe-oNPUTFTFTl`vC8z#-GB2qk5we}un%z}qUW~$>ZW2%$?X0`z({BCboFyt I=akR{0PfN58~^|S literal 577 zcmeAS@N?(olHy`uVBq!ia0vp^4Is?H1|$#LC7uRSEa{HEjtmSN`?>!lvI6;>1s;*b z3=Dh+L6~vJ#O${~L5ULAh?3y^w370~qEv>0#LT=By}Z;C1rt3(J+r@loG%y{825X+ zIEGZjy}h-O_mF`IL*O^@Y6Es|12*Y^fCUZQ-W+_te&}7wKDXpoyvezTUvmNvOYrx6 zJU|JtBYOMk!rk%y6=uIImKz)P>^5clQ!(db&KI!<+{a>nf9H3I!89ZJ6T-G@yGywq01@Z|1 diff --git a/src/main/resources/assets/whisperwoods/textures/entity/zotzpyre_eyes.png b/src/main/resources/assets/whisperwoods/textures/entity/zotzpyre_eyes.png index 6d82a2edc83c29d6ccb2ca6511872f60d109a8cc..d5f8ac445d0192d323ba68bfed8e1308d5a38c85 100644 GIT binary patch delta 105 zcmX@XbdqU;4c7q%2EGG~S=Tx_C%UOCANO=|45^5FdtxJJgM-L{3%BcK)i-bZktM(5 zmq(YoLUx)`+r*206Aw6Q)t|4ey}5r5Z@NvvF=hy%leTxU+_Ed~!B%$|fWXt$&t;uc GLK6TT$SbS> delta 104 zcmX@fbb@Ju4c9>i2EK!gJ0@noo#>{ne9Y6uF{C2y?TLlF2Mh!b9C)+ePfc6zM+rmo zg;U!~j=auZ)Hd;=-^2rsn$K&$T|NE&VGsMciU$zl&@ATTTF(W1*2o1j0D-5gpUXO@ GgeCy