Mo Glass

Mo Glass

3M Downloads

Optimization for Glass Textures + New Block Set [Idea]

SpiderKolo opened this issue ยท 3 comments

commented

This post is long... very long.
I think this needs a bit of context, so let me provide it:

I was working on textures for another mod which added new resources to the game. I was NOT working on programing side of things so excuse my potential lack of knowledge on the matter.
At some point I decided that I would like to make a new Glass block for that mod, as the idea behind it's functionality was heavily tied to some of those resources.

Then I remembered about this mod, and I though I would like to make textures which would allow for making Slabs and Stairs out of the Glass block in question. I wanted to suggest a new feature with compatibility for mod I'm working on AND this mod.
Before that I obviously need to make textures, but I though I would check to see how you have done it.
I was shocked.

12 FILES for 2 Blocks - Slabs and Stairs.
4 of them are corners for top texture of stairs
4 of them are texture for stairs
2 of them are for slabs... but also top parts of non-corner stairs
And the last 2 of them which looks like vertical slabs are for top parts of non-corner stairs.

And that's just per one type of glass.

I checked the long list of textures and it seems like all glass blocks have been treated this way... which makes some sense - why treat only one block this way and not all of them of this works just fine on one block?

I'm curious if there wasn't perhaps an attempt where instead of having those textures... all fit in less files?

I checked vanilla textures - which obviously wouldn't have had any transparent textures for slabs and stairs and the whole point of this mod IS to add those kind of blocks... I was instead looking for unique textures used only on Slabs or Stairs...
And there is one file specifically for Smooth Stone Slabs I remembered.

It's a single texture containing top AND bottom texture of Slabs - for when player makes a full block out of two stone slabs.

I feel like this should allow for some optimization for files as you could have instead of 12 additional files per block... just 7:
All corners (now 4 textures) could be stored on single file (and as a bonus - you could turn it into a new - Tiled Glass, which would be made of 4 smaller glass blocks)
Horizontal Slabs (now 2 textures) could be stored on single file
"Vertical" Slabs (now 2 textures) could be stored on a single file
And... the stairs textures (now 4 textures) are not quite possible to optimize that way as you need all 4 different textures to make reflections be consistent depending on block orientation. Be it the side of the staircase or top shape of the staircase.
So... still stored on four files.

I haven't tested it yet, but I'm pretty sure it could potentially reduce the size of the mod... at least slightly.
And again - You could then have from that optimization 18 (Normal Glass, Tinted Glass and 16 Stained Glass) new tiled textures for total of 54 new blocks (Full Blocks, Slabs and Stairs, as all of them could need just their respective tiled texture.
You could even add 18 Pane blocks too... If normal Pane texture (the thin line texture used for Pane Glass and it's 16 Stained siblings) was looking well enough.

It's like killing two birds with one stone. Or... in this case glass shard.

Granted - you would have to program in those blocks too and possibly make 4 new textures shaped like stairs as well just to hide corner textures from appearing under those small parts of Stair models... which means that from 7 files per glass variant we moved back to 13 files per variant and reverted the optimization... but we would end-up with more content along the way so maybe it's worth it.

All of this... unless there is a reason why you decided to go with separate files and somehow not separating the files into 12 for each glass variant was causing errors.
There is this new transparency after all... and obviously Stairs and Slabs - as you mentioned - were not supposed to be transparent as they are hell to program if attempted to be made transparent...

I'm curious what you think of the idea.
If you want I could attempt combining textures myself at some point if you would rather not do it in your free time. I don't have much time myself, but I think I could reserve some.
Coding... as I mentioned before - I don't have much experience with it, so I can't help with that part.

commented

Look man, the mod is like 500 kB.
Why spend that much time optimizing something that isn't a bottleneck to begin with?
That's not efficiency, but madness. No one would even notice the difference.

Regarding panes, 17 of them already exist in vanilla. Only tinted glass panes are missing - and adding those doesn't require or even benefit from re-doing all of the current textures.

Regarding tiled blocks, I won't add these because they don't fit the theme/scope of the mod. Mo Glass is supposed to fill the gap in Minecraft's glass blocks, while looking as if Mojang did it. I'm not trying to add as many new blocks as possible.

commented

I see...
Well, if you don't want to do all of that then that's understandable. It isn't a big deal how it's made as long as it's working.

Thanks for quick reply! I appreciate it a lot!

commented

This issue has been open for a while with no recent activity. If this issue is still important to you, please add a comment within the next 7 days to keep it open. Otherwise, the issue will be automatically closed to free up time for other tasks.

Issues should be closed if:

  • They are duplicates of other issues
  • There is not enough demand
  • They are no longer relevant
  • There are not enough details