x


Texture mapping for performance

Hi,

I'm trying my best to use best practise in my game and optimize where possible. A friend of mine was saying how I should use a 2048x2048 texture for my ENTIRE level, so that the engine only has to load one texture file.

I can understand that logic behind trying to cram as much as I can into a texture, but it's certainly a much harder way of working especially when I want to make as many reusable prefabs as possible.

I was wondering if this is actually good advice, is using more texture files (and subsequently more materials) in my scene going to hurt performance?

more ▼

asked Aug 23 '10 at 09:02 AM

Disaster gravatar image

Disaster
482 49 57 67

(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

On a PC, you really do need to throw quite a lot of textures at it to hurt performance. However, you should always prototype fast, then optimise, optimise, optimise.

I have yet to build a PC App (I'm an iPhone guy, meh), but for iPhone I'll try squeeze as many things onto a single 1024x1024 texture as possible. Often, an entire level can be fit onto a single map, two at most.

Moral of the story is - Squeeze as much onto a single map as you can, but for the sake of ease, you can do it logically. Levels are a map, enemies are a single map, gui is all a single map, etc.

more ▼

answered Aug 29 '10 at 02:28 AM

jtbentley gravatar image

jtbentley
579 3 4 16

(comments are locked)
10|3000 characters needed characters left

It's not worth making a texture atlas for the reason your friend is suggesting. If you're using the same shader, and shader settings, on multiple objects, it's often a good idea to make a texture atlas, because then all the objects can use the same material. With Unity iPhone, this will happen automatically with batching, and in other versions of Unity, you can use Mesh.CombineMeshes. (Batching may be a feature found in other versions of Unity in the future, but as of Unity 3 beta 5, it doesn't seem to be supported for the standalone or web platforms.)

more ▼

answered Aug 23 '10 at 09:52 AM

Jessy gravatar image

Jessy
15.7k 72 95 198

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x3892
x2279
x492

asked: Aug 23 '10 at 09:02 AM

Seen: 1997 times

Last Updated: Aug 23 '10 at 09:12 AM