MehVahdJukaar / modelfix-multi

GNU General Public License v3.0
25 stars 8 forks source link

Massive lag from items/blocks(?) that utilize emissive textures (*_e.png) #16

Open coornio opened 1 year ago

coornio commented 1 year ago

chest with random contents: image

chest with items that have emissive textures (lava bucket in this case) image2

This test was conducted using the John Smith Legacy resource pack. Another item that can be used to test is the Glistering Melon Slice from that same pack.

The platform used was 1.19.2, with Fabric Loader. A variety of other mods are present, such as Entity Texture Features. Not sure yet if I should suspect a third party mod being responsible for some sort of conflict, or if this issue occurs when using any resource packs that utilize emissive textures when supported regardless of mod loader. For example, I haven't tested if the same resource pack would result in the same abysmal fps issue if I were to use it on Forge with OptiFine installed.

MehVahdJukaar commented 1 year ago

Idk how those work but I overwrite the method which generates item quads. In vanilla it ends up being more optimized but it's just slightly different. So Is entity texture feature the one that adds that emissive layer?

coornio commented 1 year ago

Technically it's the mod that enables its use in Fabric outside of shaders, at least as far as I understand myself. I did test explicitly disabling it though, and it did not have an effect, the framerate was still tanking. I am not entirely sure why your method seems to dislike items with emissive textures. I will set up another test and try to find out if there's some conflict going on, or if your approach simply hates them :P

For reference, none of the handling methods offered by a competitor mod called Item Model Fix result in the same behavior. You might also be able to draw some inspiration from it.

I'll get back to you here soon-ish when I've gone through my testing on a blank slate.

coornio commented 1 year ago

I'm back. After further testing, I isolated the bug to the following bare minimums for reproduction:

1) A Fabric loader-enabled MC release 2) A resource pack that has connected textures, AND items with emissive properties, such as the aforementioned JSL 3) Continuity mod (connected textures support from optifine format) [+ Indium if running with Sodium]

Seems the bug might be related to #12, except instead of getting a crash/error outright, it results in these massive lag spikes?

EDIT: The aforementioned competitor mod also suffers from the same framerate tanking when employing its "Pixel" method of resolving these gaps. The result of your mod and the competitor's is the same, so it appears this problem may not be entirely on your court, but has something to do with Continuity.

If you're able to test the Forge mod loader with your mod, then install Optifine as a mod to it, we'll know for sure where to point fingers. If the issue persists, then the particular method of fixing the gaps is somehow connected to the lag. If not, then we can narrow the scope down further to Continuity having some sort of conflict with emissive textures (whether actually in-use or not) being present for items when your mod (and the competing one) are present.

MehVahdJukaar commented 1 year ago

I've had other unrelated reports of issues with continuity. Id say it's safe to assume issue might be an oversight on their end. I'll probably add a config to disable the custom item models as those aren't exactly needed anyways since the main fix is somewhere else

coornio commented 1 year ago

Not sure I follow, what do you mean by "disable the custom item models" ?

It's very likely this is entirely Continuity's fault in this case. Sure, the "pixel" fix option of the competitor mod and yours get practically identical frame dips when continuity has their "Emissive Item Textures" option enabled. I'll see if I can poke them about the situation and whether it might result in some sort of fix.

Edit: issue ticket on their end: https://github.com/PepperCode1/Continuity/issues/208