SmashingMods / ChemLib

About Library mod for Alchemistry and other mods.
https://www.curseforge.com/minecraft/mc-mods/chemlib
GNU Lesser General Public License v2.1
16 stars 23 forks source link

Better texture atlas handling for periodic_table.png #69

Open Lolothepro opened 2 months ago

Lolothepro commented 2 months ago

This texture takes up a lot of space for nothing, and it's really weird to load a texture like that. It might be better to have another method for loading this texture.

https://github.com/SmashingMods/ChemLib/blob/1.20.1/src/main/resources/assets/chemlib/textures/item/periodic_table.png

  1. You could create your own atlas for each element, and then render them individually (and create tiles for the background) or
  2. Loading it into a dedicated texture
Dark-Arcana commented 2 months ago

I don't understand why this is an issue. Seems somewhat pedantic? I see your conversation about it in NeoForge but I didn't actually port the mod over to Neo yet.

What actual gain is there to be made by altering this texture?

Lolothepro commented 2 months ago

A texture like that costs a lot of VRAM, and it's better to load lots of small textures than one big one like that. Also, doing this causes problems for translating the mod.

Dark-Arcana commented 2 months ago

I understand. The large texture should be loaded in another way to reduce vram usage. Honestly, it's extremely low priority because it's not actually causing a problem. But I'm not going to break the texture into a bunch of smaller pieces to make it easier for translating.

Geolykt commented 2 months ago

Though to be honest I wouldn't like to be the person that segments the large texture into a bunch of tiny ones - even though I reckon the vast majority can be handled with ninepatches (though the background would be a tenpatch). The most difficult thing here would be to handle the arrows.

But I'm not the person to be willing to do that work just yet - there's already enough for me to do

Lolothepro commented 2 months ago

First, you can simply downscale the texture, and then do the work later?

Dark-Arcana commented 2 months ago

Yeah I am not willing to do that. You have to balance development time with the actual benefit provided by the outcome. I see very little benefit from this.

Dark-Arcana commented 2 months ago

First, you can simply downscale the texture, and then do the work later?

Why would I downscale the texture? We went with a higher resolution to make it look nice. If I reduced the resolution, it wouldn't look as good.

Dark-Arcana commented 2 months ago

I am planning on updating / porting my mods for 1.21 when I get time in the coming weeks. I can consider looking at this texture to see how small I can make it before it looses detail. I can also load the texture differently. It's a screen and shouldn't be in the atlas with blocks and items. I'm fine with doing that, but I won't cut the image into smaller pieces.

douira commented 2 months ago

The high resolution wastes a lot of texture space, and it can lead to bugs with block rendering when the atlas gets too big.

Maybe using a pixelated symbol, or a striped effect on the element's boxes would convey the same information? It would also be more in line with the pixelated art style of the game and mod.