Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

which is better? mult textures or one big one?

Jotheph Nemeth
Registered User
Join date: 9 Aug 2007
Posts: 142
09-10-2007 14:01
Should I go with 10 smaller textures or one big one and use offsets?

If I have 10 small panels each displaying part of a single larger texture, does that use more resources than using 10 smaller textures for the individual panels?

If one giant one, it will be 256x512 with no transparencies. For individual smaller ones, it will probably be 128x32.

Basically I guess my question is: does SL keep 10 copies of the same texture loaded if I'm just using offsets?

I might be going the wrong direction on these too. I am trying to show text on some buttons.
Larrie Lane
Registered User
Join date: 9 Feb 2007
Posts: 667
09-10-2007 14:10
Funny what your doing, I just did that for a remote control, but I always use one texture, well in total there were about 8 textures I uploaded but all in all about 64 different options and then just use the offsets, its a bit more work but easy enough to do and save all those L$10 uploads.

Also, I don't know if you are doing this, but with a remote I designed I wanted it to show what was happening, ie, something is off or on, by also using a simple script, but you will have to do 2 uploads and make sure in your texture that the on and off buttons are in the exact same place so they can use the same offset numbers.
Larrie Lane
Registered User
Join date: 9 Feb 2007
Posts: 667
09-10-2007 14:18
Also, in answer to your other question lets wait for a tekky to answer that, is one better or 10.

In my case with 64 options it was cost.
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
09-10-2007 17:21
From: Jotheph Nemeth
Should I go with 10 smaller textures or one big one and use offsets?

Generally speaking, it's better to use one than 10. There are a few caveats though, which I'll talk about in a minute.

From: Jotheph Nemeth
If I have 10 small panels each displaying part of a single larger texture, does that use more resources than using 10 smaller textures for the individual panels?

Assuming the 10 small textures add up to the same amount of pixels as the one big one, then the client-side resources are the same. A pixel is a pixel is a pixel, and it uses the same amount of video memory, no matter what it's part of.

However, server side, it's a different story. 10 textures means 10 calls to the asset server to deliver 10 individual assets. That's essentially 10 times the network traffic. If you can put all 10 images on one canvas though (commonly called "texture sheeting";), then all you need to pull is just one asset, obviously more efficient.

Also, with one sheet, you get the added benefit that all 10 images will appear to load at the same time. With 10 separate textures, they'll all rez in at random times.

From: Jotheph Nemeth
If one giant one, it will be 256x512 with no transparencies. For individual smaller ones, it will probably be 128x32.

Here's where the numbers start to get a little funny. In this particular case, your 10 small textures happen not to add up to as much as the one big one.

A 256x512 texture has 131,072 pixels in it, which at 24 bits per pixel comes out to 384K of video memory. A 128x32 is just 4096 pixels, or 12K of video memory, which multiplied by 10 comes out to only 120K. In other words, the 10 small textures added up "cost" less than 1/3 what the big one costs.

So, in this case, the small textures are better for the client. They're still worse for the network though. So what I'd suggest is the following:

If 128x32 is indeed all you need in order for the detail in each panel, I'd sheet the panels onto not one, but two canvases. Put 8 panels onto a 128x256, and the other two onto a 128x64. That way, you're cutting the network traffic down to just what's needed for two assets instead of 10, but you're not wasting pixels like you would with the overly large canvas. Make sense?

From: Jotheph Nemeth
Basically I guess my question is: does SL keep 10 copies of the same texture loaded if I'm just using offsets?

The answer is yes and no, but in the way that matters in this context, the no wins out.

Here's the yes part. In the strictest sense, everything shown on screen does add to the processing load, so if you've got 10 copies of an item on your screen, those 10 copies will cost more than if it were just one copy. However, since every part of your field of view in SL is going to be filled with SOMETHING no matter what, that particular cost isn't really relevant for discussion. You're always going to paying it anyway.

And here's the no part. Whether it's 10 copies of a texture, or 1 copy, or a hundred copies, all over the screen, you only need to cache that texture once. Once its loaded, it's loaded. It doesn't need to be "copied" internally 10 times just to be duplicated 10 times on-screen.

From: Jotheph Nemeth
I might be going the wrong direction on these too. I am trying to show text on some buttons.

You're thinking the right way.

Since it's buttons we're talking about, perhaps what I said earlier about using two sheets might not be the best way to go. If it's important that all the text on all the buttons load on-screen at the exact same time, then it might be worth wasting a few pixels to go with a bigger canvas. You don't need to go all the way to 512x256 though. If 128x32 is all you need for each button, then 128x512 would be more than enough for all 10.
_____________________
.

Land now available for rent in Indigo. Low rates. Quiet, low-lag mainland sim with good neighbors. IM me in-world if you're interested.
Jotheph Nemeth
Registered User
Join date: 9 Aug 2007
Posts: 142
09-11-2007 13:04
Thanks Chosen,

You've helped a lot.


From: Chosen Few
And here's the no part. Whether it's 10 copies of a texture, or 1 copy, or a hundred copies, all over the screen, you only need to cache that texture once. Once its loaded, it's loaded. It doesn't need to be "copied" internally 10 times just to be duplicated 10 times on-screen.



I'd hoped this was the case but I wasn't sure.

From: Larrie Lane

Funny what your doing, I just did that for a remote control, but I always use one texture, well in total there were about 8 textures I uploaded but all in all about 64 different options and then just use the offsets, its a bit more work but easy enough to do and save all those L$10 uploads.


Yeah, cost definitely factors in for me too.
Michael Bigwig
~VRML Aficionado~
Join date: 5 Dec 2005
Posts: 2,181
09-11-2007 13:11
Chosen......................................you rock.
_____________________
~Michael Bigwig
__________________________________________________Lead Designer, Glowbox Designs
Bree Giffen
♥♣♦♠ Furrtune Hunter ♠♦♣♥
Join date: 22 Jun 2006
Posts: 2,715
09-11-2007 19:41
Well let's see.... 100L or 10L for the upload....
_____________________