Mekanism Additions

Mekanism Additions

21M Downloads

Optimize Universal cable rendering or disable it by default in config.

ManIkWeet opened this issue · 11 comments

commented

Issue description:

In a nice empty world it's not difficult to get 300-400FPS... Until you place down and power 8 stacks of Universal cables... Suddenly 30fps! It is not uncommon to have long running power cables all over your (sky)base. Other power carrying cables don't seem to suffer this issue (for example 8 stacks of EnderIO conduits still manage 300FPS).

There is an issue on GitHub from 2013 about this, and it has spawned a config option to change. This config option is still available in the current versions, albeit a bit oddly named (OpaqueTransmitterRender).

Either optimize the Universal cables to not completely destroy FPS when a few of them are placed, or have their fancy rendering disabled by default.

Steps to reproduce:

  1. Load empty world
  2. Place an 8x8x8 cube of Universal cables
  3. Power them
  4. Feel the FPS destruction.

Version (make sure you are on the latest version before reporting):

Forge: 14.23.4.2705
Mekanism: 1.12.2-9.4.13.349

commented

albeit a bit oddly named (OpaqueTransmitterRender)

how is that odd? it describes exactly what it does

If your setup can handle it with that option turned on, the problem is probably with your rig.

commented
  1. Feel the FPS destruction.

That's also not a repro step.

commented

OpaqueRender is clear, but transmitter doesn't scream "universal cable" or "logistical transporter" to me.

My rig is a bit old, I won't deny that. But you'd think that a pc that can easily play GTAV for example should be able to render 8 stacks of connected cables in minecraft.

Feeling FPS destruction is indeed not a step to reproduce the issue, but pressing F3 and looking at the little counter to see a drop in FPS might be.

Admittedly, I have this issue in a large mod pack, I will try to reproduce it with just Mekanism, and on a different computer.

commented

Alright, I installed a fresh instance of Minecraft, added Mekanism 1.12.2-9.4.13.349 and Better Builder's Wands 1.12-0.11.1.245+69d0d70 on a different, newer system... The results:

2018-08-02_07 57 33

commented

I don't make any clams as to how optimised it is (I didn't write it), but what exactly do you expect for 512 TESRs?

commented

I expect my performance to not be tanking to 35-40FPS. Some FPS drop is fine, and should be expected, but 35-40FPS has a very clear and direct negative impact on my experience.

When I subject other mods to this same "torture" test, FPS isn't impacted nearly as much.

commented

Perhaps migrating the TESRs to forge's FastTESRs might yield performance improvements?

The forge documentation says that FastTESRs should be used whenever possible.
https://mcforge.readthedocs.io/en/latest/tileentities/tesr/#fasttesr

commented

fasttesr won't work for glowing models iirc.

commented

Makes sense, as the glowing thing needs two render-calls, one with lighting disabled... Simple enough to make them not glowing though (still changing color, just not always-bright)

commented

Closing this as I have optimized the rendering code some in 1.15, as well as, FastTESRs no longer exist, due to all TERs being "fast"

commented

Opening this again, mainly to just throw it in the fixed in dev and 9.9.18 milestone as I did some more profiling and further improved this (8x8x8 of universal cables, fps cap set at 150):
2020-03-27_19 08 48