From 3d54a04dd602af1dce87d03287f721e0b15963e0 Mon Sep 17 00:00:00 2001 From: Asek3 <64613894+Asek3@users.noreply.github.com> Date: Sat, 13 Apr 2024 13:04:26 +0300 Subject: [PATCH] a little bit more work --- .../iris/mixin/LevelRendererAccessor.java | 22 ++++++----- .../iris/mixin/MixinEntityRenderer.java | 9 +++++ .../iris/mixin/MixinLevelRenderer.java | 7 ---- .../bettermipmaps/MixinMipmapGenerator.java | 9 ++--- .../iris/mixin/shadows/ChunkInfoAccessor.java | 11 +++--- .../MixinPreventRebuildNearInShadowPass.java | 38 +++++++++---------- .../sky/MixinLevelRenderer_SunMoonToggle.java | 24 ++++-------- .../iris/pipeline/ShadowRenderer.java | 34 +++++++++-------- .../iris/pipeline/WorldRenderingPipeline.java | 1 - .../iris/shaderpack/option/BaseOption.java | 15 ++++---- .../option/MergedBooleanOption.java | 4 +- .../shaderpack/option/MergedStringOption.java | 4 +- .../iris/shaderpack/option/ProfileSet.java | 4 +- .../iris/shaderpack/option/StringOption.java | 10 ++--- 14 files changed, 92 insertions(+), 100 deletions(-) diff --git a/src/main/java/net/coderbot/iris/mixin/LevelRendererAccessor.java b/src/main/java/net/coderbot/iris/mixin/LevelRendererAccessor.java index c78e103624..661cc5adce 100644 --- a/src/main/java/net/coderbot/iris/mixin/LevelRendererAccessor.java +++ b/src/main/java/net/coderbot/iris/mixin/LevelRendererAccessor.java @@ -1,5 +1,10 @@ package net.coderbot.iris.mixin; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.client.renderer.RenderGlobal; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.Entity; +import net.minecraft.util.BlockRenderLayer; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.gen.Accessor; import org.spongepowered.asm.mixin.gen.Invoker; @@ -17,16 +22,13 @@ import net.minecraft.client.renderer.entity.EntityRenderDispatcher; import net.minecraft.world.entity.Entity; -@Mixin(LevelRenderer.class) +@Mixin(RenderGlobal.class) public interface LevelRendererAccessor { - @Accessor("entityRenderDispatcher") - EntityRenderDispatcher getEntityRenderDispatcher(); + @Accessor("renderManager") + RenderManager getEntityRenderDispatcher(); - @Accessor("renderChunks") - ObjectList getRenderChunks(); - - @Invoker("renderChunkLayer") - void invokeRenderChunkLayer(RenderType terrainLayer, PoseStack modelView, double cameraX, double cameraY, double cameraZ); + @Invoker("renderBlockLayer") + void invokeRenderChunkLayer(BlockRenderLayer blockLayerIn, double partialTicks, int pass, Entity entityIn); @Invoker("setupRender") void invokeSetupRender(Camera camera, Frustum frustum, boolean hasForcedFrustum, int frame, boolean spectator); @@ -34,8 +36,8 @@ public interface LevelRendererAccessor { @Invoker("renderEntity") void invokeRenderEntity(Entity entity, double cameraX, double cameraY, double cameraZ, float tickDelta, PoseStack poseStack, MultiBufferSource bufferSource); - @Accessor("level") - ClientLevel getLevel(); + @Accessor("world") + WorldClient getLevel(); @Accessor("frameId") int getFrameId(); diff --git a/src/main/java/net/coderbot/iris/mixin/MixinEntityRenderer.java b/src/main/java/net/coderbot/iris/mixin/MixinEntityRenderer.java index c7fba78b61..583f678b13 100644 --- a/src/main/java/net/coderbot/iris/mixin/MixinEntityRenderer.java +++ b/src/main/java/net/coderbot/iris/mixin/MixinEntityRenderer.java @@ -1,5 +1,6 @@ package net.coderbot.iris.mixin; +import com.llamalad7.mixinextras.sugar.Local; import nanolive.utils.RenderGlobalExtended; import net.coderbot.iris.Iris; import net.coderbot.iris.gl.program.Program; @@ -9,6 +10,7 @@ import net.coderbot.iris.uniforms.SystemTimeUniforms; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.EntityRenderer; +import net.minecraft.client.renderer.culling.ICamera; import net.minecraft.client.settings.GameSettings; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; @@ -60,6 +62,13 @@ public class MixinEntityRenderer { Program.unbind(); } + // Setup shadow terrain & render shadows before the main terrain setup. We need to do things in this order to + // avoid breaking other mods such as Light Overlay: https://github.com/IrisShaders/Iris/issues/1356 + @Inject(method = "renderWorldPass", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/RenderGlobal;setupTerrain(Lnet/minecraft/entity/Entity;DLnet/minecraft/client/renderer/culling/ICamera;IZ)V")) + private void iris$renderTerrainShadows(int pass, float partialTicks, long finishTimeNano, CallbackInfo ci, @Local ICamera icamera) { + ((RenderGlobalExtended) this.mc.renderGlobal).getPipeline().renderShadows((LevelRendererAccessor) this, icamera); + } + @Redirect(method = "renderWorldPass", at = @At(value = "FIELD", target = "Lnet/minecraft/client/settings/GameSettings;renderDistanceChunks:I"), slice = @Slice(from = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/culling/ICamera;setPosition(DDD)V"))) private int iris$alwaysRenderSky(GameSettings instance) { diff --git a/src/main/java/net/coderbot/iris/mixin/MixinLevelRenderer.java b/src/main/java/net/coderbot/iris/mixin/MixinLevelRenderer.java index 4173ec1dfd..1223273f2f 100644 --- a/src/main/java/net/coderbot/iris/mixin/MixinLevelRenderer.java +++ b/src/main/java/net/coderbot/iris/mixin/MixinLevelRenderer.java @@ -44,13 +44,6 @@ public class MixinLevelRenderer implements RenderGlobalExtended { @Unique private WorldRenderingPipeline pipeline; - // Setup shadow terrain & render shadows before the main terrain setup. We need to do things in this order to - // avoid breaking other mods such as Light Overlay: https://github.com/IrisShaders/Iris/issues/1356 - @Inject(method = "renderLevel", at = @At(value = "INVOKE", target = "net/minecraft/client/renderer/LevelRenderer.setupRender (Lnet/minecraft/client/Camera;Lnet/minecraft/client/renderer/culling/Frustum;ZIZ)V")) - private void iris$renderTerrainShadows(PoseStack poseStack, float tickDelta, long limitTime, boolean renderBlockOutline, Camera camera, GameRenderer gameRenderer, LightTexture lightTexture, Matrix4f projection, CallbackInfo callback) { - pipeline.renderShadows((LevelRendererAccessor) this, camera); - } - /*@Inject(method = "renderLevel", at = @At(value = "INVOKE", target = RENDER_SKY)) private void iris$beginSky(PoseStack poseStack, float tickDelta, long limitTime, boolean renderBlockOutline, Camera camera, GameRenderer gameRenderer, LightTexture lightTexture, Matrix4f projection, CallbackInfo callback) { // Use CUSTOM_SKY until levelFogColor is called as a heuristic to catch FabricSkyboxes. diff --git a/src/main/java/net/coderbot/iris/mixin/bettermipmaps/MixinMipmapGenerator.java b/src/main/java/net/coderbot/iris/mixin/bettermipmaps/MixinMipmapGenerator.java index b080707790..77d27b875a 100644 --- a/src/main/java/net/coderbot/iris/mixin/bettermipmaps/MixinMipmapGenerator.java +++ b/src/main/java/net/coderbot/iris/mixin/bettermipmaps/MixinMipmapGenerator.java @@ -1,13 +1,12 @@ package net.coderbot.iris.mixin.bettermipmaps; -import com.mojang.blaze3d.platform.NativeImage; +import nanolive.compat.NativeImage; import net.coderbot.iris.helpers.ColorSRGB; +import net.minecraft.client.renderer.texture.TextureUtil; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Overwrite; import org.spongepowered.asm.mixin.Unique; -import net.minecraft.client.renderer.texture.MipmapGenerator; - /** * Implements a significantly enhanced mipmap downsampling filter. * @@ -25,7 +24,7 @@ * artifacts. * */ -@Mixin(MipmapGenerator.class) +@Mixin(TextureUtil.class) public class MixinMipmapGenerator { /** @@ -33,7 +32,7 @@ public class MixinMipmapGenerator { * @reason replace the vanilla blending function with our improved function */ @Overwrite - private static int alphaBlend(int one, int two, int three, int four, boolean checkAlpha) { + private static int blendColors(int one, int two, int three, int four, boolean checkAlpha) { // First blend horizontally, then blend vertically. // // This works well for the case where our change is the most impactful (grass side overlays) diff --git a/src/main/java/net/coderbot/iris/mixin/shadows/ChunkInfoAccessor.java b/src/main/java/net/coderbot/iris/mixin/shadows/ChunkInfoAccessor.java index 40d153d67a..b49bd285b7 100644 --- a/src/main/java/net/coderbot/iris/mixin/shadows/ChunkInfoAccessor.java +++ b/src/main/java/net/coderbot/iris/mixin/shadows/ChunkInfoAccessor.java @@ -1,13 +1,12 @@ package net.coderbot.iris.mixin.shadows; +import net.minecraft.client.renderer.RenderGlobal; +import net.minecraft.client.renderer.chunk.RenderChunk; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.gen.Accessor; -import net.minecraft.client.renderer.LevelRenderer; -import net.minecraft.client.renderer.chunk.ChunkRenderDispatcher; - -@Mixin(LevelRenderer.RenderChunkInfo.class) +@Mixin(RenderGlobal.ContainerLocalRenderInformation.class) public interface ChunkInfoAccessor { - @Accessor("chunk") - ChunkRenderDispatcher.RenderChunk getChunk(); + @Accessor("renderChunk") + RenderChunk getChunk(); } diff --git a/src/main/java/net/coderbot/iris/mixin/shadows/MixinPreventRebuildNearInShadowPass.java b/src/main/java/net/coderbot/iris/mixin/shadows/MixinPreventRebuildNearInShadowPass.java index 9371c6ce87..00666d0a11 100644 --- a/src/main/java/net/coderbot/iris/mixin/shadows/MixinPreventRebuildNearInShadowPass.java +++ b/src/main/java/net/coderbot/iris/mixin/shadows/MixinPreventRebuildNearInShadowPass.java @@ -1,6 +1,10 @@ package net.coderbot.iris.mixin.shadows; -import org.spongepowered.asm.mixin.Final; +import net.coderbot.iris.pipeline.ShadowRenderer; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderGlobal; +import net.minecraft.client.renderer.culling.ICamera; +import net.minecraft.entity.Entity; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; @@ -8,12 +12,7 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import it.unimi.dsi.fastutil.objects.ObjectList; -import net.coderbot.iris.pipeline.ShadowRenderer; -import net.minecraft.client.Camera; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.LevelRenderer; -import net.minecraft.client.renderer.culling.Frustum; +import java.util.List; /** * Prevent nearby chunks from being rebuilt on the main thread in the shadow pass. Aside from causing FPS to tank, @@ -26,38 +25,35 @@ * if we apply with the same priority, then we'll just get a Mixin error due to the injects conflicting with the * {@code @Overwrite}. Using {@code @Group} allows us to avoid a fragile Mixin plugin. */ -@Mixin(value = LevelRenderer.class, priority = 1010) +@Mixin(value = RenderGlobal.class, priority = 1010) public class MixinPreventRebuildNearInShadowPass { @Shadow - @Final - private ObjectList renderChunks; + private List renderInfos; @Group(name = "iris_MixinPreventRebuildNearInShadowPass", min = 1, max = 1) - @Inject(method = "setupRender", + @Inject(method = "setupTerrain", at = @At(value = "INVOKE_STRING", - target = "Lnet/minecraft/util/profiling/ProfilerFiller;popPush(Ljava/lang/String;)V", + target = "Lnet/minecraft/profiler/Profiler;endStartSection(Ljava/lang/String;)V", args = "ldc=rebuildNear"), cancellable = true, require = 0) - private void iris$preventRebuildNearInShadowPass(Camera camera, Frustum frustum, boolean hasForcedFrustum, - int frame, boolean spectator, CallbackInfo callback) { + private void iris$preventRebuildNearInShadowPass(Entity viewEntity, double partialTicks, ICamera camera, int frameCount, boolean playerSpectator, CallbackInfo ci) { if (ShadowRenderer.ACTIVE) { - for (LevelRenderer.RenderChunkInfo chunk : this.renderChunks) { - ShadowRenderer.visibleBlockEntities.addAll(((ChunkInfoAccessor) chunk).getChunk().getCompiledChunk().getRenderableBlockEntities()); + for (RenderGlobal.ContainerLocalRenderInformation chunk : this.renderInfos) { + ShadowRenderer.visibleBlockEntities.addAll(((ChunkInfoAccessor) chunk).getChunk().getCompiledChunk().getTileEntities()); } - Minecraft.getInstance().getProfiler().pop(); - callback.cancel(); + Minecraft.getMinecraft().profiler.endSection(); + ci.cancel(); } } @Group(name = "iris_MixinPreventRebuildNearInShadowPass", min = 1, max = 1) - @Inject(method = "setupRender", + @Inject(method = "setupTerrain", at = @At(value = "INVOKE", target = "me/jellysquid/mods/sodium/client/gl/device/RenderDevice.enterManagedCode ()V", remap = false), require = 0) - private void iris$cannotInject(Camera camera, Frustum frustum, boolean hasForcedFrustum, int frame, - boolean spectator, CallbackInfo callback) { + private void iris$cannotInject(Entity viewEntity, double partialTicks, ICamera camera, int frameCount, boolean playerSpectator, CallbackInfo ci) { // Dummy injection just to assert that either Sodium is present, or the vanilla injection passed. } } diff --git a/src/main/java/net/coderbot/iris/mixin/sky/MixinLevelRenderer_SunMoonToggle.java b/src/main/java/net/coderbot/iris/mixin/sky/MixinLevelRenderer_SunMoonToggle.java index 9af8f80b09..95aeeec90f 100644 --- a/src/main/java/net/coderbot/iris/mixin/sky/MixinLevelRenderer_SunMoonToggle.java +++ b/src/main/java/net/coderbot/iris/mixin/sky/MixinLevelRenderer_SunMoonToggle.java @@ -1,11 +1,12 @@ package net.coderbot.iris.mixin.sky; +import net.coderbot.iris.Iris; +import net.coderbot.iris.pipeline.WorldRenderingPipeline; import net.minecraft.client.renderer.BufferBuilder; import net.minecraft.client.renderer.RenderGlobal; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL11C; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Unique; import org.spongepowered.asm.mixin.injection.At; @@ -13,15 +14,6 @@ import org.spongepowered.asm.mixin.injection.Slice; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import com.mojang.blaze3d.vertex.BufferBuilder; -import com.mojang.blaze3d.vertex.DefaultVertexFormat; -import com.mojang.blaze3d.vertex.PoseStack; -import com.mojang.blaze3d.vertex.Tesselator; - -import net.coderbot.iris.Iris; -import net.coderbot.iris.pipeline.WorldRenderingPipeline; -import net.minecraft.client.renderer.LevelRenderer; - /** * Allows pipelines to disable the sun, moon, or both. */ @@ -42,10 +34,10 @@ public class MixinLevelRenderer_SunMoonToggle { } @Inject(method = "renderSky(FI)V", - at = @At(value = "INVOKE", target = "com/mojang/blaze3d/vertex/BufferUploader.end (Lcom/mojang/blaze3d/vertex/BufferBuilder;)V"), + at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/Tessellator;draw()V"), slice = @Slice( - from = @At(value = "FIELD", target = "net/minecraft/client/renderer/LevelRenderer.SUN_LOCATION : Lnet/minecraft/resources/ResourceLocation;"), - to = @At(value = "FIELD", target = "net/minecraft/client/renderer/LevelRenderer.MOON_LOCATION : Lnet/minecraft/resources/ResourceLocation;")), + from = @At(value = "FIELD", target = "Lnet/minecraft/client/renderer/RenderGlobal;SUN_TEXTURES:Lnet/minecraft/util/ResourceLocation;"), + to = @At(value = "FIELD", target = "Lnet/minecraft/client/renderer/RenderGlobal;MOON_PHASES_TEXTURES:Lnet/minecraft/util/ResourceLocation;")), allow = 1) private void iris$beforeDrawSun(float partialTicks, int pass, CallbackInfo ci) { if (!Iris.getPipelineManager().getPipeline().map(WorldRenderingPipeline::shouldRenderSun).orElse(true)) { @@ -54,10 +46,10 @@ public class MixinLevelRenderer_SunMoonToggle { } @Inject(method = "renderSky(FI)V", - at = @At(value = "INVOKE", target = "com/mojang/blaze3d/vertex/BufferUploader.end (Lcom/mojang/blaze3d/vertex/BufferBuilder;)V"), + at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/Tessellator;draw()V"), slice = @Slice( - from = @At(value = "FIELD", target = "net/minecraft/client/renderer/LevelRenderer.MOON_LOCATION : Lnet/minecraft/resources/ResourceLocation;"), - to = @At(value = "INVOKE", target = "net/minecraft/client/multiplayer/ClientLevel.getStarBrightness (F)F")), + from = @At(value = "FIELD", target = "Lnet/minecraft/client/renderer/RenderGlobal;MOON_PHASES_TEXTURES:Lnet/minecraft/util/ResourceLocation;"), + to = @At(value = "INVOKE", target = "Lnet/minecraft/client/multiplayer/WorldClient;getStarBrightness(F)F")), allow = 1) private void iris$beforeDrawMoon(float partialTicks, int pass, CallbackInfo ci) { if (!Iris.getPipelineManager().getPipeline().map(WorldRenderingPipeline::shouldRenderMoon).orElse(true)) { diff --git a/src/main/java/net/coderbot/iris/pipeline/ShadowRenderer.java b/src/main/java/net/coderbot/iris/pipeline/ShadowRenderer.java index 0e0073dc9c..a72133d05d 100644 --- a/src/main/java/net/coderbot/iris/pipeline/ShadowRenderer.java +++ b/src/main/java/net/coderbot/iris/pipeline/ShadowRenderer.java @@ -7,11 +7,15 @@ import net.minecraft.client.multiplayer.WorldClient; import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.RenderGlobal; import net.minecraft.client.renderer.culling.ICamera; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.profiler.Profiler; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.BlockRenderLayer; import net.minecraft.util.math.BlockPos; import org.lwjgl.opengl.*; import org.lwjgl.opengl.GL20C; @@ -356,7 +360,7 @@ private void copyPreTranslucentDepth() { } private void renderEntities(LevelRendererAccessor levelRenderer, Frustum frustum, MultiBufferSource.BufferSource bufferSource, PoseStack modelView, double cameraX, double cameraY, double cameraZ, float tickDelta) { - EntityRenderDispatcher dispatcher = levelRenderer.getEntityRenderDispatcher(); + RenderManager dispatcher = levelRenderer.getEntityRenderDispatcher(); int shadowEntities = 0; @@ -365,7 +369,7 @@ private void renderEntities(LevelRendererAccessor levelRenderer, Frustum frustum List renderedEntities = new ArrayList<>(32); // TODO: I'm sure that this can be improved / optimized. - for (Entity entity : getLevel().entitiesForRendering()) { + for (Entity entity : getLevel().loadedEntityList) { if (!dispatcher.shouldRender(entity, frustum, cameraX, cameraY, cameraZ) || (entity instanceof EntityPlayer && ((EntityPlayer) entity).isSpectator())) { continue; } @@ -392,7 +396,7 @@ private void renderEntities(LevelRendererAccessor levelRenderer, Frustum frustum } private void renderPlayerEntity(LevelRendererAccessor levelRenderer, Frustum frustum, MultiBufferSource.BufferSource bufferSource, PoseStack modelView, double cameraX, double cameraY, double cameraZ, float tickDelta) { - EntityRenderDispatcher dispatcher = levelRenderer.getEntityRenderDispatcher(); + RenderManager dispatcher = levelRenderer.getEntityRenderDispatcher(); profiler.startSection("cull"); @@ -413,8 +417,8 @@ private void renderPlayerEntity(LevelRendererAccessor levelRenderer, Frustum fru } } - if (player.getVehicle() != null) { - levelRenderer.invokeRenderEntity(player.getVehicle(), cameraX, cameraY, cameraZ, tickDelta, modelView, bufferSource); + if (player.getRidingEntity() != null) { + levelRenderer.invokeRenderEntity(player.getRidingEntity(), cameraX, cameraY, cameraZ, tickDelta, modelView, bufferSource); shadowEntities++; } @@ -444,10 +448,10 @@ private void renderBlockEntities(MultiBufferSource.BufferSource bufferSource, Po continue; } } - modelView.pushPose(); - modelView.translate(pos.getX() - cameraX, pos.getY() - cameraY, pos.getZ() - cameraZ); - BlockEntityRenderDispatcher.instance.render(entity, tickDelta, modelView, bufferSource); - modelView.popPose(); + //modelView.pushPose(); + //modelView.translate(pos.getX() - cameraX, pos.getY() - cameraY, pos.getZ() - cameraZ); + TileEntityRendererDispatcher.instance.render(entity, pos.getX() - cameraX, pos.getY() - cameraY, pos.getZ() - cameraZ, tickDelta, bufferSource); + //modelView.popPose(); shadowBlockEntities++; } @@ -525,7 +529,7 @@ public void renderShadows(LevelRendererAccessor levelRenderer, ICamera playerCam // We have to ensure that we don't regenerate clouds every frame, since that's what needsUpdate ends up doing. // This took up to 10% of the frame time before we applied this fix! That's really bad! boolean regenerateClouds = levelRenderer.shouldRegenerateClouds(); - ((LevelRenderer) levelRenderer).needsUpdate(); + ((RenderGlobal) levelRenderer).setDisplayListEntitiesDirty(); levelRenderer.setShouldRegenerateClouds(regenerateClouds); // Execute the vanilla terrain setup / culling routines using our shadow frustum. @@ -544,9 +548,9 @@ public void renderShadows(LevelRendererAccessor levelRenderer, ICamera playerCam // Render all opaque terrain unless pack requests not to if (shouldRenderTerrain) { - levelRenderer.invokeRenderChunkLayer(RenderType.solid(), modelView, cameraX, cameraY, cameraZ); - levelRenderer.invokeRenderChunkLayer(RenderType.cutout(), modelView, cameraX, cameraY, cameraZ); - levelRenderer.invokeRenderChunkLayer(RenderType.cutoutMipped(), modelView, cameraX, cameraY, cameraZ); + levelRenderer.invokeRenderChunkLayer(BlockRenderLayer.SOLID, modelView, cameraX, cameraY, cameraZ); + levelRenderer.invokeRenderChunkLayer(BlockRenderLayer.CUTOUT, modelView, cameraX, cameraY, cameraZ); + levelRenderer.invokeRenderChunkLayer(BlockRenderLayer.CUTOUT_MIPPED, modelView, cameraX, cameraY, cameraZ); } profiler.endStartSection("entities"); @@ -608,7 +612,7 @@ public void renderShadows(LevelRendererAccessor levelRenderer, ICamera playerCam // It doesn't matter a ton, since this just means that they won't be sorted in the normal rendering pass. // Just something to watch out for, however... if (shouldRenderTranslucent) { - levelRenderer.invokeRenderChunkLayer(RenderType.translucent(), modelView, cameraX, cameraY, cameraZ); + levelRenderer.invokeRenderChunkLayer(BlockRenderLayer.TRANSLUCENT, modelView, cameraX, cameraY, cameraZ); } // Note: Apparently tripwire isn't rendered in the shadow pass. @@ -618,7 +622,7 @@ public void renderShadows(LevelRendererAccessor levelRenderer, ICamera playerCam renderBuffersExt.endLevelRendering(); } - debugStringTerrain = ((LevelRenderer) levelRenderer).getChunkStatistics(); + debugStringTerrain = ((RenderGlobal) levelRenderer).getDebugInfoRenders(); profiler.endStartSection("generate mipmaps"); diff --git a/src/main/java/net/coderbot/iris/pipeline/WorldRenderingPipeline.java b/src/main/java/net/coderbot/iris/pipeline/WorldRenderingPipeline.java index d632cdc76d..500a389e76 100644 --- a/src/main/java/net/coderbot/iris/pipeline/WorldRenderingPipeline.java +++ b/src/main/java/net/coderbot/iris/pipeline/WorldRenderingPipeline.java @@ -9,7 +9,6 @@ import net.coderbot.iris.mixin.LevelRendererAccessor; import net.coderbot.iris.shaderpack.CloudSetting; import net.coderbot.iris.uniforms.FrameUpdateNotifier; -import net.minecraft.client.Camera; import net.minecraft.client.renderer.culling.ICamera; public interface WorldRenderingPipeline { diff --git a/src/main/java/net/coderbot/iris/shaderpack/option/BaseOption.java b/src/main/java/net/coderbot/iris/shaderpack/option/BaseOption.java index 62aa3d718c..00507dc729 100644 --- a/src/main/java/net/coderbot/iris/shaderpack/option/BaseOption.java +++ b/src/main/java/net/coderbot/iris/shaderpack/option/BaseOption.java @@ -1,19 +1,18 @@ package net.coderbot.iris.shaderpack.option; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; import java.util.Optional; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - public abstract class BaseOption { - @NotNull + @Nonnull private final OptionType type; - @NotNull + @Nonnull private final String name; @Nullable private final String comment; - BaseOption(@NotNull OptionType type, @NotNull String name, @Nullable String comment) { + BaseOption(@Nonnull OptionType type, @Nonnull String name, @Nullable String comment) { this.type = type; this.name = name; @@ -24,12 +23,12 @@ public abstract class BaseOption { } } - @NotNull + @Nonnull public OptionType getType() { return type; } - @NotNull + @Nonnull public String getName() { return name; } diff --git a/src/main/java/net/coderbot/iris/shaderpack/option/MergedBooleanOption.java b/src/main/java/net/coderbot/iris/shaderpack/option/MergedBooleanOption.java index b7087b62c2..729c11ad4d 100644 --- a/src/main/java/net/coderbot/iris/shaderpack/option/MergedBooleanOption.java +++ b/src/main/java/net/coderbot/iris/shaderpack/option/MergedBooleanOption.java @@ -1,9 +1,9 @@ package net.coderbot.iris.shaderpack.option; -import org.jetbrains.annotations.Nullable; - import com.google.common.collect.ImmutableSet; +import javax.annotation.Nullable; + public class MergedBooleanOption { private final BooleanOption option; private final ImmutableSet locations; diff --git a/src/main/java/net/coderbot/iris/shaderpack/option/MergedStringOption.java b/src/main/java/net/coderbot/iris/shaderpack/option/MergedStringOption.java index 8a724cd59a..b3a8088ee1 100644 --- a/src/main/java/net/coderbot/iris/shaderpack/option/MergedStringOption.java +++ b/src/main/java/net/coderbot/iris/shaderpack/option/MergedStringOption.java @@ -1,9 +1,9 @@ package net.coderbot.iris.shaderpack.option; -import org.jetbrains.annotations.Nullable; - import com.google.common.collect.ImmutableSet; +import javax.annotation.Nullable; + public class MergedStringOption { private final StringOption option; private final ImmutableSet locations; diff --git a/src/main/java/net/coderbot/iris/shaderpack/option/ProfileSet.java b/src/main/java/net/coderbot/iris/shaderpack/option/ProfileSet.java index c395d41aed..b752c14472 100644 --- a/src/main/java/net/coderbot/iris/shaderpack/option/ProfileSet.java +++ b/src/main/java/net/coderbot/iris/shaderpack/option/ProfileSet.java @@ -8,12 +8,12 @@ import java.util.Optional; import java.util.function.BiConsumer; -import org.jetbrains.annotations.Nullable; - import net.coderbot.iris.Iris; import net.coderbot.iris.IrisLogging; import net.coderbot.iris.shaderpack.option.values.OptionValues; +import javax.annotation.Nullable; + public class ProfileSet { private final LinkedHashMap orderedProfiles; // The order that profiles should cycle through private final List sortedProfiles; // The order that profiles should be scanned through diff --git a/src/main/java/net/coderbot/iris/shaderpack/option/StringOption.java b/src/main/java/net/coderbot/iris/shaderpack/option/StringOption.java index be9e30fcdd..13e0d9dfae 100644 --- a/src/main/java/net/coderbot/iris/shaderpack/option/StringOption.java +++ b/src/main/java/net/coderbot/iris/shaderpack/option/StringOption.java @@ -2,11 +2,11 @@ import java.util.Objects; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - import com.google.common.collect.ImmutableList; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + public class StringOption extends BaseOption { private final String defaultValue; private final ImmutableList allowedValues; @@ -65,12 +65,12 @@ public static StringOption create(OptionType type, String name, String comment, return new StringOption(type, name, comment.trim(), defaultValue, builder.build()); } - @NotNull + @Nonnull public String getDefaultValue() { return defaultValue; } - @NotNull + @Nonnull public ImmutableList getAllowedValues() { return allowedValues; }