1
\$\begingroup\$

I've been reading but couldn't find an answer to my question:

If I have an object, let's say 30x30. Should I use a texture that is 30x30, 300x300, or even 3000x3000 or should I follow 'the powers of two' for textures?

I've been using 3000x3000 for a 30x30 object and it has been working, but I'm worried that it might not work for others.

\$\endgroup\$
2
  • \$\begingroup\$ Are your speaking of 3D or 2D? Remember that as a default a unit in Unity is 100 pixel. \$\endgroup\$
    – aggsol
    Commented Dec 3, 2014 at 8:04
  • \$\begingroup\$ you should re-size the pictures to the maximum size possible in your game. it saves a lot of storage. and if you use such big pictures the will be re-sized by software and who knows which algorithm it will use and which pixel you will lose \$\endgroup\$
    – Erez
    Commented Jan 2, 2015 at 12:30

3 Answers 3

1
\$\begingroup\$

Depends on what you do. For a 3D game you have to test it in practice - if it looks good when the camera is the closest - then the size is fine (you can even try to decrease the size of the texture to save memory/bandwidth). For a 2D game (orthographic camera) having textures in the same size (in pixels) as they appear on the screen might not be a bad idea but it all depends on your 2D camera settings and target device(s).

Btw, you know that Unity changes all textures' sizes to powers of 2 by default? It improves performance (at least on some devices) and from my experience it doesn't decrease the final images' quality. So I guess, unless you have a concrete reason to do otherwise, you can just stick to that.

\$\endgroup\$
1
\$\begingroup\$

3000x3000 is 9,000,000 pixels.

300x300 is 90,000 pixels.

30x30 is 900 pixels.

It all comes down to how much 'art' you want on the texture. I would use the smallest resolution needed to get your art to look correct at its optimal viewing distance from the game camera.

You also want to think about memory considerations. A 30x30 texture takes up less space than a 3000x3000 texture.

It's also good practice to keep textures as a power of 2 if you're using Unity as Unity will do its own compression to make it a valid power of 2 texture.

\$\endgroup\$
2
  • \$\begingroup\$ If Unity is already converting it to power of 2, I don't think there should be any reasons to do the conversion yourself. You just need to be careful not to reload the texture, which can require reallocation and doing the resizing again. \$\endgroup\$
    – Lie Ryan
    Commented Jan 2, 2015 at 5:12
  • 1
    \$\begingroup\$ How does Unity convert to POT, rescaling/padding? Each approach has it's downsides. Creating POT textures/atlases from the start means less trouble in the end. \$\endgroup\$
    – Kromster
    Commented Jan 2, 2015 at 20:59
1
\$\begingroup\$

You should always do 3D textures in powers of 2. Just because of how video hardware operates, it is more efficient for them to deal with image dimensions in powers of 2; in most cases this processing difference won't be noticeable, but for complex graphics these little things can add up.

\$\endgroup\$
1
  • \$\begingroup\$ UV clamping and repeat also works better with POT textures. Generally POT means less trouble. \$\endgroup\$
    – Kromster
    Commented Jan 2, 2015 at 20:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .