Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Huge performance impact when using several trophies #5

Open
oddlama opened this issue May 27, 2019 · 3 comments
Open

Huge performance impact when using several trophies #5

oddlama opened this issue May 27, 2019 · 3 comments
Labels
help wanted Extra attention is needed

Comments

@oddlama
Copy link

oddlama commented May 27, 2019

I just wanted to point out, that when having several trophies rendered (~30 trophies) I and several other people noticed a huge rendering performance impact. We noticed this while playing the FTB Interactions pack, in case you want to easily reproduce our setup.
(50 fps without trophies, 12 fps with them.)

We have tried using optifine, but due to shadow map rendering this is even worse.

I have noticed you use roughly the same code for rendering the item stacks and the tile entities, so I suspected it might be easily reproducable by putting a double chest full of trophies, and simply opening it. Turns out this is the case and it immediately lowers your fps to a third of the original value.

I cannot accurately say what is causing the problem, but in the debug profiler of minecraft (https://imgur.com/a/Q386B) you can observe that nothing changes, but the fps are affected heavily. Therefore, it must be in unprofiled code, or a really suboptimal graphics pipline state change.

@quat1024
Copy link
Owner

50 fps without trophies, 12 fps with them.

ouch! thanks for bringing this up, wow! will check it out

@quat1024
Copy link
Owner

quat1024 commented May 27, 2019

I genuinely have no idea what is going on here.

On the tile entity, I just render the item the exact same way a vanilla item frame renders an item (Minecraft.getMinecraft.getRenderItem().renderItem(...)). I don't really do anything else. It should cost about the same as a vanilla item frame.

On the item, I need to waste some more time rendering the trophy base (since to my knowledge there is no way of mixing a regular block model and a special item renderer due to what I can only describe as Forge bullshit*) but other than that, also do pretty much the same thing that the tile entity does.

I do see performance hits when filling a double chest with trophies, but since it's a complicated item to render I would expect it to take a little bit anyways.

I'm out of options here really. If someone knows how to render an item faster than how item frames do it, let me know. (TL;DR: the performance issues are probably inherent in the task of rendering an item.)

In the meantime, I'll just add some options to skip rendering certain parts of the trophy.

*I can't combine a TEISR and an item model the same way I can combine a TESR and a block model, since for some inexplicable reason Forge only decides to render a TEISR when the "isBuiltInRenderer" method on IBakedModel for the item model returns true. If I parent the trophy base models to builtin/entity, true is returned from this method but the base models don't render at all on either the TESR or the TEISR. If I parent the base models to some other parent, false is returned and Forge doesn't render the TEISR. (This is why I hate forge, btw; this would be like two mixins under Fabric and I wouldn't have wasted an hour of fighting Forge's obsessive compulsion with making it incredibly fucking annoying to do anything remotely interesting in an item model.)

@quat1024 quat1024 added the help wanted Extra attention is needed label May 27, 2019
@quat1024
Copy link
Owner

Ok, 1.2.1 on curse has some "killswitches" in the config under client.perf, to use in the mean time. I know it's not the solution you wanted, I don't want it either, but I'm at my wit's end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants