Skip to content

Commit

Permalink
Disable directional shading on fluids
Browse files Browse the repository at this point in the history
Fixes #2581
  • Loading branch information
IMS212 committed Jan 18, 2025
1 parent 8e45bf7 commit cc2c662
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {

val MINECRAFT_VERSION by extra { "1.21.1" }
val NEOFORGE_VERSION by extra { "21.1.58" }
val FABRIC_LOADER_VERSION by extra { "0.16.4" }
val FABRIC_LOADER_VERSION by extra { "0.16.10" }
val FABRIC_API_VERSION by extra { "0.103.0+1.21.1" }

// This value can be set to null to disable Parchment.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package net.irisshaders.iris.compat.sodium.mixin;

import net.caffeinemc.mods.sodium.client.render.chunk.compile.pipeline.DefaultFluidRenderer;
import net.irisshaders.iris.shaderpack.materialmap.WorldRenderingSettings;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyArg;

@Mixin(DefaultFluidRenderer.class)
public class MixinDefaultFluidRenderer {
@ModifyArg(method = "render", at = @At(value = "INVOKE", target = "Lnet/caffeinemc/mods/sodium/client/render/chunk/compile/" +
"pipeline/DefaultFluidRenderer;updateQuad(Lnet/caffeinemc/mods/sodium/client/model/quad/ModelQuadViewMutable;" +
"Lnet/caffeinemc/mods/sodium/client/world/LevelSlice;Lnet/minecraft/core/BlockPos;Lnet/caffeinemc/" +
"mods/sodium/client/model/light/LightPipeline;Lnet/minecraft/core/Direction;Lnet/caffeinemc/mods/" +
"sodium/client/model/quad/properties/ModelQuadFacing" +
";FLnet/caffeinemc/mods/sodium/client/model/color/ColorProvider;Lnet/minecraft/world/level/material/FluidState;)V", ordinal = 2))
private float setBrightness(float br) {
return WorldRenderingSettings.INSTANCE.shouldDisableDirectionalShading() ? 1.0f : br;
}
}
1 change: 1 addition & 0 deletions common/src/main/resources/mixins.iris.compat.sodium.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"MixinChunkMeshBuildTask",
"MixinCloudRenderer",
"MixinDefaultChunkRenderer",
"MixinDefaultFluidRenderer",
"MixinGlRenderDevice",
"MixinRenderRegionArenas",
"MixinRenderSectionManager",
Expand Down

0 comments on commit cc2c662

Please sign in to comment.