Foam​Fix

Foam​Fix

97M Downloads

parallelModelBaking & Better Foliage Rounded Logs

SulpherStaer opened this issue · 16 comments

commented

Forge 13.20.0.2264
foamfix-0.6.2-beta4-anarchy
BetterFoliage-MC1.11.2-2.1.3

Expected behaviour:
Foamfix increases performance without altering the game visually - Better Foliage Rounded trees can be turned on, and nicely rounded logs present themselves.

Actual behaviour:
Foamfix hampers the way BetterFoliage renders the rounded logs, when parallelModelBaking is enabled, AND rounded logs is enabled all logs that have been altered by BetterFoliage are no longer rendered, and present as invisible block.

How to replicate:

  1. Use foamfix with parallelModelBaking set to true in foamfix.cfg.
  2. Use BetterFoliage (default settings is fine)
  3. See that parallelModelBaking removes rounded logs.
  4. Disable rounded logs in BetterFoliage, and see logs turn visible again. (Leave parallelModelBaking on)
  5. Disable parallelModelBaking in foamfix.cfg, and enable rounded logs, and see logs visible and rounded.
  6. Be grateful of Foamfix, as it makes modded minecraft playable.
commented

This is a surprisingly friendly bug report. Thanks!

@octarine-noise How are the rounded logs baked in BetterFoliage?

commented

Thank the people that develop Minecolonies! :) I used their bug template to report it.

And once again, thank you for developing FoamFix. It is a wonderful mod that certainly gives my client some fups back.

commented

@asiekierka They're not. I'm using my own system (kind of like legacy rendering, before blockstates) to render them on the fly from smaller components. I don't really have a choice, as the possible number of combinations to bake would explode geometrically.

The problem is almost certainly conflicting class transformers. I have an important call hook patched into ModelLoader.setupModelRegistry() between model loading and baking, which ModelLoaderParallel obviously doesn't have. If that's the case, the fix should be trivial from my end.

@sylcai Do you see any glitches with leaves and grass, or only logs? If I'm right about the root cause, there should be all kinds of problems, as none of my texture generation should trigger.

commented

@octarine-noise Why do you need a class transformer for this? Are there some very specific timing issues involved? There's already an event happening between model loading and baking - that is TextureStitchEvent, which I tend to (mis)use for this exact purpose.

(Also, yes, FoamFix kind of... overwrites setupModelRegistry. Didn't expect anyone to hook there!)

commented

Let me check. I have no idea actually. The logs was so noticeable, that I instantly made a bug report.

commented

@octarine-noise As for "geometric expansion" of models, I very highly recommend looking at Charset's ModelFactory - no coremod is used to achieve the same end result, which you can see in, for example, barrel model code.

commented

@octarine-noise You are absolutely right. The extra leaves, and extra grass is also not present. I'm not sure what else is, but it is exactly the thing you said it was.

commented

(Also, I won't close this issue until the issue is fixed as it's a good PSA/explanation to other FoamFix users)

commented

Dunno. I know I had a good reason the stitch event was problematic, but I can't remember why ATM. The reason may not even exist anymore.
I'll take a good look at my own code, and also check out ModelFactory.

In the meantime, with @sylcai 's confirmation, you can close this issue. I'll update BF to work with parallel baking soon(-ish).

commented

@octarine-noise If you don't overwrite the method but inject a hook, the quickest way is to put your @SortingIndex after FoamFix's (see pl.asie.foamfix.coremod.FoamFixCore for details).

commented

Such quick responses. Both of you, please send me a valid paypal email so I can donate some money to the both of you!

commented

@sylcai Just so you know, I'm using the FoamFix 0.6.2 beta 4 Lawful version with BetterFoliage 1.11.2-2.1.3 in the meantime... which seems to be rendering everything properly.

commented

So... funny story. Since I never used the coremod sorting index before, I never noticed that there's an FML deobfuscation transformer sitting at index 1000. You just made my life a lot easier :)

commented

@sylcai The issue wasn't BetterFoliage's fault per se. I think that, in layman's terms, I'd describe it as a disagreement between the two mods.

commented

With BetterFoliage-MC1.11.2-2.1.4 this issue is fixed.

Note that, despite this bug report being in foamfix, the issue was Better Foliage. a disagreement between the mods mod incompatibility, which Octarine fixed on the side of Better Foliage, and very quickly too!

commented

Not even a disagreement. More like accidentally stepping on someone's toes on a very crowded bus.

It's an uphill battle trying to make sure mods work together in all combinations, especially for utility mods that need to dig deep.