#CPU controlled animated textures on main item/block atlas

9 messages · Page 1 of 1 (latest)

hardy frigate
#

TL;DR:
i want to add fully cpu controlled images to the main atlas (for performance reasons) instead of using dynamic textures (the stuff behind maps)
since swapping between the VCs is over 30% of the raw rendering time.

Now, the question is how should i add non-texture backed images to the atlas in a way so it doesnt break anything else?
i did not see any kind of api for it.
Also, my project is cross loader, so the same problem also exist on neo
1.21.1 btw

Any good advice for how to add non-resource backed textures to the atlas is welcome

silver bronze
#

I’d probably start by looking at how animated textures work since iirc they do basically what you want minus the non-existing texture thing
Maybe also look at SpriteSource and PalettedPermutations as those are kind of mojangs ‘api’ for this (mojmap)

#

I’m not sure how dynamic texture atlases can be tho, like idk if it would allow you to just change an image at runtime without a resource reload if you’re implementing something similar to maps

#

that might not even matter but just something to keep in mind

hardy frigate
#

i am currently already fully animating them and using dyn textures, the question is how do i register savely to the atlas itself in a compatible way?
im fully aware i can only do that during texture-reload/atlas stitching, but im worried if i simply mixin into the atlas that i might create issues with sodium or iris

silver bronze
#

ah ok, then I believe you should be able to add a custom sprite source to the SpriteSources.ID_MAPPER, then also add it in the atlas json so the game knows it exists

#

that’ll probably be the most compatible way as I highly doubt sodium would mess with that

hardy frigate
#

thanks, this seems to work perfectly

hardy frigate
#

okay, if anybody else is thinking abt doing something like this:
dont.
the performance difference isnt that big between dynamic textures and and on atlas textures.
even in some worst case bases like mine where multiple dyn textures are rendered directly after eachother the increase in render time is minimal, its just not worth the work