Skip to content

Commit

Permalink
24w44a
Browse files Browse the repository at this point in the history
  • Loading branch information
IMS212 committed Oct 30, 2024
1 parent ec3e738 commit fe7eb31
Show file tree
Hide file tree
Showing 16 changed files with 51 additions and 47 deletions.
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ plugins {
id("fabric-loom") version("1.8.10") apply(false)
}

val MINECRAFT_VERSION by extra { "1.21.2" }
val MINECRAFT_VERSION by extra { "24w44a" }
val NEOFORGE_VERSION by extra { "21.2.0-beta" }
val FABRIC_LOADER_VERSION by extra { "0.16.7" }
val FABRIC_LOADER_VERSION by extra { "0.16.9" }
val FABRIC_API_VERSION by extra { "0.106.0+1.21.2" }

// This value can be set to null to disable Parchment.
Expand Down
2 changes: 1 addition & 1 deletion common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ dependencies {

modCompileOnly("net.fabricmc.fabric-api:fabric-renderer-api-v1:3.2.9+1172e897d7")

modImplementation("maven.modrinth", "sodium", "mc1.21.2-0.6.0-beta.3-fabric")
modImplementation(files(rootDir.resolve("custom_sodium").resolve("sodium-fabric-0.6.0-snapshot+mc24w44a-local.jar")))
modCompileOnly("org.antlr:antlr4-runtime:4.13.1")
modCompileOnly("io.github.douira:glsl-transformer:2.0.1")
modCompileOnly("org.anarres:jcpp:1.4.14")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public class MixinLevelRenderer {
private Groupable groupable;

@Inject(method = "renderLevel", at = @At("HEAD"))
private void batchedentityrendering$beginLevelRender(GraphicsResourceAllocator graphicsResourceAllocator, DeltaTracker deltaTracker, boolean bl, Camera camera, GameRenderer gameRenderer, LightTexture lightTexture, Matrix4f matrix4f, Matrix4f matrix4f2, CallbackInfo ci) {
private void batchedentityrendering$beginLevelRender(GraphicsResourceAllocator graphicsResourceAllocator, DeltaTracker deltaTracker, boolean bl, Camera camera, GameRenderer gameRenderer, Matrix4f matrix4f, Matrix4f matrix4f2, CallbackInfo ci) {
if (renderBuffers instanceof DrawCallTrackingRenderBuffers) {
((DrawCallTrackingRenderBuffers) renderBuffers).resetDrawCounts();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,5 @@
import net.minecraft.client.renderer.texture.TextureManager;

public class IrisParticleRenderTypes {
public static final ParticleRenderType OPAQUE_TERRAIN = new ParticleRenderType() {
public BufferBuilder begin(Tesselator bufferBuilder, TextureManager textureManager) {
// Cutout is handled by the particle shader for us.
RenderSystem.disableBlend();
RenderSystem.depthMask(true);
RenderSystem.setShaderTexture(0, TextureAtlas.LOCATION_BLOCKS);
return bufferBuilder.begin(VertexFormat.Mode.QUADS, DefaultVertexFormat.PARTICLE);
}

public String toString() {
return "OPAQUE_TERRAIN_SHEET";
}
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public class MixinLevelRenderer {
// This is important or else very odd issues will happen with shaders that have a final pass that doesn't write to
// all pixels.
@Inject(method = "renderLevel", at = @At("HEAD"))
private void iris$setupPipeline(GraphicsResourceAllocator graphicsResourceAllocator, DeltaTracker deltaTracker, boolean bl, Camera camera, GameRenderer gameRenderer, LightTexture lightTexture, Matrix4f modelView, Matrix4f projection, CallbackInfo ci) {
private void iris$setupPipeline(GraphicsResourceAllocator graphicsResourceAllocator, DeltaTracker deltaTracker, boolean bl, Camera camera, GameRenderer gameRenderer, Matrix4f modelView, Matrix4f projection, CallbackInfo ci) {
DHCompat.checkFrame();

IrisTimeUniforms.updateTime();
Expand Down Expand Up @@ -121,7 +121,7 @@ public class MixinLevelRenderer {
// This is important or else very odd issues will happen with shaders that have a final pass that doesn't write to
// all pixels.
@Inject(method = "renderLevel", at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/framegraph/FramePass;executes(Ljava/lang/Runnable;)V", ordinal = 0, shift = At.Shift.AFTER))
private void iris$beginLevelRender(GraphicsResourceAllocator graphicsResourceAllocator, DeltaTracker deltaTracker, boolean bl, Camera camera, GameRenderer gameRenderer, LightTexture lightTexture, Matrix4f matrix4f, Matrix4f matrix4f2, CallbackInfo ci, @Local FrameGraphBuilder frameGraphBuilder, @Local(ordinal = 1) FogParameters fogParameters, @Local(ordinal = 0) FramePass clearPass) {
private void iris$beginLevelRender(GraphicsResourceAllocator graphicsResourceAllocator, DeltaTracker deltaTracker, boolean bl, Camera camera, GameRenderer gameRenderer, Matrix4f matrix4f, Matrix4f matrix4f2, CallbackInfo ci, @Local FrameGraphBuilder frameGraphBuilder, @Local(ordinal = 1) FogParameters fogParameters, @Local(ordinal = 0) FramePass clearPass) {
FramePass framePass = frameGraphBuilder.addPass("iris_setup");
this.targets.main = framePass.readsAndWrites(this.targets.main);
framePass.requires(clearPass);
Expand All @@ -137,7 +137,7 @@ public class MixinLevelRenderer {
// Inject a bit early so that we can end our rendering before mods like VoxelMap (which inject at RETURN)
// render their waypoint beams.
@Inject(method = "renderLevel", at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/systems/RenderSystem;setShaderFog(Lnet/minecraft/client/renderer/FogParameters;)V"))
private void iris$endLevelRender(GraphicsResourceAllocator graphicsResourceAllocator, DeltaTracker deltaTracker, boolean bl, Camera camera, GameRenderer gameRenderer, LightTexture lightTexture, Matrix4f modelMatrix, Matrix4f matrix4f2, CallbackInfo ci) {
private void iris$endLevelRender(GraphicsResourceAllocator graphicsResourceAllocator, DeltaTracker deltaTracker, boolean bl, Camera camera, GameRenderer gameRenderer, Matrix4f modelMatrix, Matrix4f matrix4f2, CallbackInfo ci) {
HandRenderer.INSTANCE.renderTranslucent(modelMatrix, deltaTracker.getGameTimeDeltaPartialTick(true), camera, gameRenderer, pipeline);
Profiler.get().popPush("iris_final");
pipeline.finalizeLevelRendering();
Expand All @@ -161,7 +161,7 @@ public class MixinLevelRenderer {

// Do this before sky rendering so it's ready before the sky render starts.
@Inject(method = "renderLevel", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/LevelRenderer;collectVisibleEntities(Lnet/minecraft/client/Camera;Lnet/minecraft/client/renderer/culling/Frustum;Ljava/util/List;)Z", shift = At.Shift.AFTER))
private void iris$renderTerrainShadows(GraphicsResourceAllocator graphicsResourceAllocator, DeltaTracker deltaTracker, boolean bl, Camera camera, GameRenderer gameRenderer, LightTexture lightTexture, Matrix4f matrix4f, Matrix4f matrix4f2, CallbackInfo ci) {
private void iris$renderTerrainShadows(GraphicsResourceAllocator graphicsResourceAllocator, DeltaTracker deltaTracker, boolean bl, Camera camera, GameRenderer gameRenderer, Matrix4f matrix4f, Matrix4f matrix4f2, CallbackInfo ci) {
pipeline.renderShadows((LevelRendererAccessor) this, camera);

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import net.minecraft.client.Camera;
import net.minecraft.client.particle.ParticleEngine;
import net.minecraft.client.renderer.LightTexture;
import net.minecraft.client.renderer.MultiBufferSource;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
Expand All @@ -16,12 +17,12 @@
@Mixin(ParticleEngine.class)
public class MixinParticleEngine {
@Inject(method = "render", at = @At("HEAD"))
private void iris$beginDrawingParticles(LightTexture lightTexture, Camera camera, float f, CallbackInfo ci) {
private void iris$beginDrawingParticles(Camera camera, float f, MultiBufferSource.BufferSource bufferSource, CallbackInfo ci) {
Iris.getPipelineManager().getPipeline().ifPresent(pipeline -> pipeline.setPhase(WorldRenderingPhase.PARTICLES));
}

@Inject(method = "render", at = @At("RETURN"))
private void iris$finishDrawingParticles(LightTexture lightTexture, Camera camera, float f, CallbackInfo ci) {
private void iris$finishDrawingParticles(Camera camera, float f, MultiBufferSource.BufferSource bufferSource, CallbackInfo ci) {
Iris.getPipelineManager().getPipeline().ifPresent(pipeline -> pipeline.setPhase(WorldRenderingPhase.NONE));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class MixinQuickPlayDev {
ci.cancel();

if (!minecraft.getLevelSource().levelExists(string)) {
minecraft.createWorldOpenFlows().createFreshLevel(string, new LevelSettings(string, GameType.CREATIVE, false, Difficulty.HARD, true, new GameRules(FeatureFlagSet.of(FeatureFlags.MINECART_IMPROVEMENTS, FeatureFlags.REDSTONE_EXPERIMENTS, FeatureFlags.WINTER_DROP)), WorldDataConfiguration.DEFAULT),
minecraft.createWorldOpenFlows().createFreshLevel(string, new LevelSettings(string, GameType.CREATIVE, false, Difficulty.HARD, true, new GameRules(FeatureFlagSet.of(FeatureFlags.MINECART_IMPROVEMENTS, FeatureFlags.REDSTONE_EXPERIMENTS)), WorldDataConfiguration.DEFAULT),
WorldOptions.defaultWithRandomSeed(), WorldPresets::createNormalWorldDimensions, Minecraft.getInstance().screen);
} else {
minecraft.createWorldOpenFlows().openWorld(string, () -> minecraft.setScreen(new TitleScreen()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import net.irisshaders.iris.Iris;
import net.irisshaders.iris.pipeline.WorldRenderingPipeline;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.ScreenEffectRenderer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
Expand All @@ -13,7 +14,7 @@
@Mixin(ScreenEffectRenderer.class)
public abstract class MixinScreenEffectRenderer {
@Inject(method = "renderWater", at = @At(value = "HEAD"), cancellable = true)
private static void iris$disableUnderWaterOverlayRendering(Minecraft minecraft, PoseStack poseStack, CallbackInfo ci) {
private static void iris$disableUnderWaterOverlayRendering(Minecraft minecraft, PoseStack poseStack, MultiBufferSource multiBufferSource, CallbackInfo ci) {
WorldRenderingPipeline pipeline = Iris.getPipelineManager().getPipelineNullable();

if (pipeline != null && !pipeline.shouldRenderUnderwaterOverlay()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import net.irisshaders.iris.pipeline.WorldRenderingPipeline;
import net.minecraft.client.Camera;
import net.minecraft.client.renderer.FogParameters;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.SkyRenderer;
import org.joml.Matrix4f;
import org.spongepowered.asm.mixin.Mixin;
Expand All @@ -31,31 +32,31 @@ public class MixinSkyRenderer {
}

@Inject(method = "renderSun", at = @At("HEAD"), cancellable = true)
private void iris$beforeDrawSun(float f, Tesselator tesselator, PoseStack poseStack, CallbackInfo ci) {
private void iris$beforeDrawSun(float f, MultiBufferSource multiBufferSource, PoseStack poseStack, CallbackInfo ci) {
if (!Iris.getPipelineManager().getPipeline().map(WorldRenderingPipeline::shouldRenderSun).orElse(true)) {
ci.cancel();
}
}

@Inject(method = "renderMoon", at = @At("HEAD"), cancellable = true)
private void iris$beforeDrawMoon(int i, float f, Tesselator tesselator, PoseStack poseStack, CallbackInfo ci) {
private void iris$beforeDrawMoon(int i, float f, MultiBufferSource multiBufferSource, PoseStack poseStack, CallbackInfo ci) {
if (!Iris.getPipelineManager().getPipeline().map(WorldRenderingPipeline::shouldRenderMoon).orElse(true)) {
ci.cancel();
}
}

@Inject(method = "renderSun", at = @At(value = "HEAD"))
private void iris$setSunRenderStage(float f, Tesselator tesselator, PoseStack poseStack, CallbackInfo ci) {
private void iris$setSunRenderStage(float f, MultiBufferSource multiBufferSource, PoseStack poseStack, CallbackInfo ci) {
setPhase(WorldRenderingPhase.SUN);
}

@Inject(method = "renderSunriseAndSunset", at = @At(value = "HEAD"))
private void iris$setSunsetRenderStage(PoseStack poseStack, Tesselator tesselator, float f, int i, CallbackInfo ci) {
private void iris$setSunsetRenderStage(PoseStack poseStack, MultiBufferSource.BufferSource bufferSource, float f, int i, CallbackInfo ci) {
setPhase(WorldRenderingPhase.SUNSET);
}

@Inject(method = "renderMoon", at = @At(value = "HEAD"))
private void iris$setMoonRenderStage(int i, float f, Tesselator tesselator, PoseStack poseStack, CallbackInfo ci) {
private void iris$setMoonRenderStage(int i, float f, MultiBufferSource multiBufferSource, PoseStack poseStack, CallbackInfo ci) {
setPhase(WorldRenderingPhase.MOON);
}

Expand All @@ -70,7 +71,7 @@ public class MixinSkyRenderer {
}

@Inject(method = "renderSunMoonAndStars", at = @At(value = "INVOKE", target = "Lcom/mojang/math/Axis;rotationDegrees(F)Lorg/joml/Quaternionf;", ordinal = 1))
private void iris$renderSky$tiltSun(PoseStack poseStack, Tesselator tesselator, float f, int i, float g, float h, FogParameters fogParameters, CallbackInfo ci) {
private void iris$renderSky$tiltSun(PoseStack poseStack, MultiBufferSource.BufferSource bufferSource, float f, int i, float g, float h, FogParameters fogParameters, CallbackInfo ci) {
poseStack.mulPose(Axis.ZP.rotationDegrees(getSunPathRotation()));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

@Mixin(WeatherEffectRenderer.class)
public class MixinWeatherRenderer {
@ModifyArg(method = "render(Lnet/minecraft/client/renderer/LightTexture;Lnet/minecraft/world/phys/Vec3;IFLjava/util/List;Ljava/util/List;)V", at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/systems/RenderSystem;depthMask(Z)V", ordinal = 0, remap = false))
@ModifyArg(method = "render(Lnet/minecraft/client/renderer/MultiBufferSource;Lnet/minecraft/world/phys/Vec3;IFLjava/util/List;Ljava/util/List;)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/RenderType;weather(Lnet/minecraft/resources/ResourceLocation;Z)Lnet/minecraft/client/renderer/RenderType;", remap = false), index = 1)
private boolean iris$writeRainAndSnowToDepthBuffer(boolean depthMaskEnabled) {
if (Iris.getPipelineManager().getPipeline().map(WorldRenderingPipeline::shouldWriteRainAndSnowToDepthBuffer).orElse(false)) {
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
@Mixin(value = LevelRenderer.class, priority = 999)
public class MixinLevelRenderer {
@Inject(method = "renderLevel", at = @At("HEAD"))
private void iris$immediateStateBeginLevelRender(GraphicsResourceAllocator graphicsResourceAllocator, DeltaTracker deltaTracker, boolean bl, Camera camera, GameRenderer gameRenderer, LightTexture lightTexture, Matrix4f matrix4f, Matrix4f matrix4f2, CallbackInfo ci) {
private void iris$immediateStateBeginLevelRender(GraphicsResourceAllocator graphicsResourceAllocator, DeltaTracker deltaTracker, boolean bl, Camera camera, GameRenderer gameRenderer, Matrix4f matrix4f, Matrix4f matrix4f2, CallbackInfo ci) {
ImmediateState.isRenderingLevel = true;
}

@Inject(method = "renderLevel", at = @At("RETURN"))
private void iris$immediateStateEndLevelRender(GraphicsResourceAllocator graphicsResourceAllocator, DeltaTracker deltaTracker, boolean bl, Camera camera, GameRenderer gameRenderer, LightTexture lightTexture, Matrix4f matrix4f, Matrix4f matrix4f2, CallbackInfo ci) {
private void iris$immediateStateEndLevelRender(GraphicsResourceAllocator graphicsResourceAllocator, DeltaTracker deltaTracker, boolean bl, Camera camera, GameRenderer gameRenderer, Matrix4f matrix4f, Matrix4f matrix4f2, CallbackInfo ci) {
ImmediateState.isRenderingLevel = false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ private static Vector3d getSkyColor() {
int skyColor = client.level.getSkyColor(client.cameraEntity.position(),
CapturedRenderingState.INSTANCE.getTickDelta());

return new Vector3d(ARGB.from8BitChannel(ARGB.red(skyColor)), ARGB.from8BitChannel(ARGB.green(skyColor)), ARGB.from8BitChannel(ARGB.blue(skyColor)));
return new Vector3d(ARGB.redFloat(skyColor), ARGB.greenFloat(skyColor), ARGB.blueFloat(skyColor));
}

static float getBlindness() {
Expand Down
6 changes: 4 additions & 2 deletions fabric/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,12 @@ dependencies {
addRuntimeFabricModule("fabric-block-view-api-v2")
addRuntimeFabricModule("fabric-renderer-api-v1")
addRuntimeFabricModule("fabric-rendering-data-attachment-v1")
addRuntimeFabricModule("fabric-rendering-fluids-v1")
modImplementation("net.fabricmc.fabric-api:fabric-rendering-fluids-v1:3.1.14+fd37071f1c") {
isTransitive = false
}
addRuntimeFabricModule("fabric-resource-loader-v0")

modImplementation("maven.modrinth", "sodium", "mc1.21.2-0.6.0-beta.3-fabric")
modImplementation(files(rootDir.resolve("custom_sodium").resolve("sodium-fabric-0.6.0-snapshot+mc24w44a-local.jar")))
implementAndInclude("org.antlr:antlr4-runtime:4.13.1")
implementAndInclude("io.github.douira:glsl-transformer:2.0.1")
implementAndInclude("org.anarres:jcpp:1.4.14")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import net.minecraft.client.renderer.GameRenderer;
import net.minecraft.client.renderer.LevelRenderer;
import net.minecraft.client.renderer.LightTexture;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.RenderBuffers;
import net.minecraft.client.renderer.culling.Frustum;
import net.minecraft.util.profiling.Profiler;
Expand Down Expand Up @@ -45,7 +46,7 @@ public abstract class MixinLevelRenderer {
private RenderBuffers renderBuffers;

@Inject(method = "renderLevel", at = @At("HEAD"))
private void iris$resetParticleManagerPhase(GraphicsResourceAllocator graphicsResourceAllocator, DeltaTracker deltaTracker, boolean bl, Camera camera, GameRenderer gameRenderer, LightTexture lightTexture, Matrix4f matrix4f, Matrix4f matrix4f2, CallbackInfo ci) {
private void iris$resetParticleManagerPhase(GraphicsResourceAllocator graphicsResourceAllocator, DeltaTracker deltaTracker, boolean bl, Camera camera, GameRenderer gameRenderer, Matrix4f matrix4f, Matrix4f matrix4f2, CallbackInfo ci) {
((PhasedParticleEngine) minecraft.particleEngine).setParticleRenderingPhase(ParticleRenderingPhase.EVERYTHING);
}

Expand All @@ -58,22 +59,22 @@ public abstract class MixinLevelRenderer {
float f = deltaTracker.getGameTimeDeltaPartialTick(false);

if (settings == ParticleRenderingSettings.BEFORE) {
minecraft.particleEngine.render(Minecraft.getInstance().gameRenderer.lightTexture(), camera, f);
minecraft.particleEngine.render(camera, f, this.renderBuffers.bufferSource());
} else if (settings == ParticleRenderingSettings.MIXED) {
((PhasedParticleEngine) minecraft.particleEngine).setParticleRenderingPhase(ParticleRenderingPhase.OPAQUE);
minecraft.particleEngine.render(Minecraft.getInstance().gameRenderer.lightTexture(), camera, f);
minecraft.particleEngine.render(camera, f, this.renderBuffers.bufferSource());
}
}

@Redirect(method = "method_62213", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/particle/ParticleEngine;render(Lnet/minecraft/client/renderer/LightTexture;Lnet/minecraft/client/Camera;F)V"))
private void iris$renderTranslucentAfterDeferred(ParticleEngine instance, LightTexture lightTexture, Camera camera, float f) {
@Redirect(method = "method_62213", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/particle/ParticleEngine;render(Lnet/minecraft/client/Camera;FLnet/minecraft/client/renderer/MultiBufferSource$BufferSource;)V"))
private void iris$renderTranslucentAfterDeferred(ParticleEngine instance, Camera camera, float f, MultiBufferSource.BufferSource bufferSource) {
ParticleRenderingSettings settings = getRenderingSettings();

if (settings == ParticleRenderingSettings.AFTER) {
minecraft.particleEngine.render(lightTexture, camera, f);
minecraft.particleEngine.render(camera, f, bufferSource);
} else if (settings == ParticleRenderingSettings.MIXED) {
((PhasedParticleEngine) minecraft.particleEngine).setParticleRenderingPhase(ParticleRenderingPhase.TRANSLUCENT);
minecraft.particleEngine.render(lightTexture, camera, f);
minecraft.particleEngine.render(camera, f, bufferSource);
}
}

Expand Down
Loading

0 comments on commit fe7eb31

Please sign in to comment.