Advantages and disadvantages of single image textures?

Post your questions, suggestions and experiences regarding game design, integration of external libraries here. For irrEdit, irrXML and irrKlang, see the
ambiera forums
Post Reply
Niw Entertainment
Posts: 7
Joined: Tue Jan 31, 2012 5:05 pm

Advantages and disadvantages of single image textures?

Post by Niw Entertainment »

Hello,

I have recently been thinking about optimizing performance on my game. I am currently creating a voxel-like 3d game.
At this moment in time all my textures are stored in one folder in individual images. For example there are 99 images all 16 x 16 and they are all around 1kb in size. I was thinking whether it would impede performance if i had them all in one big file, 256 x 256 or 512 x 512 in a texture-sheet like thing (sorry i forgot the name perhaps its atexture atlas?) almost like the one found in the 2d drawing tutorial.

Would having all the textures in one image affect performance at all? Are there any positives to changing it so all my individual textures are combined?

Thank you.
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Advantages and disadvantages of single image textures?

Post by hendu »

Yes, it'd improve performance. The negative is that mipmapping artifacts may appear.
REDDemon
Developer
Posts: 1044
Joined: Tue Aug 31, 2010 8:06 pm
Location: Genova (Italy)

Re: Advantages and disadvantages of single image textures?

Post by REDDemon »

You can store all images in a one big image, then create textures from sub-images. Wich at least remove some overhead. There are also things that can help you solve that problem:

2D texture arrays

Irrlicht does not have support for that unluckily.
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
Virion
Competition winner
Posts: 2148
Joined: Mon Dec 18, 2006 5:04 am

Re: Advantages and disadvantages of single image textures?

Post by Virion »

i used that extensively in mobile game for my fulltime job. It's really fast.
Niw Entertainment
Posts: 7
Joined: Tue Jan 31, 2012 5:05 pm

Re: Advantages and disadvantages of single image textures?

Post by Niw Entertainment »

Okay thanks!

I will begin changing everything so that it is done this ways soon. Just one question though. Do i need to set a transparency key or is having the texture sheets background to transparent good enough?

Thanks again!
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Advantages and disadvantages of single image textures?

Post by hendu »

That depends on whether you need transparency.
Niw Entertainment
Posts: 7
Joined: Tue Jan 31, 2012 5:05 pm

Re: Advantages and disadvantages of single image textures?

Post by Niw Entertainment »

On some occasions i will, for example leaves, i need transparency for the gaps in between each leaf.
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Re: Advantages and disadvantages of single image textures?

Post by Mel »

It is almost the same, You upload just once the texture, but you can use it on multiple materials. The only diference then is that you will have a little more draw calls, but always less than if you had only one texture per object. You have to group your objects, though to achieve performance improvements. Take a look to the batching and instancing systems that there are out there.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
ibax
Posts: 193
Joined: Thu Jun 21, 2007 8:56 am
Location: hungary
Contact:

Re: Advantages and disadvantages of single image textures?

Post by ibax »

hi,

I have a big house model, with many objects and furniture. I created a single texturefile (with UV mapping in Maya), and its size is approx. 1 MB, with 2048 x 2048 resolution. I think, if I combine everything to one file, its size could reach the 100MB filesize also.

Is there any limitation in irrlicht about the supported filesize or imagesize?

How can I calculate the minimum required filesize or image resolution, where all my objects are covered, and the qualilty is also acceptable? Is there any way to do this?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: Advantages and disadvantages of single image textures?

Post by hybrid »

There's a maximal texture size supported by your gfx card, which may also differ from other cards. In general, you shouldn't use versions larger than 2kx2k, better smaller. Moreover, changing the textures while rendering will require the gfx card to arrange things for each texture, where some things might depend on the size, so rendering becomes slower with increasing texture sizes. But I'm not sure if and which parts would depend on the texture size.
You also have a general maximum of gfx card memory. Note that not the file size matters, but the RGB data size. Which here means 2048x2048x4 byte, so 16 MByte just for the main texture, plus another 6 or so for the mipmaps.
Irrlicht should be able to load all files up to 16kx16k, which is IMHO the absolute maximum of textures gfx cards support. 100MB file size is not really achievable, unless you use BMP format.
Required quality depends on the details you need on your textures and the size of the polys you cover. You could probably calculate some limits, but the visual impression is a better indicator than any theoretical value. Try to scale down the texture (or reduce the LOD bias) and check if it's still good enough. In that case scale down your texture.
Klunk
Posts: 264
Joined: Mon Jan 10, 2011 5:21 pm

Re: Advantages and disadvantages of single image textures?

Post by Klunk »

though pagemapping is desirable for the performance benefits it can make tiling trickier and increases modelling time as a result. Also many UV breaks from pagemapping your objects can increase the memory footprint of a model (though there are ways around this is by folding the UVs backwards and forwards over themselves if the textures are already tiling badly this will only make it worse visually) . Pagemapping (from an art point of view) works best on discrete objects (tree sets, houses, etc) tiling on large areas such as terrain so if you already rely on tiling you may have a lot of work on your hands.
Post Reply