
Significant framestuttering when using emissive plugin on 1.20.1 versus without
nathanpaulyoung opened this issue · 26 comments
Describe the bug
In my modpack, when I have the emissive plugin enabled, I get intense frame stuttering. The stuttering happens in-world and on GUI screens, and appears to be related to loading (not generating) new chunks, as it happens on single player and on a server, and once all chunks within view distance have loaded in, if the player does not move and load more chunks, the issue disappears.
To reproduce
See video.
Expected behavior
Consistent framerate.
Screenshots or videos
The following is a video captured of the difference in framerate between the pack without the emissives plugin as compared to with.
https://youtu.be/dby2AIo1_-c
Which Minecraft versions does this bug affect?
1.20.1 the issue did not appear in 1.19.2
Mod loader
Which mod loaders does this bug affect?
- Forge
- Fabric
Mods list
See beginning of video.
Resource pack
None are active during the test. See end of video.
Additional context
N/A
1.20.1 the issue did not appear in 1.19.2
Thanks for testing both versions. There was a change between these two versions that is very likely the cause of this issue. I'll post a development version for you to test once I figure out how to work around the problem.
Fantastic! Thanks for the quick response. I'll keep an eye on this issue for that development version. If you for whatever reason would like a copy of the modpack, let me know.
Here's a development version that should resolve the issue. I've noticed a performance improvement when running around the world without any emissive packs active, though the performance was never anywhere near as bad on my machine as in the video. (Hence, it wasn't fixed previously.)
emissive-plugin-forge-1.20.1-1.20-model-wrap-performance-fix-20231020.064722-4-forge.zip
These changes will most likely be included with the 2.x release (see #7) since those changes should just need testing now. I'm hoping there will be a release this weekend if there are no issues discovered with the transparency changes.
I can't reproduce the z-fighting issue with vanilla ores; are you only seeing this issue for modded ores? If so, this issue will most likely be fixed in the 2.x release.
Here's a video I took with the version of the mod I sent you. Is it subtle enough that I missed it in this video?
e2fbdcc0-7ca3-46b1-8cd0-35cea19cf9f0.-.Trim.mp4
2023-10-21.13-25-31_converted.mp4
Here are the resourcepacks and here is the full modpack. Definitely not seeing it in your video.
Funnily enough I was just researching cause on fabric 1.20.1 I am also experiencing the same stuttering problem, but aswell when using the emissive plugin some of Create's mod 3D items like the wrench turn invisible aswell the sandpaper and Supplementaries Enderman Head. With just the core, it all works just fine. But heres another problem why I'm trying to use this emissive mod, is because theres z-fighting at certain angles with continuity's emissive ores. Thoughts?
2023-10-21.13-25-31_converted.mp4
Here are the resourcepacks and here is the full modpack. Definitely not seeing it in your video.
I have the same visual problem when using Continuity's Emissive ores but not with this plugin, on fabric 1.20.1
Continuity adds emissive overlays for blocks like this mod does. So when you use this emissive plugin with Continuity, there's an overlay from Continuity and and overlay from this mod that will start z-fighting. I think there is a way to disable the emissive block overlays from Continuity in that mod's settings.
I will need to look into the problem on Forge more closely because I'm assuming there's only one mod creating overlays.
Continuity adds emissive overlays for blocks like this mod does. So when you use this emissive plugin with Continuity, there's an overlay from Continuity and and overlay from this mod that will start z-fighting. I think there is a way to disable the emissive block overlays from Continuity in that mod's settings.
I will need to look into the problem on Forge more closely because I'm assuming there's only one mod creating overlays.
I'm sorry I might have had to clarify better, when using Continuity without mcmeta at all, I get z-fighting for some reason, hence why I disabled it and turned to this mod to try it.
Runs beautifully! Nicely done, and thanks! Should I add this to my group's modpack, or will the 2.x release be out soon enough for me to just have them update through Prism Launcher?
EDIT: There's a little bit of z-fighting on ores at certain angles. Very subtle. Do you know about that already, or would another video be helpful?
The 2.x release will be out soon enough that you should wait for that.
There are some known issues with z-fighting that should be fixed in the 2.x release (#4), though I haven't seen it for ores. Can you upload the resource pack you're using?
Were the z-fighting issues also happening in the latest release version?
Ah okay, thanks for clarifying.
I am also experiencing the same stuttering problem, but aswell when using the emissive plugin some of Create's mod 3D items like the wrench turn invisible aswell the sandpaper and Supplementaries Enderman Head
The fix that resolves the stuttering problem will very likely fix this issue. I'm aiming to get a release out with these fixes this weekend. Most likely there will be a release regardless of the cause of the z-fighting problem because I think the stuttering issue is severe enough.
Funnily enough I was just researching cause on fabric 1.20.1 I am also experiencing the same stuttering problem, but aswell when using the emissive plugin some of Create's mod 3D items like the wrench turn invisible aswell the sandpaper and Supplementaries Enderman Head. With just the core, it all works just fine. But heres another problem why I'm trying to use this emissive mod, is because theres z-fighting at certain angles with continuity's emissive ores. Thoughts?
Adding to this:
heres how it normaly looks with just emissive plugin disabled
and here they become invisible when turning on the plugin
2023-10-21.13-25-31_converted.mp4
Here are the resourcepacks and here is the full modpack. Definitely not seeing it in your video.
@nathanpaulyoung Thanks for providing the modpack. I've narrowed the z-fighting issue down to a problem with Embeddium. I was hoping the transparency changes in 2.x would fix this, but they don't seem to.
I'm leaning toward marking the z-fighting issue with Embeddium a won't-fix since I can't reproduce this when Embeddium isn't present. To fix this, I'd need to adjust the position of the overlay quads slightly. I tried such a fix for a similar issue (#4), and it didn't work well. There's also a possible performance impact from recalculating the positions of all the quads, though probably very small. I am going to proceed with the 2.x release; I'll ping you if I decide to create a new tracking issue for the z-fighting problem.
I've run through final testing with the Forge version of this mod on all MC versions; I just need to run through all the Fabric versions before a release.
2023-10-21.13-25-31_converted.mp4
Here are the resourcepacks and here is the full modpack. Definitely not seeing it in your video.@nathanpaulyoung Thanks for providing the modpack. I've narrowed the z-fighting issue down to a problem with Embeddium. I was hoping the transparency changes in 2.x would fix this, but they don't seem to.
I'm leaning toward marking the z-fighting issue with Embeddium a won't-fix since I can't reproduce this when Embeddium isn't present. To fix this, I'd need to adjust the position of the overlay quads slightly. I tried such a fix for a similar issue (#4), and it didn't work well. There's also a possible performance impact from recalculating the positions of all the quads, though probably very small. I am going to proceed with the 2.x release; I'll ping you if I decide to create a new tracking issue for the z-fighting problem.
I'm leaning toward marking the z-fighting issue with Embeddium a won't-fix since I can't reproduce this when Embeddium isn't present.
Ah gotcha! I'll have to test with Rubidium to see if it's Embeddium's experimental stuff or if it's further upstream. Are you considering passing the info along to them as an issue for them to fix?
I found the existing issue FiniteReality/embeddium#60 that is very likely the underlying problem. Unfortunately, it looks like I can't disable the compact vertex format with your modpack since Oculus is installed.
The offset they suggested might be workable; I'll have to test if it's feasible to add to the emissive plugin.
Unfortunately, there is/was also an incompatibility with Rubidium (#2) because they don't support lighting features added by Forge. Someone commented that this has been fixed on 1.19.2, not sure about 1.20.1.
@DominikGrz It looks like the fix for the stuttering problem has also fixed the Create invisible inventory issues.
In MC 1.19.4, Mojang removed some code that allowed me to query all materials used by a 3D model. I used this to apply special code that enables emissive textures to only the models that needed them. To work around that removal, I ended up enabling that code for all models. (When I was first porting this mod to the newer versions, the performance problems were not apparent.) To fix the stuttering, I've added some filtering that should apply the special code to (1) models of known type that need it and (2) models of unknown type. This means the emissive code shouldn't be applied to Create models anymore.
Version 2.0.0 has been released, which should fix this issue. It will take a few minutes for the files to be approved on CurseForge.
@nathanpaulyoung I've created a new tracking issue for the z-fighting issue: #10. I will provide further updates there about the status and whether this is something that makes sense to fix on MoreMcmeta's side.
@DominikGrz please create a new issue if you still notice problems with models in the inventory on the new version.
I am having the same framestuttering issue with the Emissive plugin on Forge 1.19.2, in a rather heavily modded instance. The issue disappears when running MoreMCMeta without the emissive plugin.
@zaeonNineZero Does the issue still appear when you don't have any resource packs applied besides the default ones? If not, can you send a link to the emissive resource pack(s) you're using?
I will test using no resource packs and see if anything changes, and follow up with the results.
Tested with no external resource packs (only built-in ones from mods), and the framestuttering still occurs.
Thanks for confirming. Are you using the latest emissive plugin version (2.0.1)? Can you check if it happens when no other mods are present (besides MoreMcmeta)? The latest 1.19.2 version should only apply emissive effects to models that need it, so I'm wondering if there's something added by another mod that's causing the emissive effects to be applied to all models since I can't reproduce this locally.
Yes I'm using the latest emissive plugin and MoreMcmeta versions. I tested it without any other mods and the issue does not occur. I think you're on to something w/ emissive effects being applied across all models.
I'll try loading various mods to see if/when the issue re-emerges. I have some mods that use custom model systems, which could be part of the problem. Mekanism in particularly is one I'm eyeing.
I installed Mekanism, Create, and Quark together with the MoreMcmeta + Emissive Plugin setup, and immediately noticed increased frame stutter (though not as severe as the stuttering from my much larger modded setup). So perhaps the issue is related to the game loading a large number of texture files at once.
Update 1: I removed each one individually and found that performance improves most after removing Quark and its dependency AutoRegLib. I don't know if this plays any role beyond the aforementioned texture file count, but it might be worth taking a peak at.
@zaeonNineZero Thanks for checking your mod list. I've created a new issue to track the stuttering problem with Quark, so I'll post further updates there: #12.
I think it's most likely not a texture problem because texture loading is primarily handled by the core MoreMcmeta mod. The emissive plugin doesn't do much with texture loading besides stitching overlay textures to the block atlas, but that would primarily impact the game's load time before you get into a world. My guess is that Quark is using a complex model that is causing extra overlay quads to be generated. There was one model in vanilla Minecraft that had this issue, so I think this problem might be similar; the fix for that might not apply to Quark's models. I'll see if I can implement a fix and post a development version for you to test.