pacas00 / ModdersGearbox

A Fortresscraft Evolved Modding Library.
MIT License
1 stars 0 forks source link

Implement Texture resizing code from FCE Texture Resizer to support 128->146, and then 256->292. Depends on #8 #10

Closed pacas00 closed 5 years ago

pacas00 commented 5 years ago

Implement Texture resizing code from FCE Texture Resizer to support 128->146 256->292

This will allow modders to create textures in sane sizes and let MG take over the conversion.

128->256 will be handled by resize code from #8 Depends on #8

ph3rr3t commented 5 years ago

I'd say just keep it at those two since even at 256x per texture, the total data from all the textures is starting to get crazy.

pacas00 commented 5 years ago

What? Please explain what you mean.

ph3rr3t commented 5 years ago

Thought you were going to try for textures sizes other than 128 or 256. With how many textures there are, the amount of data that needs to be loaded is getting up there. Wouldn't want to get to close to the limit, or cause slowdowns from having too much.

pacas00 commented 5 years ago

Oh, No.

Currently SD would need textures at 146px, while HD would need 292px. These sizes and the requirements are not human friendly.

So what i'll be doing is allowing modders to supply textures as 128px or 256px and converting / adjusting them as needed.

Example.

128px texture -> MG automatically adds gutters/border and the blend/blur and makes it 146px for loading.

Extra step if there is HD textures for SD 128px or SD 146px is the resize to HD sizes

pacas00 commented 5 years ago

the limit on textures is 8192x8192. 14 cols wide HD is 4088, but with the WIP HD support, it will be 8176 and 28 cols wide.

ph3rr3t commented 5 years ago

-- I don't know what you've got in mind to have the code do exactly, though you have given the simple description here, but something tells me having it stretch/extend the outer pixels of a 128/256 px texture to fill in the rest of the 146/292 px texture would work as a simple solution. Granted that depends entirely on how easy/difficult it is to code in such a thing.

ph3rr3t commented 5 years ago

Okay, the following is just to make sure I'm on the same page as you.

FCE Standard Texture size

SD - Standard Definition

HD - High Definition

Now if what I'm understanding correctly from the number 8176, you're going to make the texture sheet 4 times as wide as it is now. 392 x 4 = 1,568 textures.

FCE

FCE w/ MG

Did I miss anything there?

pacas00 commented 5 years ago

Fixing mistakes before replying

pacas00 commented 5 years ago

OK, re-read your message now i've sorted the maths.

8 exists to also rewrite the stitching and restitch the texture sheet to rows of 28 not 14.

ph3rr3t commented 5 years ago

Okay, still doubles the max number of textures at either resolution. That I am happy to see. And not having to bother with the AntiAliasing/MipMapping border will cut like 5 minutes off texture creation. (5m x 784 = 3,920m = 65.33h = almost 3 days)

pacas00 commented 5 years ago

Ok!

Both #8 and #10 are done. If you want to play around with it at all, Debug build is at https://steamcommunity.com/sharedfiles/filedetails/?id=1548137276

You should be able to throw your high res custom textures in with it and it should convert it without issue.

Feel free to reopen this or #8 if you test it and there are issues.

pacas00 commented 5 years ago

Oh, and if you do use the debug build, it dumps a copy of the textures to

C:\Users\USERNAME\AppData\LocalLow\ProjectorGames\FortressCraft\ModdersGearbox

ph3rr3t commented 5 years ago

That should be useful for various things.