News:

SMFNew Installed

+-+-

User+-

Welcome, Guest.
Please login or register.
 
 
 

Login with your social network

Forgot your password?

Site Stats+-

Members
Total Members: 728
Latest: Cho
New This Month: 0
New This Week: 0
New Today: 0
Stats
Total Posts: 10932
Total Topics: 795
Most Online Today: 298
Most Online Ever: 854
(September 18, 2024, 07:49:37 am)
Users Online
Members: 0
Guests: 331
Total: 331

Author Topic: Texture file resolution must be a power of 2  (Read 2595 times)

0 Members and 66 Guests are viewing this topic.

Texture file resolution must be a power of 2
« on: »
At least for texture sheets that are used for icons and UI, it seems that the .dds for textures needs to be a factor of 2 (i.e. 1024x1024).  Otherwise, GUTS will automatically resize it to the nearest power of 2 and your textures will look wanged up in-game.
« Last Edit: August 22, 2015, 01:21:27 pm by gytfunke »

Share on Bluesky Share on Facebook


Re: Texture file resolution must be a factor of 2
« Reply #1 on: »
At least for texture sheets that are used for icons and UI, it seems that the .dds for textures needs to be a multiple of 2 (i.e. 1024x1024).  Otherwise, GUTS will automatically resize it to the nearest factor of 2 and your textures will look wanged up in-game.
It is interesting. A good note.  :)

Re: Texture file resolution must be a factor of 2
« Reply #2 on: »
Actually, you'll need to have dimensions that are powers of two, not just multiples of two.*

There's a number of performance-related reasons why:
1. The various DXT compression algorithms (e.g. DXT5) use 4x4 blocks. (Which means you need multiples of 4, rather than of 2.)
2. Downscaling a power-of-two-sized texture by any power of two is super fast and needs no interpolation, and is therefore massively parallelizable. (Each output pixel is just the average of a block of input pixels.)
3. Ditto for mipmap generation (which is just repeated downscaling by various powers of two).
4. Upscaling by powers of two is also much easier since you can keep your input pixels and interpolate between them, rather than interpolating the entire output. (This benefit holds true for multiple-of-two dimensions (in addition to power-of-two dimensions).)
5. Doing math about the dimensions is super fast if you're multiplying or dividing by a power of two (since the operation can be reduced to right/left shifts that don't require the ALU).

*Many modern video cards relax this restriction. They'll accept DDS of any dimensions, even odd ones. You'll just take a huge performance hit for doing it. However, since Runic wanted compatibility with old PCs and low-end PCs, and good performance all around, it's not surprising that GUTS demands power-of-two dimensions.

Re: Texture file resolution must be a factor of 2
« Reply #3 on: »
Thanks Gyt! I usually just curse, flail about and, sometimes, cry until i get something that works :D so knowing theres a science to this is reassuring!

But seriously, did my chragebar texture give u any trouble? I had to reference the .png instead of the .dds, to get it to show properly.
« Last Edit: August 21, 2015, 11:15:56 pm by Phanjam »


Re: Texture file resolution must be a factor of 2
« Reply #4 on: »
Yeah, a little PJ  ;)  It took me a bit to figure out what was going on, but now that we know it's no big deal.

And thanks Chthon!  Yeah, I meant power, but wrote multiple.  My mathematical vocab is a little loose all over.

 

Recent Topics+-