Textures much bigger in Unity than original file size?!?!?!
Asked Answered
W

2

0

Hi guys and gals,

I have an odd issue (maybe not odd… just noobish).

I have a few 2048x2048 png files that I am mapping to planes for my game to give a “Mode7” look. It’s all working really well, but the final build size is massive, as each image is taking up 8mb of space within Unity, even though the original file size of the pngs is only a few hundred kb. What would cause this?

I need to have the files uncompressed, as compression, no matter what setting I use just looks horrible, as I am going for a retro 16 bit look… I really can not afford to have compression artifacts all over the place.

Is there a reason these png files need to be so large in Unity?

Any help greatly appreciated.

Weakfish answered 6/6, 2023 at 2:32 Comment(0)
B
0

Well the simple answer is “that’s how big they are!”

PNG is a file format, but when loaded into memory it takes that much space. The compression available on textures is all about keeping the size of a pixel down by losing information (I expect you know this). So it wouldn’t matter if it was a Jpg (apart from the lack of alpha channel) it would still take a large amount of space.

So you don’t have a PNG in Unity, you have a PNG imported into a texture.

Bewitch answered 6/6, 2023 at 2:25 Comment(3)

Ah, so it's the textures that take up that space? Not just the png file? Bummer... I was hoping I could get the size down... shame Unity doesn't support 8 bit textures. LOL. I think for the iOS version of the game I can afford to drop down to 1024x1024 textures... I'll have to make do with the large file size for Mac and PC. Thanks for your prompt response!

Weakfish

If you are going for a 16bit look could you construct from tiles? That would give you your own way of doing compression...

Bewitch

Also you could try actually loading them at runtime from the file... It would take that much memory - but your game would be smaller. And it would take time to load.

Bewitch
S
0

@whydoidiot’s answer is quite true. along with tht the texture settings choosen for the texture matters, true color image will be of more size and the compressed ones would be of less size.

a 1024x1024 true color will be 4 mb~ where with compression it may go down upto 1.2mb (or even lesser with the compression options i havent used yet). The reason for the increase in size i suppose is, unity doesnt handle it as png or jpg, it handles it as byte array. Im not sure with that though.

better advise to reduce size is to sacrifice quality for the models that wouldnt be noticed much.

Sorci answered 6/6, 2023 at 2:25 Comment(3)

Hehe, the problem is, the models I am using are custom planes (2 triangles)... can't get much less detailed than that! LOL.

Weakfish

no i meant the quality of the textures. not all needs to be true colored rite??

Sorci

Oh, okay. I'm not using true colour, I'm using 16-bit. Because the gfx are so basic, any compression at all makes it look horrible.

Weakfish

© 2022 - 2024 — McMap. All rights reserved.