forked from Asek3/Oculus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backport DH support from Iris 1.6.11 into Oculus (Use PixelBuilder sh…
…adow fix for DH)
- Loading branch information
Showing
8 changed files
with
126 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package net.coderbot.iris.compat.dh; | ||
|
||
import net.coderbot.iris.gl.framebuffer.GlFramebuffer; | ||
|
||
public class DHCompat { | ||
private GlFramebuffer fb; | ||
|
||
public int getFramebuffer() { | ||
return fb.getId(); | ||
} | ||
|
||
public void setFramebuffer(GlFramebuffer fb) { | ||
this.fb = fb; | ||
} | ||
} |
51 changes: 51 additions & 0 deletions
51
src/main/java/net/coderbot/iris/compat/dh/mixin/IrisDHCompatMixinPlugin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package net.coderbot.iris.compat.dh.mixin; | ||
|
||
import org.objectweb.asm.tree.ClassNode; | ||
import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin; | ||
import org.spongepowered.asm.mixin.extensibility.IMixinInfo; | ||
|
||
import net.minecraftforge.fml.loading.FMLLoader; | ||
|
||
import java.util.List; | ||
import java.util.Set; | ||
|
||
/** | ||
* Non-critical mixin config plugin, just disables mixins if Distant Horizons isn't present, | ||
* since otherwise the log gets spammed with warnings. | ||
*/ | ||
public class IrisDHCompatMixinPlugin implements IMixinConfigPlugin { | ||
@Override | ||
public void onLoad(String mixinPackage) { | ||
|
||
} | ||
|
||
@Override | ||
public String getRefMapperConfig() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public boolean shouldApplyMixin(String targetClassName, String mixinClassName) { | ||
return FMLLoader.getLoadingModList().getModFileById("distanthorizons") != null; | ||
} | ||
|
||
@Override | ||
public void acceptTargets(Set<String> myTargets, Set<String> otherTargets) { | ||
|
||
} | ||
|
||
@Override | ||
public List<String> getMixins() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public void preApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) { | ||
|
||
} | ||
|
||
@Override | ||
public void postApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) { | ||
|
||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/main/java/net/coderbot/iris/compat/dh/mixin/MixinDHApplyShader.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package net.coderbot.iris.compat.dh.mixin; | ||
|
||
import com.seibel.distanthorizons.core.render.renderer.shaders.DhApplyShader; | ||
import com.seibel.distanthorizons.core.wrapperInterfaces.minecraft.IMinecraftRenderWrapper; | ||
import net.coderbot.iris.Iris; | ||
import net.coderbot.iris.pipeline.WorldRenderingPipeline; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
|
||
@Mixin(value = DhApplyShader.class, remap = false) | ||
public class MixinDHApplyShader { | ||
@Redirect(method = "onRender", at = @At(value = "INVOKE", target = "Lcom/seibel/distanthorizons/core/wrapperInterfaces/minecraft/IMinecraftRenderWrapper;getTargetFrameBuffer()I")) | ||
private int changeFB(IMinecraftRenderWrapper instance) { | ||
WorldRenderingPipeline pipeline = Iris.getPipelineManager().getPipelineNullable(); | ||
if (pipeline.getDHCompat() != null) { | ||
return pipeline.getDHCompat().getFramebuffer(); | ||
} else { | ||
return instance.getTargetFrameBuffer(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"required": true, | ||
"minVersion": "0.8", | ||
"plugin": "net.coderbot.iris.compat.dh.mixin.IrisDHCompatMixinPlugin", | ||
"package": "net.coderbot.iris.compat.dh.mixin", | ||
"compatibilityLevel": "JAVA_8", | ||
"client": [ | ||
"MixinDHApplyShader" | ||
], | ||
"injectors": { | ||
"defaultRequire": 1 | ||
} | ||
} |
714ead3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
skull emoji
714ead3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad!
714ead3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@IMS212 Don't mean to burden you with random mod compatibility issues, however I was wondering if maybe you would know anything about this kind of log spam?
This is happening with the fork of Complementary which was made for Iris 1.6.11. Basically, the shaders work fine until after a few minutes when suddenly Computercraft Consoles (the UI, not the monitors) become transparent.
I was just wondering if there were any fixes you have made in newer versions of Iris which come to mind? If so then I could also backport those fixes to see if they fix my issue :)
714ead3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can’t really help with that; the whole pipeline was written to be 1.18 exclusive.