View Full Version : Why split up texture sheets?
redfive 03-09-2006, 09:09 AM This is something that's been puzzling me for awhile. I've seen people permitted one 1024x1024 texture sheet but they'll break it up into multiple pieces, like two 512x512's, or smaller combinations. What's the point?
| |
SHEPEIRO
03-09-2006, 09:56 AM
i geus some engines or platforms preffer square textures, plus with some platfroms texture limits, this is the way its done.
for example the PS2's texture size limit is 256* (if i remeber correctly) so the best way to create a character model is 1x256* for the face, and one for the body.
also if your using different shaders for parts of the model, say a shiney armoured body and diffuse head and body then, i think it would avoid loading the whole texture into both materials within the engine. + you can use the UVW space more effecintly if you are using extra maps for each shader. I.E a skin shader uses another map for the underskin colours. but if you had to apply that over the whole model then alot of texture space would be wasted.
hope that helps
HappyToast
03-09-2006, 10:01 AM
There are various reasons, but pretty much all of them come down to saving texture space in a game.
If a character requires Diffuse, Specular, Reflection, Normal and Opacity mapping then using a 2048x2048 texture sheet is a massive drain on resources because you will need to then have 5 seperate 2048 sheets for just one character.
If you gather all the parts that need opacity (glasses, visors, tattered clothing) in to one smaller area (512x512 for example) and then crop that off to its own map, then the texture requirements drop from 2 2048 maps (Diffuse and Opacity) to 2 512 maps, which saves your game engine a massive amount of texture space. Do this for all 5 channels and you can easily drop from 5 2048s to the equivalent of 1 that covers everything.
Other reasons include the possible need to swap textures for body parts (say you want to replace jeans with combats; a seperate leg map means you swap a texture without a hit on performance, otherwise you'd need to combine two 2048 textures!), engine requirements (many game engines can't use massive textures, especially if you're aiming for portable platforms) and even personal preference.
Obviously as engines and memory improve, texture sizes will grow, so 5 2048s isn't a problem.
Hope thats of some help. :)
urgaffel
03-09-2006, 10:18 AM
To elaborate on the waste of space thing, if you unwrap a character to one sheet and use a 2048/1024 texture, you will waste a lot more space than if you can squeeze it into two 512. Every pixel that isn't painted is a wasted pixel (and 2 512 is half the memory of a 1024) :) The less black space you can have on your texture sheet, the better. Sometimes that means dividing it up to several smaller textures. On the other hand, maybe the engine you're working with doesn't like multiple small textures but a few big ones, then you'll have to do the opposite (maybe try to squeeze in a few extra models on the uv sheet) :)
redfive
03-10-2006, 06:41 AM
Thanks for the replies guys. That all makes alot of sense, especially the different shaders bit.
But urgaffel, I'm not sure I understand how splitting it up optimizes UV space though. I would think the same space could be optimized just as well in a larger size. Care to elaborate?
Szninkiel
03-10-2006, 08:19 AM
also, when you're creating UV's like this one:
http://www.yon.menel.com/mapowanie_tile.png
It's a small grass area. It's very easy to tile texture this way, and it wouldn't if the grass would be a part of bigger texture.
XepptizZ
03-10-2006, 09:29 AM
Some engines don't support tiling though. And cutting a 2048* into 4 512* (wch is the equivalent) doesn't make it more UV space efficient.
The one about the shaders were a great read though, I'll keep that in mind.
urgaffel
03-10-2006, 12:15 PM
Argh, I wish I had some sheets I could show to give you an idea of what I mean...
XepptizZ, yes, 4x512 is the same amount of memory as 1x2048, but depending on your uvs you can get a higher pixel density on your model with 4x512. What I meant in my post though, was that you might be able to squeeze your uvs onto 2-3x512s instead of using one gigantic sheet which would save space. I'm going to have a look around to see if I can find some examples of good and bad uv mapping...
SHEPEIRO
03-10-2006, 12:25 PM
Szninkiel- there are ways of creating tilled textures as part of a larger map. ive worked on a few tracked vehicles for MODs (BF2 engine). the tracks used animated UVWs but were part of the same texture as the model, they were created in the top left corner of the map. the programmers would then assign this section as a seperate map. they could be tiled and animated.
you can do this in max by using map in new material and cropping the image, in the bitmap options.
it can be problematic, as when the engine generates mipmaps, the map can be infected by the surrounding colours, bringing out the seams.
urgaffel
03-10-2006, 02:08 PM
Ok, I've found some examples of good and bad unwrapping. First up is good map usage:
This image comes from Realtimecg, http://www.realtimecg.com/template.php?id=determinedto3d.php&n=31
http://www.realtimecg.com/gameart/31/determinedto3d_9.jpg
Next up is bad uv layout. Lots and lots of wasted space where two texture sheets could easily be combined into one, from this thread, also at Realtimecg http://www.realtimecg.com/template.php?id=dbjunk.php&n=17
http://www.realtimecg.com/gameart/17/db8.jpghttp://www.realtimecg.com/gameart/17/db9.jpg
And lastly, an image from a crap tutorial (http://biorust.com/index.php?page=tutorial_detail&tutid=85):
http://biorust.com/tutorials/blender-uvmapping/step6.jpg VERY bad uv usage :)
Anyway, trying to squeeze as much as possible into the same sheet is always a good idea. On the other hand, using a gigantic texture sheet might not always be the best way to do it either since you're loading a big chunk of which some could be used for other things. It's basically a trade-off between using one big sheet and several small ones. A good example of multiple texture usage like someone mentioned is when you need to swap textures, for example head textures in UT and Q3.
georgebrayner
03-10-2006, 06:09 PM
1.HappyToast (http://forums.cgsociety.org/member.php?u=202455) "If a character requires Diffuse, Specular, Reflection, Normal and Opacity mapping then using a 2048x2048 texture sheet is a massive drain on resources because you will need to then have 5 seperate 2048 sheets for just one character. "
- In fact, You can use the same texture placed in the memory of the computer, or videogame console, in different materials, and with uvw you can specifies the part of the texture you will use in the 3d object.
2. urgaffel (http://forums.cgsociety.org/member.php?u=126) vbmenu_register("postmenu_3328183", true); "XepptizZ, yes, 4x512 is the same amount of memory as 1x2048...",
- this can be a truth, but in the majority of the times it increases the weight of the memory. Each graphic file has a heading with information as, the depth of colors and other data that we artists not deal with, and the memory used for this heading don't change too much, when you break the texture in smaller parts you will create more headings, so in this case, break the texture in smaller parts is not necessarily the best solution. For PNGs image formats exist a tool called PNG gauntlet, this tool remove the heading of the image, but the engine must can deal with the file without heading.
"Other reasons include the possible need to swap textures for body parts (say you want to replace jeans with combats; a seperate leg map means you swap a texture without a hit on performance, otherwise you'd need to combine two 2048 textures!), engine requirements (many game engines can't use massive textures, especially if you're aiming for portable platforms) and even personal preference."
- I agree with you in this case, but you can make sets of things to be changed, like the environment: you can change the texture to change the weather. So you make only one map for all, trees, rocks, terrains...
For somethigs, put all the textures in an only one file is a great solution, recently I'm work in a celphone game, and that was the best solution, I made all the textures of a 3d models in an only texture map with 256x256.
urgaffel
03-10-2006, 06:35 PM
2. urgaffel (http://forums.cgsociety.org/member.php?u=126) vbmenu_register("postmenu_3328183", true); "XepptizZ, yes, 4x512 is the same amount of memory as 1x2048...",
- this can be a truth, but in the majority of the times it increases the weight of the memory. Each graphic file has a heading with information as, the depth of colors and other data that we artists not deal with, and the memory used for this heading don't change too much, when you break the texture in smaller parts you will create more headings, so in this case, break the texture in smaller parts is not necessarily the best solution. For PNGs image formats exist a tool called PNG gauntlet, this tool remove the heading of the image, but the engine must can deal with the file without heading.
Yeah I know about the memory overhead when loading multiple textures, but if you can replace a 2048 texture with a couple of 512s or one 1024, you'll still have less overall usage since all that extra data that a 2048 would entail would probably be more than the combined overhead of the alternative.
"Other reasons include the possible need to swap textures for body parts (say you want to replace jeans with combats; a seperate leg map means you swap a texture without a hit on performance, otherwise you'd need to combine two 2048 textures!), engine requirements (many game engines can't use massive textures, especially if you're aiming for portable platforms) and even personal preference."
- I agree with you in this case, but you can make sets of things to be changed, like the environment: you can change the texture to change the weather. So you make only one map for all, trees, rocks, terrains...
Sqeeuzing all textures for the environment onto one sheet would be incredibly ineffcient since it would be one helluva big texture :) I asume you mean all trees on one sheet, all rocks etc which would still be a bit tricky unless you're talking about handhelds, and even then it would be tricky since they are usually using a limited palette on their textures and they don't like loading textures larger than 128 (DS) or 256 (PSP). I'm not 100% sure on those numbers of course, but I seem to remember reading those numbers somewhere :) Although to be honest I have never developed anything for a handheld so I could be full of shit.
For somethigs, put all the textures in an only one file is a great solution, recently I'm work in a celphone game, and that was the best solution, I made all the textures of a 3d models in an only texture map with 256x256.
Cool! Could you show an image from the game or a texture sheet?
XepptizZ
03-10-2006, 07:55 PM
Urgaffel, from what I can tell you're just making a difference between good and bad UVmapping. Offcourse good UVmapping always saves space, but it can also add quality. This has little to do with the advantages/disadvantages of cutting things up.
AdamAtomic
03-10-2006, 08:07 PM
4*512 = 1*1024
4*1024 = 1*2048
Just so everybody's on the same page mathematically ;)
A big, big reason for splitting textures into multiple sheets is to let you palettize the colors without degrading the image quality too much. If you have a character that is red, blue, yellow, and green, and you put his entire texture onto one sheet, you will only get (for example) 64 shades of each color (with an 8-bit texture - only FOUR shades with a 4-bit texture)! If you split his texture up and put basically one color on each sheet, you will get fully 256 (or 16, respectively) shades per color, which makes an ENORMOUS difference. With the NEXT next gen of consoles and in PC games already, this will no longer be a major concern.
However, many graphics cards and consoles have limitations on the size of each sheet. If you don't want to degrade the detail of your character then multiple sheets is a requirement.
The comments about extra textures (opacity, etc) are spot on as well.
Also, a general guide for how detailed to make your textures is to think about what the final display size and resolution of the asset you are working on is. If you are making a crate that will only ever be about 256 pixels tall on screen, there is absolutely no reasonable explanation for using a 1024x1024 texture on it. It's a waste of time and resources that could be better spent on characters or FX.
Athey
03-10-2006, 08:29 PM
Another very good reason for using multiple textures is color. On PSP the textures are limited to 4-bit - that's a total of 16 colors that can be used in a single texture map.
Now imagine if you had your whole character unwrapped and textured on a single texture map. Your character has flesh tone skin, a blue shirt, a brown belt and shoes, green pants, a red hat.... etc.
Now take your texture map with all it's diverse shades of all these different colors and convert it to 16 colors - it looks like ass. You get like 2 shades of green, maybe 3 shades of blue, 2 or 3 flesh tones, etc. You get nasty dithering and pixels dotting around all over looking like crap.
Now say we take that same character, and unwrap the shirt onto it's own texture. The pants onto it's own texture, the skin to it's own, etc.
Now you get 16 shades of skintone for your skin. 16 shades of green for the pants. 16 shades of blue for the shirt. Much less dithering, much better color, and your character just generally looks... much better.
It's a ballancing act really. Some engines really hate to load more textures. Instead of a character with one or two 128x128s you've got a character with 6 or 5 different textures. Some 64, some 128, etc. The engine has to load all of those into memory. But if you only have one or two textures, it can look like ass. More textures and it'll look better, but you may drop frames.
You've just gotta make choices as to what you want to prioritize. What is worth more, and find a good balance that gets the best look.
urgaffel
03-10-2006, 09:48 PM
Urgaffel, from what I can tell you're just making a difference between good and bad UVmapping. Offcourse good UVmapping always saves space, but it can also add quality. This has little to do with the advantages/disadvantages of cutting things up.
They go hand in hand in my opinion. If you have good uv mapping you will (hopefully) need fewer texture sheets. And if you know what you are doing, you can separate for example the head to a separate smaller texture and have even greater pixel density on your bigger sheet for the rest of the model. Wether to do this or not depends on how much pixel density you want, what your engine can handle and wether splitting things up will be memory efficient or not and of course, the palette restrictions AndyH and Athey mentioned.
Anywhoo... Using a 2048 will of course give you a very high pixel density but depending on your model, you could get as high density with two 1024s (50% smaller size, but with additonal ovrehead) if split up in a good way. I'm not saying you should never use a 2048, just saying that it might not always be necessary. It's easy to get carried away with the next-gen engines specs.
Not sure what you mean with "add quality" though, I thought good uv mapping means good quality or do you mean something else?
georgebrayner
03-10-2006, 09:59 PM
I agree with Adam Atomic, this is a real important reason to split.
urgaffel "Sqeeuzing all textures for the environment onto one sheet would be incredibly ineffcient since it would be one helluva big texture :) I asume you mean all trees on one sheet, all rocks etc which would still be a bit tricky unless you're talking about handhelds, and even then it would be tricky since they are usually using a limited palette on their textures and they don't like loading textures larger than 128 (DS) or 256 (PSP). I'm not 100% sure on those numbers of course, but I seem to remember reading those numbers somewhere :) Although to be honest I have never developed anything for a handheld so I could be full of shit."
- work with the map with all the textures inside only one bitmap help us in the project, we don't need put numerous controls to load textures, and other some things about otimization, we don't need distort the images or reduce the quality, just becouse our maps are really small, the player have one map with 128x128, but this is one case, for some other game maybe don't work, I made all the game with 2 textures with 256x256 65kb each. But this is not a wrong thig to do, the Nvidia make a tool just to help the people to make this type of work, just becouse for some uses is real usefull i think.
http://www.gamasutra.com/features/20060126/ivanov_01.shtml
In this link have good consideretions, one thing is some engines for mobiles have the strange limitation of textures, you need use the texture in an especific size, is the case of Micro 3d for BREW, if you use the 64x64 texture will run in the memory like a 256x256, I don't no the reasons... :P
I'm sorry but I can't show anything, I really want do this, but...
Another point very important i think, is the UV with this you can make a lot more with a simple and smal texture file
PS: I need to go hehe here in Brazil is 19:00 and a live very far from my work hahah! I just want to talk more but i can't
Next week I will came back, I don't have Internet in my holme, GRRRRRRRRRR, sorry if I don't be conclusive.
ArchangelTalon
03-10-2006, 10:16 PM
I was just wondering, as this is kind of related and I've heard it mentioned but never defined... What is the performance impact of calling to say 3 or 4 smaller textures rather than 1 texture?
Surely it's more effort for the engine to load up and render 4 textures than it is 1 texture? Or is the impact not noticeable enough for it to matter?
I think this really applies to older consoles and handheld platforms, but I'd like to know all the same :P
*edit; Seems like georgebrayner's pre-emptively answered my question :P
urgaffel
03-10-2006, 10:19 PM
Very interesting article, and managing to pack all the games textures into two 256 sheets is impressive! I can totally see where this is usefull for handhelds and the likes :) I admit that I have no experience with lower end development so I wasn't familiar with texture atlases and I was thinking in next gen terms when dismissing the one-sheet-for-everything way. Packing all the textures of one(!) of the assets I've worked on would create a texture bigger than 1200x1200, and that would be one out of many assets on screen at any one time. So I apologize, I was a bit narrowminded not taking handhelds into account :)
How many textures did you pack into the sheet? If it's two 256s, the original textures must have been around 64* down to 8*/16* (2x256 = 128x32 etc) and/or did you reuse a lot of the textures/models?
Looking forward to hearing more about this on monday :)
BMunchausen
03-18-2006, 12:41 AM
Ok this is gonna sound really stupid I'm sure but I'm just learning this stuff so please forgive me for jumping onto this thread... To have different maps, does that mean you physically have to extract the different pieces of the model from one another so they're different objects? I was thinking specifically about buildings and I'm definitely confused about all this multiple texture stuff and how many maps I could or should have for one building.
Not to confuse matters, but I mean, if you separate out the elements of a building, and group them the way you all are discussing here, according to color, do you have to make sure even if you have multiple UV maps, that they all equal the overarching limit? Like if one 1024 map is the limit, I can have 6 different UV/texture maps but they all have to equal 1024 collectively, yes?
CGTalk Moderation
03-18-2006, 12:41 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2009, Jelsoft Enterprises Ltd.