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

Summarized dependency of Sodium in Entity Texture Features (ETF) mod #2365

Open
Traben-0 opened this issue Feb 29, 2024 · 2 comments
Open

Summarized dependency of Sodium in Entity Texture Features (ETF) mod #2365

Traben-0 opened this issue Feb 29, 2024 · 2 comments
Labels
A-mods Area: Mod compatibility T-enhancement Type: Enhancement

Comments

@Traben-0
Copy link

Request Description

Regarding #2329

Summary

Both mixins are additive only, they do not affect the underlying class/method behaviour

ETF emissive entity rendering will just safely stop working with Sodium present if these 2 mixins don't apply correctly

ETF mixins to me.jellysquid.mods.sodium.client.render.immediate.model.EntityRenderer.render() so it doesn't have to entirely disable Sodium's entity rendering optimizations, only adding logic to the HEAD & RETURN, ignoring the rest of the method

ETF mixins to me.jellysquid.mods.sodium.client.render.vertex.buffer.SodiumBufferBuilder (seems to now be called DirectBufferBuilder in v0.6) to apply a required interface to hold context for ETF

Detail

ETF has logic for emissive texture rendering that runs at the start and end of ModelPart.render() via a mixin. That will trigger a second render() call for an emissive texture if required.

Sodium cancels ModelPart.render() and calls me.jellysquid.mods.sodium.client.render.immediate.model.EntityRenderer.render() instead. https://github.com/CaffeineMC/sodium-fabric/blob/dev/src/main/java/net/caffeinemc/mods/sodium/mixin/features/render/entity/ModelPartMixin.java#L84

ETF could just set the flag to disable this sodium entity rendering optimization but in the interest of preserving those optimizations ETF has a duplicate of it's ModelPart.render() mixin targeting the start and end of me.jellysquid.mods.sodium.client.render.immediate.model.EntityRenderer.render() instead.
https://github.com/Traben-0/Entity_Texture_Features/blob/master/common/src/main/java/traben/entity_texture_features/mixin/mods/sodium/MixinModelPartSodium.java
With the original ETF ModelPart.render() mixin set to a priority that leaves it fully cancelled by sodium's mixin
https://github.com/Traben-0/Entity_Texture_Features/blob/master/common/src/main/java/traben/entity_texture_features/mixin/MixinModelPart.java#L27

ETF also mixins to me.jellysquid.mods.sodium.client.render.vertex.buffer.SodiumBufferBuilder to apply a non impactful interface. I can see just now that this class has changed file names 2 weeks ago to DirectBufferBuilder presumably for v0.6

@Traben-0 Traben-0 added S-needs-triage Status: Needs triage T-enhancement Type: Enhancement labels Feb 29, 2024
@jellysquid3 jellysquid3 added A-mods Area: Mod compatibility and removed S-needs-triage Status: Needs triage labels Feb 29, 2024
@God-Dnds
Copy link

Are there any workarounds for this other than downgrading?

@Traben-0
Copy link
Author

workarounds in what sense? no downgrading is required currently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-mods Area: Mod compatibility T-enhancement Type: Enhancement
Development

No branches or pull requests

3 participants