From b50faac79c6f3b3d54ab6960a5cabb1caffc0a54 Mon Sep 17 00:00:00 2001 From: millennIumAMbiguity <37588844+millennIumAMbiguity@users.noreply.github.com> Date: Sun, 25 May 2025 15:52:58 +0200 Subject: [PATCH 1/9] Add `IS_OCULUS` to Standard Macros (#806) --- src/main/java/net/irisshaders/iris/gl/shader/StandardMacros.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/net/irisshaders/iris/gl/shader/StandardMacros.java b/src/main/java/net/irisshaders/iris/gl/shader/StandardMacros.java index f6f9d918be..d06b27963d 100644 --- a/src/main/java/net/irisshaders/iris/gl/shader/StandardMacros.java +++ b/src/main/java/net/irisshaders/iris/gl/shader/StandardMacros.java @@ -49,6 +49,7 @@ public static ImmutableList createStandardEnvironmentDefines() { define(standardDefines, getVendor()); define(standardDefines, getRenderer()); define(standardDefines, "IS_IRIS"); + define(standardDefines, "IS_OCULUS"); if (LoadingModList.get().getModFileById("distanthorizons") != null && DHCompat.hasRenderingEnabled()) { From b3b278134f719afe32ba8b6b5d3a93f052175afc Mon Sep 17 00:00:00 2001 From: MoePus <547007249@qq.com> Date: Sun, 25 May 2025 22:00:54 +0800 Subject: [PATCH 2/9] update embeddium to lastest (#789) --- gradle.properties | 2 +- .../iris/compat/sodium/mixin/copyEntity/CuboidMixin.java | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index b0c27e6b7a..e5b8ecf860 100644 --- a/gradle.properties +++ b/gradle.properties @@ -14,4 +14,4 @@ loom.platform = forge archives_base_name = oculus # Dependencies - embeddium_version=0.3.14-git.8af1729+mc1.20.1 + embeddium_version=0.3.31-beta.53+mc1.20.1 diff --git a/src/sodiumCompatibility/java/net/irisshaders/iris/compat/sodium/mixin/copyEntity/CuboidMixin.java b/src/sodiumCompatibility/java/net/irisshaders/iris/compat/sodium/mixin/copyEntity/CuboidMixin.java index ebd96a3551..ab558b39db 100644 --- a/src/sodiumCompatibility/java/net/irisshaders/iris/compat/sodium/mixin/copyEntity/CuboidMixin.java +++ b/src/sodiumCompatibility/java/net/irisshaders/iris/compat/sodium/mixin/copyEntity/CuboidMixin.java @@ -4,6 +4,7 @@ import me.jellysquid.mods.sodium.client.render.immediate.model.ModelCuboid; import net.minecraft.client.model.geom.ModelPart; import net.minecraft.core.Direction; +import org.jetbrains.annotations.Nullable; import org.objectweb.asm.Opcodes; import org.spongepowered.asm.mixin.*; import org.spongepowered.asm.mixin.injection.At; @@ -17,6 +18,8 @@ public class CuboidMixin implements ModelCuboidAccessor { @Unique private ModelCuboid sodium$cuboid; + @Unique + private ModelCuboid embeddium$simpleCuboid; @Mutable @Shadow @@ -27,6 +30,7 @@ public class CuboidMixin implements ModelCuboidAccessor { @Redirect(method = "", at = @At(value = "FIELD", opcode = Opcodes.PUTFIELD, target = "Lnet/minecraft/client/model/geom/ModelPart$Cube;minX:F", ordinal = 0)) private void onInit(ModelPart.Cube instance, float value, int u, int v, float x, float y, float z, float sizeX, float sizeY, float sizeZ, float extraX, float extraY, float extraZ, boolean mirror, float textureWidth, float textureHeight, Set renderDirections) { this.sodium$cuboid = new ModelCuboid(u, v, x, y, z, sizeX, sizeY, sizeZ, extraX, extraY, extraZ, mirror, textureWidth, textureHeight, renderDirections); + this.embeddium$simpleCuboid = (Class)getClass() == ModelPart.Cube.class ? this.sodium$cuboid : null; this.minX = value; } @@ -35,4 +39,9 @@ private void onInit(ModelPart.Cube instance, float value, int u, int v, float x, public ModelCuboid sodium$copy() { return this.sodium$cuboid; } + + @Override + public @Nullable ModelCuboid embeddium$getSimpleCuboid() { + return this.embeddium$simpleCuboid; + } } From ff38baeeb1caad0313592df433a9fcf4cb585c57 Mon Sep 17 00:00:00 2001 From: YesVRC Date: Tue, 27 May 2025 02:24:10 -0400 Subject: [PATCH 3/9] I did something, just copypasta for now. --- build.gradle | 2 +- src/main/java/net/irisshaders/iris/Iris.java | 2 +- .../irisshaders/iris/config/IrisConfig.java | 58 +++++++++- .../iris/gl/shader/StandardMacros.java | 4 + .../iris/gui/screen/ShaderPackScreen.java | 14 +++ .../iris/mixin/MixinShaderInstance.java | 108 ++++++++++++++++++ .../iris/pipeline/IrisRenderingPipeline.java | 26 +++++ .../pipeline/fallback/ShaderSynthesizer.java | 67 +++++------ .../shaderpack/properties/PackDirectives.java | 9 ++ .../properties/ProgramDirectives.java | 1 + .../properties/ShaderProperties.java | 9 ++ .../iris/shadows/ShadowRenderer.java | 1 - 12 files changed, 264 insertions(+), 37 deletions(-) diff --git a/build.gradle b/build.gradle index 9312e4c2b2..e0c4f16519 100644 --- a/build.gradle +++ b/build.gradle @@ -17,7 +17,7 @@ loom { "mixins.oculus.bettermipmaps.json", "mixins.oculus.fixes.maxfpscrash.json", "oculus-batched-entity-rendering.mixins.json", - "mixins.oculus.compat.sodium.json", + //"mixins.oculus.compat.sodium.json", "mixins.oculus.compat.indigo.json", "mixins.oculus.compat.indium.json", "mixins.oculus.compat.dh.json", diff --git a/src/main/java/net/irisshaders/iris/Iris.java b/src/main/java/net/irisshaders/iris/Iris.java index 28ef05acd5..986debdb12 100644 --- a/src/main/java/net/irisshaders/iris/Iris.java +++ b/src/main/java/net/irisshaders/iris/Iris.java @@ -771,7 +771,7 @@ public static void onEarlyInitialize() { logger.warn("", e); } - irisConfig = new IrisConfig(FMLPaths.CONFIGDIR.get().resolve(MODID + ".properties")); + irisConfig = new IrisConfig(FMLPaths.CONFIGDIR.get().resolve(MODID + ".properties"), FMLPaths.CONFIGDIR.get().resolve("iris-excluded.json")); try { irisConfig.initialize(); diff --git a/src/main/java/net/irisshaders/iris/config/IrisConfig.java b/src/main/java/net/irisshaders/iris/config/IrisConfig.java index 2a18c9f9cf..e901f39a4c 100644 --- a/src/main/java/net/irisshaders/iris/config/IrisConfig.java +++ b/src/main/java/net/irisshaders/iris/config/IrisConfig.java @@ -1,14 +1,21 @@ package net.irisshaders.iris.config; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; import net.irisshaders.iris.Iris; import net.irisshaders.iris.gui.option.IrisVideoSettings; import net.irisshaders.iris.pathways.colorspace.ColorSpace; +import net.minecraft.resources.ResourceLocation; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.nio.file.Files; import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; import java.util.Optional; import java.util.Properties; @@ -19,6 +26,7 @@ public class IrisConfig { private static final String COMMENT = "This file stores configuration options for Iris, such as the currently active shaderpack"; private final Path propertiesPath; + private final Path excludedPath; /** * The path to the current shaderpack. Null if the internal shaderpack is being used. */ @@ -27,21 +35,32 @@ public class IrisConfig { * Whether or not shaders are used for rendering. False to disable all shader-based rendering, true to enable it. */ private boolean enableShaders; + /** + * Whether or not to allow core shaders to draw to the main color texture. + */ + private boolean allowUnknownShaders; /** * If debug features should be enabled. Gives much more detailed OpenGL error outputs at the cost of performance. */ private boolean enableDebugOptions; + /** + * What shaders should be nuked. + */ + private List shadersToSkip = new ArrayList<>(); /** * If the update notification should be disabled or not. */ private boolean disableUpdateMessage; - public IrisConfig(Path propertiesPath) { + public IrisConfig(Path propertiesPath, Path excluded) { shaderPackName = null; enableShaders = true; enableDebugOptions = false; disableUpdateMessage = false; this.propertiesPath = propertiesPath; + allowUnknownShaders = false; + this.excludedPath = excluded; + } /** @@ -113,6 +132,14 @@ public void setShadersEnabled(boolean enabled) { this.enableShaders = enabled; } + public void setUnknown(boolean b) throws IOException { + this.allowUnknownShaders = b; + save(); + } + + private static Gson GSON = new Gson(); + + /** * loads the config file and then populates the string, int, and boolean entries with the parsed entries * @@ -124,6 +151,24 @@ public void load() throws IOException { return; } + if (Files.exists(excludedPath)) { + JsonArray json = JsonParser.parseString(Files.readString(excludedPath)).getAsJsonObject().getAsJsonArray("excluded"); + for (int i = 0; i < json.size(); i++) { + ResourceLocation resource = ResourceLocation.tryParse(json.get(i).getAsString()); + if (resource == null) { + Iris.logger.warn("Unknown shader " + json.get(i).getAsString()); + } + + shadersToSkip.add(resource); + } + } else { + JsonObject defaultV = new JsonObject(); + JsonArray array = new JsonArray(); + array.add("put:valuesHere"); + defaultV.add("excluded", array); + Files.writeString(excludedPath, GSON.toJson(defaultV)); + } + Properties properties = new Properties(); // NB: This uses ISO-8859-1 with unicode escapes as the encoding try (InputStream is = Files.newInputStream(propertiesPath)) { @@ -133,6 +178,8 @@ public void load() throws IOException { enableShaders = !"false".equals(properties.getProperty("enableShaders")); enableDebugOptions = "true".equals(properties.getProperty("enableDebugOptions")); disableUpdateMessage = "true".equals(properties.getProperty("disableUpdateMessage")); + allowUnknownShaders = "true".equals(properties.getProperty("allowUnknownShaders")); + try { IrisVideoSettings.shadowDistance = Integer.parseInt(properties.getProperty("maxShadowRenderDistance", "32")); IrisVideoSettings.colorSpace = ColorSpace.valueOf(properties.getProperty("colorSpace", "SRGB")); @@ -163,9 +210,18 @@ public void save() throws IOException { properties.setProperty("disableUpdateMessage", disableUpdateMessage ? "true" : "false"); properties.setProperty("maxShadowRenderDistance", String.valueOf(IrisVideoSettings.shadowDistance)); properties.setProperty("colorSpace", IrisVideoSettings.colorSpace.name()); + properties.setProperty("allowUnknownShaders", allowUnknownShaders ? "true" : "false"); // NB: This uses ISO-8859-1 with unicode escapes as the encoding try (OutputStream os = Files.newOutputStream(propertiesPath)) { properties.store(os, COMMENT); } } + + public boolean shouldAllowUnknownShaders() { + return allowUnknownShaders; + } + + public boolean shouldSkip(ResourceLocation value) { + return shadersToSkip.contains(value); // TODO + } } diff --git a/src/main/java/net/irisshaders/iris/gl/shader/StandardMacros.java b/src/main/java/net/irisshaders/iris/gl/shader/StandardMacros.java index d06b27963d..6030ba60be 100644 --- a/src/main/java/net/irisshaders/iris/gl/shader/StandardMacros.java +++ b/src/main/java/net/irisshaders/iris/gl/shader/StandardMacros.java @@ -56,6 +56,10 @@ public static ImmutableList createStandardEnvironmentDefines() { define(standardDefines, "DISTANT_HORIZONS"); } + if (Iris.getIrisConfig().shouldAllowUnknownShaders()) { + define(standardDefines, "ALLOWS_UNKNOWN_SHADERS"); + } + define(standardDefines, "DH_BLOCK_UNKNOWN", String.valueOf(0)); define(standardDefines, "DH_BLOCK_LEAVES", String.valueOf(1)); define(standardDefines, "DH_BLOCK_STONE", String.valueOf(2)); diff --git a/src/main/java/net/irisshaders/iris/gui/screen/ShaderPackScreen.java b/src/main/java/net/irisshaders/iris/gui/screen/ShaderPackScreen.java index 55a8437c5d..fac2762d59 100644 --- a/src/main/java/net/irisshaders/iris/gui/screen/ShaderPackScreen.java +++ b/src/main/java/net/irisshaders/iris/gui/screen/ShaderPackScreen.java @@ -107,6 +107,20 @@ public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float delta) Component.literal("No"))); } + if (Screen.hasControlDown() && InputConstants.isKeyDown(Minecraft.getInstance().getWindow().getWindow(), GLFW.GLFW_KEY_G)) { + Minecraft.getInstance().setScreen(new ConfirmScreen((option) -> { + try { + Iris.getIrisConfig().setUnknown(option); + } catch (IOException e) { + throw new RuntimeException(e); + } + Minecraft.getInstance().setScreen(this); + }, Component.literal("Unknown shader toggle"), + Component.literal("This allows unknown shaders to load in."), + Component.literal("Enable"), + Component.literal("Disable"))); + } + if (!this.guiHidden) { if (optionMenuOpen && this.shaderOptionList != null) { this.shaderOptionList.render(guiGraphics, mouseX, mouseY, delta); diff --git a/src/main/java/net/irisshaders/iris/mixin/MixinShaderInstance.java b/src/main/java/net/irisshaders/iris/mixin/MixinShaderInstance.java index 78d58f3ef7..9bd17f9475 100644 --- a/src/main/java/net/irisshaders/iris/mixin/MixinShaderInstance.java +++ b/src/main/java/net/irisshaders/iris/mixin/MixinShaderInstance.java @@ -2,16 +2,21 @@ import com.google.common.collect.ImmutableSet; import com.google.gson.JsonObject; +import com.mojang.blaze3d.shaders.Program; import com.mojang.blaze3d.shaders.Uniform; import com.mojang.blaze3d.vertex.VertexFormat; +import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; import net.irisshaders.iris.Iris; +import net.irisshaders.iris.gl.GLDebug; import net.irisshaders.iris.gl.IrisRenderSystem; import net.irisshaders.iris.gl.blending.DepthColorStorage; +import net.irisshaders.iris.pipeline.IrisRenderingPipeline; import net.irisshaders.iris.pipeline.ShaderRenderingPipeline; import net.irisshaders.iris.pipeline.WorldRenderingPipeline; import net.irisshaders.iris.pipeline.programs.ExtendedShader; import net.irisshaders.iris.pipeline.programs.FallbackShader; import net.irisshaders.iris.pipeline.programs.ShaderInstanceInterface; +import net.irisshaders.iris.shadows.ShadowRenderer; import net.minecraft.client.renderer.ShaderInstance; import net.minecraft.resources.ResourceLocation; import net.minecraft.server.packs.resources.ResourceProvider; @@ -20,7 +25,9 @@ import org.lwjgl.opengl.GL20C; import org.lwjgl.opengl.GL30C; import net.minecraft.util.GsonHelper; +import org.lwjgl.opengl.KHRDebug; import org.slf4j.Logger; +import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.Unique; @@ -30,13 +37,81 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.LocalCapture; +import java.io.IOException; import java.io.Reader; +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodType; +import java.util.Map; import java.util.Objects; @Mixin(ShaderInstance.class) public abstract class MixinShaderInstance implements ShaderInstanceInterface { @Unique private static final ImmutableSet ATTRIBUTE_LIST = ImmutableSet.of("Position", "Color", "Normal", "UV0", "UV1", "UV2"); + @Shadow + private static ShaderInstance lastAppliedShader; + @Shadow + @Final + private int programId; + @Shadow + @Final + private Program vertexProgram; + @Shadow + @Final + private Program fragmentProgram; + @Unique + private static final MethodHandle NONE = MethodHandles.constant(Integer.class, 2); + + @Unique + private static final MethodHandle ALWAYS = MethodHandles.constant(Integer.class, 1); + + @Unique + private MethodHandle shouldSkip; + + private static Map, MethodHandle> shouldSkipList = new Object2ObjectOpenHashMap<>(); + + static { + shouldSkipList.put(ExtendedShader.class, NONE); + shouldSkipList.put(FallbackShader.class, NONE); + } + + @Inject(method = "(Lnet/minecraft/server/packs/resources/ResourceProvider;Lnet/minecraft/resources/ResourceLocation;Lcom/mojang/blaze3d/vertex/VertexFormat;)V", at = @At("TAIL"), require = 0) + private void iriss$storeSkip(ResourceProvider resourceProvider, ResourceLocation string, VertexFormat vertexFormat, CallbackInfo ci) { + shouldSkip = shouldSkipList.computeIfAbsent(getClass(), x -> { + try { + MethodHandle iris$skipDraw = MethodHandles.lookup().findVirtual(x, "iris$skipDraw", MethodType.methodType(boolean.class)); + Iris.logger.warn("Class " + x.getName() + " has opted out of being rendered with shaders."); + return iris$skipDraw; + } catch (NoSuchMethodException | IllegalAccessException e) { + return NONE; + } + }); + + + if (Iris.getIrisConfig().shouldSkip(string)) { + shouldSkip = ALWAYS; + } + } + + public boolean iris$shouldSkipThis() { + if (Iris.getIrisConfig().shouldAllowUnknownShaders()) { + if (ShadowRenderer.ACTIVE) return true; + + if (!shouldOverrideShaders()) return false; + + if (shouldSkip == NONE) return false; + if (shouldSkip == ALWAYS) return true; + + try { + return (boolean) shouldSkip.invoke(((ShaderInstance) (Object) this)); + } catch (Throwable e) { + throw new RuntimeException(e); + } + } else { + return !(((Object) this) instanceof ExtendedShader || ((Object) this) instanceof FallbackShader || !shouldOverrideShaders()); + } + } private static boolean shouldOverrideShaders() { WorldRenderingPipeline pipeline = Iris.getPipelineManager().getPipelineNullable(); @@ -70,6 +145,13 @@ private static boolean shouldOverrideShaders() { } } + @Inject(method = "", at = @At("RETURN")) + private void name(ResourceProvider resourceProvider, String string, VertexFormat vertexFormat, CallbackInfo ci) { + GLDebug.nameObject(KHRDebug.GL_PROGRAM, this.programId, string); + GLDebug.nameObject(KHRDebug.GL_SHADER, this.vertexProgram.getId(), string); + GLDebug.nameObject(KHRDebug.GL_SHADER, this.fragmentProgram.getId(), string); + } + @Inject(method = "apply", at = @At("TAIL")) private void iris$lockDepthColorState(CallbackInfo ci) { if (((Object) this) instanceof ExtendedShader || ((Object) this) instanceof FallbackShader || !shouldOverrideShaders()) { @@ -88,12 +170,38 @@ private static boolean shouldOverrideShaders() { DepthColorStorage.unlockDepthColor(); } + @Inject(method = "apply", at = @At("TAIL")) + private void onTail(CallbackInfo ci) { + if (!iris$shouldSkipThis()) { + if (!isKnownShader() && shouldOverrideShaders()) { + WorldRenderingPipeline pipeline = Iris.getPipelineManager().getPipelineNullable(); + + if (pipeline instanceof IrisRenderingPipeline) { + if (ShadowRenderer.ACTIVE) { + // ((IrisRenderingPipeline) pipeline).bindDefaultShadow(); don't rn + } else { + ((IrisRenderingPipeline) pipeline).bindDefault(); + } + } + } + + return; + } + + DepthColorStorage.disableDepthColor(); + } + + private boolean isKnownShader() { + return ((Object) this) instanceof ExtendedShader || ((Object) this) instanceof FallbackShader; + } + @Redirect(method = "(Lnet/minecraft/server/packs/resources/ResourceProvider;Lnet/minecraft/resources/ResourceLocation;Lcom/mojang/blaze3d/vertex/VertexFormat;)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/GsonHelper;parse(Ljava/io/Reader;)Lcom/google/gson/JsonObject;")) public JsonObject iris$setupGeometryShader(Reader reader, ResourceProvider resourceProvider, ResourceLocation name, VertexFormat vertexFormat) { this.iris$createExtraShaders(resourceProvider, name); return GsonHelper.parse(reader); } + @Override public void iris$createExtraShaders(ResourceProvider provider, ResourceLocation name) { //no-op, used for ExtendedShader to call before the super constructor diff --git a/src/main/java/net/irisshaders/iris/pipeline/IrisRenderingPipeline.java b/src/main/java/net/irisshaders/iris/pipeline/IrisRenderingPipeline.java index 6212a6e93e..0e3dc9da71 100644 --- a/src/main/java/net/irisshaders/iris/pipeline/IrisRenderingPipeline.java +++ b/src/main/java/net/irisshaders/iris/pipeline/IrisRenderingPipeline.java @@ -183,6 +183,11 @@ public class IrisRenderingPipeline implements WorldRenderingPipeline, ShaderRend private ColorSpace currentColorSpace; private CloudSetting dhCloudSetting; + + private GlFramebuffer defaultFB; + private GlFramebuffer defaultFBAlt; + private GlFramebuffer defaultFBShadow; + public IrisRenderingPipeline(ProgramSet programSet) { ShaderPrinter.resetPrintState(); @@ -472,6 +477,8 @@ public IrisRenderingPipeline(ProgramSet programSet) { shadowRenderer = null; } + defaultFBShadow = shadowRenderTargets.createFramebufferWritingToMain(new int[] {0}); + } else { this.shadowClearPasses = ImmutableList.of(); this.shadowClearPassesFull = ImmutableList.of(); @@ -541,6 +548,10 @@ public void process(int target) { } currentColorSpace = IrisVideoSettings.colorSpace; + int defaultTex = packDirectives.getFallbackTex(); + + defaultFB = flippedAfterPrepare.contains(defaultTex) ? renderTargets.createFramebufferWritingToAlt(new int[] { defaultTex }) : renderTargets.createFramebufferWritingToMain(new int[] { defaultTex }); + defaultFBAlt = flippedAfterTranslucent.contains(defaultTex) ? renderTargets.createFramebufferWritingToAlt(new int[] { defaultTex }) : renderTargets.createFramebufferWritingToMain(new int[] { defaultTex }); } private ComputeProgram[] createShadowComputes(ComputeSource[] compute, ProgramSet programSet) { @@ -1214,6 +1225,9 @@ public void destroy() { customImages.forEach(GlImage::destroy); + if (shadowRenderTargets != null) { + shadowRenderTargets.destroy(); + } if (shadowRenderer != null) { shadowRenderer.destroy(); } @@ -1306,4 +1320,16 @@ public GlFramebuffer createDHFramebufferShadow(ProgramSource sources) { public boolean hasShadowRenderTargets() { return shadowRenderTargets != null; } + + public void bindDefault() { + if (isBeforeTranslucent) { + defaultFB.bind(); + } else { + defaultFBAlt.bind(); + } + } + + public void bindDefaultShadow() { + defaultFBShadow.bind(); + } } diff --git a/src/main/java/net/irisshaders/iris/pipeline/fallback/ShaderSynthesizer.java b/src/main/java/net/irisshaders/iris/pipeline/fallback/ShaderSynthesizer.java index 3b4c37c806..7af4f94969 100644 --- a/src/main/java/net/irisshaders/iris/pipeline/fallback/ShaderSynthesizer.java +++ b/src/main/java/net/irisshaders/iris/pipeline/fallback/ShaderSynthesizer.java @@ -29,34 +29,34 @@ public static String vsh(boolean hasChunkOffset, ShaderAttributeInputs inputs, F if (inputs.isNewLines()) { shader.append("const float VIEW_SHRINK = 1.0 - (1.0 / 256.0);\n" + - "const mat4 VIEW_SCALE = mat4(\n" + - " VIEW_SHRINK, 0.0, 0.0, 0.0,\n" + - " 0.0, VIEW_SHRINK, 0.0, 0.0,\n" + - " 0.0, 0.0, VIEW_SHRINK, 0.0,\n" + - " 0.0, 0.0, 0.0, 1.0\n" + - ");\n"); + "const mat4 VIEW_SCALE = mat4(\n" + + " VIEW_SHRINK, 0.0, 0.0, 0.0,\n" + + " 0.0, VIEW_SHRINK, 0.0, 0.0,\n" + + " 0.0, 0.0, VIEW_SHRINK, 0.0,\n" + + " 0.0, 0.0, 0.0, 1.0\n" + + ");\n"); shader.append("uniform float LineWidth;\n" + - "uniform vec2 ScreenSize;\n"); + "uniform vec2 ScreenSize;\n"); main.append("vec4 linePosStart = ProjMat * VIEW_SCALE * ModelViewMat * vec4(" + position + ", 1.0);\n" + - " vec4 linePosEnd = ProjMat * VIEW_SCALE * ModelViewMat * vec4(" + position + " + Normal, 1.0);\n" + - "\n" + - " vec3 ndc1 = linePosStart.xyz / linePosStart.w;\n" + - " vec3 ndc2 = linePosEnd.xyz / linePosEnd.w;\n" + - "\n" + - " vec2 lineScreenDirection = normalize((ndc2.xy - ndc1.xy) * ScreenSize);\n" + - " vec2 lineOffset = vec2(-lineScreenDirection.y, lineScreenDirection.x) * LineWidth / ScreenSize;\n" + - "\n" + - " if (lineOffset.x < 0.0) {\n" + - " lineOffset *= -1.0;\n" + - " }\n" + - "\n" + - " if (gl_VertexID % 2 == 0) {\n" + - " gl_Position = vec4((ndc1 + vec3(lineOffset, 0.0)) * linePosStart.w, linePosStart.w);\n" + - " } else {\n" + - " gl_Position = vec4((ndc1 - vec3(lineOffset, 0.0)) * linePosStart.w, linePosStart.w);\n" + - " }\n"); + " vec4 linePosEnd = ProjMat * VIEW_SCALE * ModelViewMat * vec4(" + position + " + Normal, 1.0);\n" + + "\n" + + " vec3 ndc1 = linePosStart.xyz / linePosStart.w;\n" + + " vec3 ndc2 = linePosEnd.xyz / linePosEnd.w;\n" + + "\n" + + " vec2 lineScreenDirection = normalize((ndc2.xy - ndc1.xy) * ScreenSize);\n" + + " vec2 lineOffset = vec2(-lineScreenDirection.y, lineScreenDirection.x) * LineWidth / ScreenSize;\n" + + "\n" + + " if (lineOffset.x < 0.0) {\n" + + " lineOffset *= -1.0;\n" + + " }\n" + + "\n" + + " if (gl_VertexID % 2 == 0) {\n" + + " gl_Position = vec4((ndc1 + vec3(lineOffset, 0.0)) * linePosStart.w, linePosStart.w);\n" + + " } else {\n" + + " gl_Position = vec4((ndc1 - vec3(lineOffset, 0.0)) * linePosStart.w, linePosStart.w);\n" + + " }\n"); } else { main.append(" gl_Position = ProjMat * ModelViewMat * vec4("); main.append(position); @@ -82,13 +82,13 @@ public static String vsh(boolean hasChunkOffset, ShaderAttributeInputs inputs, F // Copied from Mojang code. shader.append("vec4 minecraft_mix_light(vec3 lightDir0, vec3 lightDir1, vec3 normal, vec4 color) {\n" + - " lightDir0 = normalize(lightDir0);\n" + - " lightDir1 = normalize(lightDir1);\n" + - " float light0 = max(0.0, dot(lightDir0, normal));\n" + - " float light1 = max(0.0, dot(lightDir1, normal));\n" + - " float lightAccum = min(1.0, (light0 + light1) * 0.6 + 0.4);\n" + - " return vec4(color.rgb * lightAccum, color.a);\n" + - "}\n"); + // " lightDir0 = normalize(lightDir0);\n" + + // " lightDir1 = normalize(lightDir1);\n" + + " float light0 = max(0.0, dot(lightDir0, normal));\n" + + " float light1 = max(0.0, dot(lightDir1, normal));\n" + + " float lightAccum = min(1.0, (light0 + light1) * 0.6 + 0.4);\n" + + " return vec4(color.rgb * lightAccum, color.a);\n" + + "}\n"); shader.append("in vec3 Normal;\n"); @@ -122,7 +122,8 @@ public static String vsh(boolean hasChunkOffset, ShaderAttributeInputs inputs, F shader.append("in vec2 UV0;\n"); shader.append("out vec2 texCoord;\n"); - main.append(" texCoord = UV0;\n"); + shader.append("uniform mat4 TextureMat;\n"); + main.append(" texCoord = (TextureMat * vec4(UV0, 0.0, 1.0)).xy;\n"); } // Fog @@ -244,4 +245,4 @@ public static String fsh(ShaderAttributeInputs inputs, FogMode fogMode, AlphaTes return shader.toString(); } -} +} \ No newline at end of file diff --git a/src/main/java/net/irisshaders/iris/shaderpack/properties/PackDirectives.java b/src/main/java/net/irisshaders/iris/shaderpack/properties/PackDirectives.java index 132a7e95b7..81bf50ae9b 100644 --- a/src/main/java/net/irisshaders/iris/shaderpack/properties/PackDirectives.java +++ b/src/main/java/net/irisshaders/iris/shaderpack/properties/PackDirectives.java @@ -22,6 +22,7 @@ public class PackDirectives { private final PackRenderTargetDirectives renderTargetDirectives; private final PackShadowDirectives shadowDirectives; private final float drynessHalfLife; + private int fallbackTex; private boolean supportsColorCorrection; private int noiseTextureResolution; private float sunPathRotation; @@ -89,6 +90,9 @@ public PackDirectives(Set supportedRenderTargets, ShaderProperties prop particleRenderingSettings = properties.getParticleRenderingSettings(); textureMap = properties.getCustomTexturePatching(); bufferObjects = properties.getBufferObjects(); + fallbackTex = properties.getFallbackTex(); + + } PackDirectives(Set supportedRenderTargets, PackDirectives directives) { @@ -106,6 +110,7 @@ public PackDirectives(Set supportedRenderTargets, ShaderProperties prop particleRenderingSettings = directives.particleRenderingSettings; textureMap = directives.textureMap; bufferObjects = directives.bufferObjects; + fallbackTex = directives.fallbackTex; } private static float clamp(float val, float lo, float hi) { @@ -312,4 +317,8 @@ public Vector2i getTextureScaleOverride(int index, int dimensionX, int dimension return scale; } + + public int getFallbackTex() { + return fallbackTex; + } } diff --git a/src/main/java/net/irisshaders/iris/shaderpack/properties/ProgramDirectives.java b/src/main/java/net/irisshaders/iris/shaderpack/properties/ProgramDirectives.java index 33b032c4c2..2f5d7c2df1 100644 --- a/src/main/java/net/irisshaders/iris/shaderpack/properties/ProgramDirectives.java +++ b/src/main/java/net/irisshaders/iris/shaderpack/properties/ProgramDirectives.java @@ -36,6 +36,7 @@ public class ProgramDirectives { private final ImmutableMap explicitFlips; private boolean unknownDrawBuffers; + private ProgramDirectives(int[] drawBuffers, ViewportData viewportScale, @Nullable AlphaTest alphaTestOverride, Optional blendModeOverride, List bufferBlendInformations, ImmutableSet mipmappedBuffers, ImmutableMap explicitFlips) { diff --git a/src/main/java/net/irisshaders/iris/shaderpack/properties/ShaderProperties.java b/src/main/java/net/irisshaders/iris/shaderpack/properties/ShaderProperties.java index 67faf6aa21..7d3d40d608 100644 --- a/src/main/java/net/irisshaders/iris/shaderpack/properties/ShaderProperties.java +++ b/src/main/java/net/irisshaders/iris/shaderpack/properties/ShaderProperties.java @@ -115,6 +115,9 @@ public class ShaderProperties { private List requiredFeatureFlags = new ArrayList<>(); private List optionalFeatureFlags = new ArrayList<>(); + private int fallbackTex = 0; + + private ShaderProperties() { // empty } @@ -222,6 +225,8 @@ public ShaderProperties(String contents, ShaderPackOptions shaderPackOptions, It }); handleBooleanDirective(key, value, "prepareBeforeShadow", bool -> prepareBeforeShadow = bool); handleBooleanDirective(key, value, "supportsColorCorrection", bool -> supportsColorCorrection = bool); + handleIntDirective(key, value, "fallbackTex", bool -> fallbackTex = bool); + if (key.startsWith("particles.ordering")) { Optional settings = ParticleRenderingSettings.fromString(value.trim().toUpperCase(Locale.US)); @@ -951,4 +956,8 @@ public CustomUniforms.Builder getCustomUniforms() { public CloudSetting getDHCloudSetting() { return dhCloudSetting; } + + public int getFallbackTex() { + return fallbackTex; + } } diff --git a/src/main/java/net/irisshaders/iris/shadows/ShadowRenderer.java b/src/main/java/net/irisshaders/iris/shadows/ShadowRenderer.java index bc759726c8..cf85f6ecd3 100644 --- a/src/main/java/net/irisshaders/iris/shadows/ShadowRenderer.java +++ b/src/main/java/net/irisshaders/iris/shadows/ShadowRenderer.java @@ -718,7 +718,6 @@ private String getBlockEntitiesDebugString() { } public void destroy() { - targets.destroy(); ((MemoryTrackingRenderBuffers) buffers).freeAndDeleteBuffers(); } From 6927c8a98d4daf6faf676234757af272ebe7703d Mon Sep 17 00:00:00 2001 From: YesVRC Date: Wed, 28 May 2025 14:10:29 -0400 Subject: [PATCH 4/9] IT'S ALIIIIIVE --- build.gradle | 2 +- .../net/irisshaders/iris/compat/SkipList.java | 15 ++++++ .../iris/mixin/MixinShaderInstance.java | 48 ++++++++++++++++--- .../pipeline/fallback/ShaderSynthesizer.java | 7 ++- .../pipeline/programs/ExtendedShader.java | 4 ++ .../programs/ShaderInstanceInterface.java | 3 ++ 6 files changed, 68 insertions(+), 11 deletions(-) create mode 100644 src/main/java/net/irisshaders/iris/compat/SkipList.java diff --git a/build.gradle b/build.gradle index e0c4f16519..9312e4c2b2 100644 --- a/build.gradle +++ b/build.gradle @@ -17,7 +17,7 @@ loom { "mixins.oculus.bettermipmaps.json", "mixins.oculus.fixes.maxfpscrash.json", "oculus-batched-entity-rendering.mixins.json", - //"mixins.oculus.compat.sodium.json", + "mixins.oculus.compat.sodium.json", "mixins.oculus.compat.indigo.json", "mixins.oculus.compat.indium.json", "mixins.oculus.compat.dh.json", diff --git a/src/main/java/net/irisshaders/iris/compat/SkipList.java b/src/main/java/net/irisshaders/iris/compat/SkipList.java new file mode 100644 index 0000000000..02a5d49220 --- /dev/null +++ b/src/main/java/net/irisshaders/iris/compat/SkipList.java @@ -0,0 +1,15 @@ +package net.irisshaders.iris.compat; + +import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.util.Map; + +public class SkipList { + public static Map, MethodHandle> shouldSkipList = new Object2ObjectOpenHashMap<>(); + + public static final MethodHandle NONE = MethodHandles.constant(Integer.class, 2); + + public static final MethodHandle ALWAYS = MethodHandles.constant(Integer.class, 1); +} diff --git a/src/main/java/net/irisshaders/iris/mixin/MixinShaderInstance.java b/src/main/java/net/irisshaders/iris/mixin/MixinShaderInstance.java index 9bd17f9475..271c8716ee 100644 --- a/src/main/java/net/irisshaders/iris/mixin/MixinShaderInstance.java +++ b/src/main/java/net/irisshaders/iris/mixin/MixinShaderInstance.java @@ -7,6 +7,7 @@ import com.mojang.blaze3d.vertex.VertexFormat; import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; import net.irisshaders.iris.Iris; +import net.irisshaders.iris.compat.SkipList; import net.irisshaders.iris.gl.GLDebug; import net.irisshaders.iris.gl.IrisRenderSystem; import net.irisshaders.iris.gl.blending.DepthColorStorage; @@ -17,6 +18,7 @@ import net.irisshaders.iris.pipeline.programs.FallbackShader; import net.irisshaders.iris.pipeline.programs.ShaderInstanceInterface; import net.irisshaders.iris.shadows.ShadowRenderer; +import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.ShaderInstance; import net.minecraft.resources.ResourceLocation; import net.minecraft.server.packs.resources.ResourceProvider; @@ -76,6 +78,11 @@ public abstract class MixinShaderInstance implements ShaderInstanceInterface { shouldSkipList.put(FallbackShader.class, NONE); } + @Override + public void setShouldSkip(MethodHandle s) { + shouldSkip = s; + } + @Inject(method = "(Lnet/minecraft/server/packs/resources/ResourceProvider;Lnet/minecraft/resources/ResourceLocation;Lcom/mojang/blaze3d/vertex/VertexFormat;)V", at = @At("TAIL"), require = 0) private void iriss$storeSkip(ResourceProvider resourceProvider, ResourceLocation string, VertexFormat vertexFormat, CallbackInfo ci) { shouldSkip = shouldSkipList.computeIfAbsent(getClass(), x -> { @@ -113,6 +120,7 @@ public abstract class MixinShaderInstance implements ShaderInstanceInterface { } } + @Unique private static boolean shouldOverrideShaders() { WorldRenderingPipeline pipeline = Iris.getPipelineManager().getPipelineNullable(); @@ -152,22 +160,30 @@ private void name(ResourceProvider resourceProvider, String string, VertexFormat GLDebug.nameObject(KHRDebug.GL_SHADER, this.fragmentProgram.getId(), string); } - @Inject(method = "apply", at = @At("TAIL")) + @Inject(method = "apply", at = @At("HEAD")) private void iris$lockDepthColorState(CallbackInfo ci) { - if (((Object) this) instanceof ExtendedShader || ((Object) this) instanceof FallbackShader || !shouldOverrideShaders()) { - return; + if (lastAppliedShader != null) { + lastAppliedShader.clear(); + lastAppliedShader = null; } - - DepthColorStorage.disableDepthColor(); } @Inject(method = "clear", at = @At("HEAD")) private void iris$unlockDepthColorState(CallbackInfo ci) { - if (((Object) this) instanceof ExtendedShader || ((Object) this) instanceof FallbackShader || !shouldOverrideShaders()) { + if (!iris$shouldSkipThis()) { + if (!isKnownShader() && shouldOverrideShaders()) { + WorldRenderingPipeline pipeline = Iris.getPipelineManager().getPipelineNullable(); + + if (pipeline instanceof IrisRenderingPipeline) { + Minecraft.getInstance().getMainRenderTarget().bindWrite(false); + } + } + return; } DepthColorStorage.unlockDepthColor(); + } @Inject(method = "apply", at = @At("TAIL")) @@ -201,6 +217,26 @@ private boolean isKnownShader() { return GsonHelper.parse(reader); } + @Inject(method = "(Lnet/minecraft/server/packs/resources/ResourceProvider;Lnet/minecraft/resources/ResourceLocation;Lcom/mojang/blaze3d/vertex/VertexFormat;)V", at = @At("TAIL"), require = 0) + private void iriss$storeSkipNeo(ResourceProvider resourceProvider, ResourceLocation string, VertexFormat vertexFormat, CallbackInfo ci) { + MethodHandle shouldSkip = shouldSkipList.computeIfAbsent(getClass(), x -> { + try { + MethodHandle iris$skipDraw = MethodHandles.lookup().findVirtual(x, "iris$skipDraw", MethodType.methodType(boolean.class)); + Iris.logger.warn("Class " + x.getName() + " has opted out of being rendered with shaders."); + return iris$skipDraw; + } catch (NoSuchMethodException | IllegalAccessException e) { + return SkipList.NONE; + } + }); + + + if (Iris.getIrisConfig().shouldSkip(string)) { + shouldSkip = ALWAYS; + } + + ((ShaderInstanceInterface) this).setShouldSkip(shouldSkip); + } + @Override public void iris$createExtraShaders(ResourceProvider provider, ResourceLocation name) { diff --git a/src/main/java/net/irisshaders/iris/pipeline/fallback/ShaderSynthesizer.java b/src/main/java/net/irisshaders/iris/pipeline/fallback/ShaderSynthesizer.java index 7af4f94969..1d3a0cb742 100644 --- a/src/main/java/net/irisshaders/iris/pipeline/fallback/ShaderSynthesizer.java +++ b/src/main/java/net/irisshaders/iris/pipeline/fallback/ShaderSynthesizer.java @@ -82,8 +82,8 @@ public static String vsh(boolean hasChunkOffset, ShaderAttributeInputs inputs, F // Copied from Mojang code. shader.append("vec4 minecraft_mix_light(vec3 lightDir0, vec3 lightDir1, vec3 normal, vec4 color) {\n" + - // " lightDir0 = normalize(lightDir0);\n" + - // " lightDir1 = normalize(lightDir1);\n" + + " lightDir0 = normalize(lightDir0);\n" + + " lightDir1 = normalize(lightDir1);\n" + " float light0 = max(0.0, dot(lightDir0, normal));\n" + " float light1 = max(0.0, dot(lightDir1, normal));\n" + " float lightAccum = min(1.0, (light0 + light1) * 0.6 + 0.4);\n" + @@ -122,8 +122,7 @@ public static String vsh(boolean hasChunkOffset, ShaderAttributeInputs inputs, F shader.append("in vec2 UV0;\n"); shader.append("out vec2 texCoord;\n"); - shader.append("uniform mat4 TextureMat;\n"); - main.append(" texCoord = (TextureMat * vec4(UV0, 0.0, 1.0)).xy;\n"); + main.append(" texCoord = UV0;\n"); } // Fog diff --git a/src/main/java/net/irisshaders/iris/pipeline/programs/ExtendedShader.java b/src/main/java/net/irisshaders/iris/pipeline/programs/ExtendedShader.java index c18dbcfd5a..aba569cecf 100644 --- a/src/main/java/net/irisshaders/iris/pipeline/programs/ExtendedShader.java +++ b/src/main/java/net/irisshaders/iris/pipeline/programs/ExtendedShader.java @@ -38,6 +38,7 @@ import org.lwjgl.opengl.KHRDebug; import java.io.IOException; +import java.lang.invoke.MethodHandle; import java.util.List; import java.util.function.BiConsumer; import java.util.function.Consumer; @@ -276,6 +277,9 @@ public String applyImport(boolean bl, String string) { }); } + @Override + public void setShouldSkip(MethodHandle s) {} + public Program getGeometry() { return this.geometry; } diff --git a/src/main/java/net/irisshaders/iris/pipeline/programs/ShaderInstanceInterface.java b/src/main/java/net/irisshaders/iris/pipeline/programs/ShaderInstanceInterface.java index d374cf1a8c..dc30b25c59 100644 --- a/src/main/java/net/irisshaders/iris/pipeline/programs/ShaderInstanceInterface.java +++ b/src/main/java/net/irisshaders/iris/pipeline/programs/ShaderInstanceInterface.java @@ -4,7 +4,10 @@ import net.minecraft.server.packs.resources.ResourceProvider; import java.io.IOException; +import java.lang.invoke.MethodHandle; public interface ShaderInstanceInterface { void iris$createExtraShaders(ResourceProvider factory, ResourceLocation name) throws IOException; + + void setShouldSkip(MethodHandle s); } From e5e53859404ed187e3636527f2e35410ecdd8719 Mon Sep 17 00:00:00 2001 From: YesVRC Date: Wed, 28 May 2025 23:44:43 -0400 Subject: [PATCH 5/9] Ready for PR --- gradle.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index e5b8ecf860..c4568377a9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,10 +6,10 @@ loom.platform = forge # Fabric Properties # check these on https://fabricmc.net/develop minecraft_version=1.20.1 - forge_version=47.1.105 + forge_version=47.4.0 # Mod Properties - mod_version = 1.8.0 + mod_version = 1.8.1 maven_group = net.coderbot archives_base_name = oculus From a506782072d1e7d6ee919bba5b87837abcdce4f8 Mon Sep 17 00:00:00 2001 From: YesVRC Date: Thu, 29 May 2025 02:50:13 -0400 Subject: [PATCH 6/9] ???? --- build.gradle | 2 +- gradle.properties | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/build.gradle b/build.gradle index 9312e4c2b2..70378e9490 100644 --- a/build.gradle +++ b/build.gradle @@ -172,4 +172,4 @@ publishing { repositories { } -} +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index c4568377a9..e3c70c5e71 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,14 +4,14 @@ org.gradle.jvmargs=-Xmx3G loom.platform = forge # Fabric Properties - # check these on https://fabricmc.net/develop - minecraft_version=1.20.1 - forge_version=47.4.0 +# check these on https://fabricmc.net/develop +minecraft_version=1.20.1 +forge_version=47.1.105 # Mod Properties - mod_version = 1.8.1 - maven_group = net.coderbot - archives_base_name = oculus +mod_version = 1.8.1 +maven_group = net.coderbot +archives_base_name = oculus # Dependencies - embeddium_version=0.3.31-beta.53+mc1.20.1 +embeddium_version=0.3.31-beta.53+mc1.20.1 \ No newline at end of file From 7a06375991b6c06986b93a5e92d7220edd3eb881 Mon Sep 17 00:00:00 2001 From: YesVRC Date: Thu, 29 May 2025 02:54:08 -0400 Subject: [PATCH 7/9] here we go again --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 70378e9490..af366789b7 100644 --- a/build.gradle +++ b/build.gradle @@ -107,7 +107,7 @@ repositories { dependencies { minecraft "com.mojang:minecraft:${minecraft_version}" mappings loom.officialMojangMappings() - forge "net.neoforged:forge:${minecraft_version}-${forge_version}" + forge "net.minecraftforge:forge:${minecraft_version}-${forge_version}" modImplementation "org.embeddedt:embeddium-${minecraft_version}:${embeddium_version}" modCompileOnly("maven.modrinth:distanthorizonsapi:3.0.0") From b5bbacb7bb74b73126243a0717d6069de29cd1cc Mon Sep 17 00:00:00 2001 From: Yes <85800291+YesVRC@users.noreply.github.com> Date: Tue, 3 Jun 2025 16:31:03 -0400 Subject: [PATCH 8/9] Update gradle.properties --- gradle.properties | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index e3c70c5e71..0d2ef79a3b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,7 +6,8 @@ loom.platform = forge # Fabric Properties # check these on https://fabricmc.net/develop minecraft_version=1.20.1 -forge_version=47.1.105 +forge_version=47.4.0 +neoforge_version=47.1.105 # Mod Properties mod_version = 1.8.1 @@ -14,4 +15,4 @@ maven_group = net.coderbot archives_base_name = oculus # Dependencies -embeddium_version=0.3.31-beta.53+mc1.20.1 \ No newline at end of file +embeddium_version=0.3.31-beta.53+mc1.20.1 From 0353398e623d159e977fef7d48b001953a02bc15 Mon Sep 17 00:00:00 2001 From: Yes <85800291+YesVRC@users.noreply.github.com> Date: Tue, 3 Jun 2025 16:32:42 -0400 Subject: [PATCH 9/9] Update build.gradle --- build.gradle | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index af366789b7..cbf1fc6584 100644 --- a/build.gradle +++ b/build.gradle @@ -107,6 +107,7 @@ repositories { dependencies { minecraft "com.mojang:minecraft:${minecraft_version}" mappings loom.officialMojangMappings() + //forge "net.neoforged:forge:${minecraft_version}-${neoforge_version}" forge "net.minecraftforge:forge:${minecraft_version}-${forge_version}" modImplementation "org.embeddedt:embeddium-${minecraft_version}:${embeddium_version}" @@ -172,4 +173,4 @@ publishing { repositories { } -} \ No newline at end of file +}