Re-implement ActiveVariantBlockBakedModel#1522
Re-implement ActiveVariantBlockBakedModel#1522TechLord22 merged 11 commits intoGregTechCEu:masterfrom
Conversation
|
I am noticing an issue that was already present in the mod still being present here. If you can try and fix it with this refactor, that would be nice, otherwise it should not block this refactor. The issue is that particles for the different Variant Active blocks do not update for which block they are performed on, and stick with the particles that were displayed for the first time in that world. For example, Using Tritanium coils, Fusion Glass, and Assembly Line casing. If I cause the particles that are present by falling onto the block from a distance, using the Tritanium coils, the other two blocks will also have the Tritanium coil particles when you fall onto them from a distance. Or the particles for breaking a block, the particles from the first block you break will also be applied to the other blocks. This seems to be somewhat chunk related, as when I crossed chunk boundaries and repeated things, the blocks got new particles, but only near the chunk boundaries. Like I said, this is a minor thing and so should not block this PR, but it would be nice if it could be fixed in this refactor as well. |
|
The particle issue comes from |
|
With the last change, AVBBM was re-implemented to address number of shortcomings of previous approach. As a result the preface is currently obsolete and no longer represents this PR's implementation details. A new behavior change is made in the bloom config. Previously, all VABs are afrected by The code has been tested with/without CTM, but compatibility with Optifine shaders should be tested as well. (I don't mean blooms should work with Optifine shaders; we need to see whether the block models correctly render "no bloom" fallback state.) ThreadLocal particle cache is deployed in other places as well, so all of them could benefit from reimplementation such as this. Perhaps a generified solution could be devised; but this PR should be sufficient for now. |
|
Hey uh how do I request review on mobile web??? |
src/main/java/gregtech/client/model/modelfactories/ActiveVariantBlockBakedModel.java
Outdated
Show resolved
Hide resolved
src/main/java/gregtech/client/model/modelfactories/ActiveVariantBlockBakedModel.java
Outdated
Show resolved
Hide resolved
src/main/java/gregtech/client/model/modelfactories/ActiveVariantBlockBakedModel.java
Outdated
Show resolved
Hide resolved
src/main/java/gregtech/client/model/modelfactories/ActiveVariantBlockBakedModel.java
Show resolved
Hide resolved
src/main/java/gregtech/client/model/modelfactories/ActiveVariantBlockBakedModel.java
Show resolved
Hide resolved
|
I've updated the description to reflect latest changes. |
…ing issue on active fireboxes
|
Please update the config descriptions for the multiblock and the machine config options. The multiblock should just mention the EBF coils now, and the machines should mention multiblock parts |
What
This PR re-implements ActiveVariantBlockBakedModel to account for various issues present in current implementation.
Implementation Details
Previous iteration of AVBBM used ThreadLocals to cache model particle texture for later use. Since this model is shared between many variations of VariantActiveBlocks, desync between particle texture and actual tile occurred very frequently.
To address this issue, the AVBBM is redesigned from ground to be registered for each variation of VABs.
VariantActiveBlock#isBloomEnabledmethod, which can be overridden from block to enable or disable blooms in certain conditions; more on later.AVBBM#getQuads, unlisted propertyactiveis checked to determine whether to render inactive model or active model. This is same as previous iteration.CUTOUTlayer instead.Because of the rendering change,
VariantActiveBlock#canRenderInLayerimplementation is changed yet again.Outcome
In addition to the fix documented above, this PR contains a behavior change on config
casingsActiveEmissiveTexturesandmachinesEmissiveTextures. Previously, all AVBBM bloom effects are handled by the configcasingsActiveEmissiveTextures, probably due to the limitations of the approach. This created some inconsistencies on visuals, most notably in active firebox casings where the firebox blocks are affected bycasingsActiveEmissiveTexturesand hatches with firebox skin were affected bymachinesEmissiveTextures. This created an inconsistent bloom effect which rather looked like a visual glitch.In this PR,
casingsActiveEmissiveTexturesis modified to only affect bloom effects of coils. Bloom effects of all other casings are now controlled bymachinesEmissiveTexturesconfig.Potential Compatibility Issues
Like in #1521, this PR poses a risk of breaking mod-added blocks.