From 8a85e21c0d7c5d36230b8136a7d0724ed0c4c3cf Mon Sep 17 00:00:00 2001 From: SammySemicolon <69329424+SammySemicolon@users.noreply.github.com> Date: Mon, 30 Oct 2023 00:21:03 +0100 Subject: [PATCH] More Work on Radiant Particles --- .../renderer/block/VoidConduitRenderer.java | 21 +++++------ .../WeepingWellParticleEffects.java | 33 ++++++++++-------- .../malum/textures/particle/square0.png | Bin 162 -> 123 bytes .../malum/textures/particle/square1.png | Bin 150 -> 120 bytes .../malum/textures/particle/square2.png | Bin 132 -> 105 bytes 5 files changed, 29 insertions(+), 25 deletions(-) diff --git a/src/main/java/com/sammy/malum/client/renderer/block/VoidConduitRenderer.java b/src/main/java/com/sammy/malum/client/renderer/block/VoidConduitRenderer.java index f28e75084..46213bace 100644 --- a/src/main/java/com/sammy/malum/client/renderer/block/VoidConduitRenderer.java +++ b/src/main/java/com/sammy/malum/client/renderer/block/VoidConduitRenderer.java @@ -30,15 +30,16 @@ public void render(VoidConduitBlockEntity blockEntityIn, float partialTicks, Pos } public void renderQuad(VoidConduitBlockEntity voidConduit, PoseStack poseStack, float partialTicks) { - float height = 0.75f; - float width = 1.5f; - VertexConsumer textureConsumer = RenderHandler.DELAYED_RENDER.getBuffer(LodestoneRenderTypeRegistry.TRANSPARENT_TEXTURE.applyAndCache(VIGNETTE)); - Vector3f[] positions = new Vector3f[]{new Vector3f(-width, height, width), new Vector3f(width, height, width), new Vector3f(width, height, -width), new Vector3f(-width, height, -width)}; - VFXBuilders.WorldVFXBuilder builder = VFXBuilders.createWorld().setPosColorTexLightmapDefaultFormat(); - - poseStack.pushPose(); - poseStack.translate(0.5f, 0.001f, 0.5f); - builder.renderQuad(textureConsumer, poseStack, positions, 1f); - poseStack.popPose(); + if (voidConduit.lingeringRadiance == 0) { + float height = 0.75f; + float width = 1.5f; + VertexConsumer textureConsumer = RenderHandler.DELAYED_RENDER.getBuffer(LodestoneRenderTypeRegistry.TRANSPARENT_TEXTURE.applyAndCache(VIGNETTE)); + Vector3f[] positions = new Vector3f[]{new Vector3f(-width, height, width), new Vector3f(width, height, width), new Vector3f(width, height, -width), new Vector3f(-width, height, -width)}; + VFXBuilders.WorldVFXBuilder builder = VFXBuilders.createWorld().setPosColorTexLightmapDefaultFormat(); + poseStack.pushPose(); + poseStack.translate(0.5f, 0.001f, 0.5f); + builder.renderQuad(textureConsumer, poseStack, positions, 1f); + poseStack.popPose(); + } } } \ No newline at end of file diff --git a/src/main/java/com/sammy/malum/visual_effects/WeepingWellParticleEffects.java b/src/main/java/com/sammy/malum/visual_effects/WeepingWellParticleEffects.java index eacd23fe5..62e9fe2f0 100644 --- a/src/main/java/com/sammy/malum/visual_effects/WeepingWellParticleEffects.java +++ b/src/main/java/com/sammy/malum/visual_effects/WeepingWellParticleEffects.java @@ -29,9 +29,9 @@ public class WeepingWellParticleEffects { public static final List RADIANT_COLORS = List.of( - new Color(249, 206, 77), - new Color(145, 42, 247), - new Color(48, 208, 242)); + new Color(179, 35, 218), + new Color(224, 210, 68), + new Color(42, 146, 218)); private static final VoxelShape WELL_SHAPE = Block.box(-16.0D, 11.0D, -16.0D, 32.0D, 13.0D, 32.0D); private static final GenericParticleData SMOKE_TRANSPARENCY = GenericParticleData.create(0, 0.2f, 0f).setEasing(Easing.SINE_IN, Easing.SINE_OUT).build(); @@ -84,25 +84,28 @@ public static void passiveWeepingWellParticles(VoidConduitBlockEntity voidCondui public static void radiantWeepingWellParticles(VoidConduitBlockEntity voidConduit) { Level level = voidConduit.getLevel(); Random rand = level.random; - Color color = RADIANT_COLORS.get(((int) level.getGameTime() % 18) / 6); + Color color = RADIANT_COLORS.get(((int) level.getGameTime() % 27) / 9); final BlockPos blockPos = voidConduit.getBlockPos(); - final ColorParticleData colorData = ColorParticleData.create(color, color.darker()).setCoefficient(0.5f).build(); - - if (level.getGameTime() % 6L == 0) { + final ColorParticleData colorData = ColorParticleData.create(color.brighter(), color).setCoefficient(0.5f).build(); + if (level.getGameTime() % 3L == 0) { + final GenericParticleData scaleData = GenericParticleData.create(0.1f, RandomHelper.randomBetween(rand, 1.7f, 1.8f), 0.5f).setEasing(Easing.SINE_OUT, Easing.SINE_IN).setCoefficient(RandomHelper.randomBetween(rand, 1f, 1.25f)).build(); final Consumer slowDown = p -> p.setParticleMotion(p.getParticleSpeed().scale(0.95f)); - int lifetime = RandomHelper.randomBetween(rand, 100, 120); - float yMotion = RandomHelper.randomBetween(rand, 0.01f, 0.02f); + float yMotion = RandomHelper.randomBetween(rand, 0.04f, 0.06f); Vec3 motion = new Vec3(0f, yMotion, 0f); DirectionalParticleBuilder.create(ParticleRegistry.SQUARE) - .setTransparencyData(GenericParticleData.create(0.2f, 0.5f, 0f).setEasing(Easing.CUBIC_OUT, Easing.EXPO_IN).build()) - .setScaleData(GenericParticleData.create(0.1f, RandomHelper.randomBetween(rand, 1.85f, 2f)).setEasing(Easing.SINE_OUT).setCoefficient(RandomHelper.randomBetween(rand, 1f, 1.5f)).build()) + .setTransparencyData(GenericParticleData.create(0.9f, 0.05f, 0f).setEasing(Easing.CUBIC_OUT, Easing.EXPO_IN).build()) + .setScaleData(scaleData) .setColorData(colorData) - .setLifetime(lifetime) + .setLifetime(100) .setMotion(motion) .setDirection(motion.normalize()) .enableNoClip() + .setSpritePicker(SimpleParticleOptions.ParticleSpritePicker.RANDOM_SPRITE) .addActor(slowDown) - .spawn(level, blockPos.getX() + 0.5f, blockPos.getY() + 0.75f, blockPos.getZ() + 0.5f); + .spawn(level, blockPos.getX() + 0.5f, blockPos.getY() + 0.75f, blockPos.getZ() + 0.5f) + .setTransparencyData(GenericParticleData.create(0.1f, 0.6f, 0f).setEasing(Easing.CUBIC_OUT, Easing.EXPO_OUT).build()) + .setRenderType(LodestoneWorldParticleRenderType.LUMITRANSPARENT) + .spawn(level, blockPos.getX() + 0.5f, blockPos.getY() + 0.65f, blockPos.getZ() + 0.5f); } final float acceleration = RandomHelper.randomBetween(rand, 0.002f, 0.02f); @@ -112,8 +115,8 @@ public static void radiantWeepingWellParticles(VoidConduitBlockEntity voidCondui p.setParticleMotion(p.getParticleSpeed().add(0, acceleration, 0)); } }; - if (level.getGameTime() % 2 == 0) { - int rotation = (int) (level.getGameTime() / 2f % 16); + if (level.getGameTime() % 2L == 0) { + int rotation = (int) ((level.getGameTime() / 2f) % 16); Vec3 offsetPosition = DataHelper.rotatingRadialOffset(new Vec3(blockPos.getX() + 0.5f, blockPos.getY() + 0.75f, blockPos.getZ() + 0.5f), 1.1f, rotation, 16, voidConduit.getLevel().getGameTime(), 640); var lightSpecs = weepingWellSpecs(level, offsetPosition, colorData, LodestoneWorldParticleRenderType.ADDITIVE); lightSpecs.getBuilder().addActor(behavior); diff --git a/src/main/resources/assets/malum/textures/particle/square0.png b/src/main/resources/assets/malum/textures/particle/square0.png index 1ad3cf98422e7704c363840676086940fb1406f2..9f897c2c7b27fc8e5ca1ff6fd20e2987b97089f0 100644 GIT binary patch delta 93 zcmV-j0HXh*0eg@nS3yZcK~y+TV`N}p_|HHAV5FJ>|NoQb5JpCj-3$zH7f{Urn8~<; z1!fUW7mOOfz%UHLfY@w7{ggckbL_P*zqZ$}M;A-epixQ30!k zyWszSRG)wpAp>;785u!Zu^0f8z~vN}MYJ&h*>AX901GRuE*J&|fTIN(Jp&U9$hMN4 mkSI>dL}dajiYU&F0Nv7L0gD{Y9{>OV07*qoM6N<$f&c*CRx#fI diff --git a/src/main/resources/assets/malum/textures/particle/square1.png b/src/main/resources/assets/malum/textures/particle/square1.png index 941f6dbd83f4521a6f288919a185e8aaf65cb689..723e36ae49b0713baa7133d6ca2b8ca6329cad40 100644 GIT binary patch delta 90 zcmbQnSTR8*#MaZrF~q_@IVBxrxt)5SfuN=Di;q*X;QmI>GuFaUw4tDnm{r-UX31^}+Z9oGN= delta 120 zcmV-;0Ehp0mI06?a$QM8K~y+T<&(h)06_=?lUlU@inJCF4}2`_f{VYqJVi!HlmG$) zF#%=<5xK&+J5&`fAY#8nHlzopr7#INFB^d1h delta 102 zcmV-s0Ga=3gaMEwU`a_tK~y+T?UOMM05AvwV`0V010ECABvI0000