Skip to content

Commit

Permalink
temp render fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ferriarnus committed May 21, 2024
1 parent d2d6838 commit 3eae037
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
import com.replaymod.render.hooks.EntityRendererHandler;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.hud.InGameHud;
import net.minecraftforge.client.gui.overlay.ForgeGui;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

//#if MC>=11400
@Mixin(InGameHud.class)
@Mixin(ForgeGui.class)
//#else
//$$ @Mixin({ GuiIngame.class, net.minecraftforge.client.GuiIngameForge.class })
//#endif
Expand Down
32 changes: 16 additions & 16 deletions src/main/java/com/replaymod/render/rendering/VideoRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -666,22 +666,22 @@ public static String[] checkCompat(Stream<RenderSettings> settings) {

public static String[] checkCompat(RenderSettings settings) {
//#if FABRIC>=1
if (LoadingModList.get().getModFileById("embeddium") != null && !FlawlessFrames.hasSodium()) {
return new String[] {
"Rendering is not supported with your Sodium version.",
"It is missing support for the FREX Flawless Frames API.",
"Either use the Sodium build from replaymod.com or uninstall Sodium before rendering!",
};
}
//#if MC>=11700
if (settings.getRenderMethod() == RenderSettings.RenderMethod.ODS
&& LoadingModList.get().getModFileById("oculus") == null) {
return new String[] {
"ODS export requires Iris to be installed for Minecraft 1.17 and above.",
"Note that it is nevertheless incompatible with other shaders and will simply replace them.",
"Get it from: https://irisshaders.net/",
};
}
// if (LoadingModList.get().getModFileById("embeddium") != null && !FlawlessFrames.hasSodium()) {
// return new String[] {
// "Rendering is not supported with your Sodium version.",
// "It is missing support for the FREX Flawless Frames API.",
// "Either use the Sodium build from replaymod.com or uninstall Sodium before rendering!",
// };
// }
// //#if MC>=11700
// if (settings.getRenderMethod() == RenderSettings.RenderMethod.ODS
// && LoadingModList.get().getModFileById("oculus") == null) {
// return new String[] {
// "ODS export requires Iris to be installed for Minecraft 1.17 and above.",
// "Note that it is nevertheless incompatible with other shaders and will simply replace them.",
// "Get it from: https://irisshaders.net/",
// };
// }
//#endif
//#endif
return null;
Expand Down

4 comments on commit 3eae037

@VladisCrafter
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like how you can fix an intended restriction with just... disabling it. And nothing really breaks.
Now I wonder, why was it made on purpose by Replay devs?

@ferriarnus
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The frex api allows you to tell other mods to generate "a perfect frame". Sodium has their own impl of this that loads all chunks (and maybe does some extra stuff). By removing this check, we simply do stuff the vanilla way, as if no sodium was found. The FREX api isn't really used on forge, which means no alternative at the moment. I might look into it with embeddedt and su5ed a bit more, but since this hasn't come up yet, their simply might be no mods wanting it on forge.

@VladisCrafter
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please describe this API a bit more, @ferriarnus? If it won't be used while rendering, what type of impact would it occur on the result? Whether it can be just rendering speed or critical stuff like frame quality?

@ferriarnus
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So from what I understand, the api tells sodium to render without caring about actual "performance". What sodium then does is purely on them as there is no standard. However I think all sodium does is force all the chunks to rendered. Now I use replay mods system for vanilla chunks, which seems to work fine for sodium as well. I don't think other settings are changed.

Please sign in to comment.