Texture Bit Depth and Page Size


Texture Bit Depth and Page Size

Texture memory is an important factor in game development. Keep your pages as small as possiblethe image size as well as the file size is important. Although you may have been given a maximum texture limit, you'll get extra points if your character could look just as good in less.

There are two ways you can do this: reducing the actual page size, and reducing the bit depth. You can even combine reductions in both to get texture sizes down even more.

How far you can go with these reductions (or whether you can use them at all) depends on your managers and the game you are developing, so always check this out with your team. If you can, try and see both versions of the characterreduced and not reducedrunning in the game engine, to get a realistic idea of how they will look. Remember that things look completely different on a television screen than they do on a computer monitor, so it may be that you can't see any difference in the reduced version. In that case, you have saved some memory that can be used to polish the game elsewhere.

Page Size Reduction

Reducing the size of your texture pages is a dramatic way to reduce the overall file size, but on some characters this will leave you with unacceptable results. Let's begin by determining how big our textures currently are.

Without the alpha maps embedded, the main 512x512 pages are 769 KB each; the 256x256 pages are 193 KB each. Immediately we can see that if we reduce the highest ones to 256x256, we will be saving 576 KB on each; that's enough to add roughly another three texture pages for other characters. If we reduced the 256x256 pages to 128x128, we will save an additional 144 KB each.

This is all well and goodbut how do the characters look after this sacrifice? On first glance, there doesn't seem to be much difference, but on closer inspection you can see that a lot of the detail has been lost. Also, some areas are slightly more blurred and pixelated than before the reduction.

Have a look now at the close-up shots in Figure 9.54. Getting in closer to the character makes it a bit more obvious that the pages are reduced.

Figure 9.54. Close-ups of the texture page comparison (See page C11 for color version.)


Reducing page size is a quick and easy way to retrieve some memory, but it can affect the look of your characters.

Bit Depth

What about altering the bit depth? Bit depth measures the amount of color information available in an image. Greater bit depth means more colors are available. An image with a bit depth of 8 has 256 possible colors; one with a bit depth of 24 has roughly 16 million possible colors.

Up to now we have been working with 24-bit images, but what would they look like if we reduced them to 8-bit (256 colors), and how much would the file size be reduced? A 512x512 image at 769 KB would be knocked down to 257 KBnot as much as reducing the image size, but we do get to keep the same amount of pixels.

1.

To reduce the bit depth in Photoshop, go to Image > Mode > Indexed Color. This opens up the options window shown in Figure 9.55.

Figure 9.55. Indexed Color options


2.

The Colors option should be automatically set to 256; if it's not, set it to this amount.

3.

The other option to play around with is Dither. Because we are reducing the number of colors, we can specify whether we want Photoshop to try to blend the remaining ones using a method called dithering. The options are None, Diffusion, Pattern, and Noise. Figure 9.56 shows the results of applying these options. I find Pattern to be the best choice here, but it does depend on the image you are reducing and your personal tastes.

Figure 9.56. Effects of the different Dither options (See page C15 for color version.)


Figure 9.57 shows how reduced the bit-depth affects Kila. Although it does look pixelated in areas, there isn't much of a difference, and with a little work touching up the texture you won't see any noticeable degradation.

Figure 9.57. The 24-bit and 8-bit comparison. (See page C16 for color version.)


With the textures finished and optimization tasks done, we have completed our tasks for this chapter. Figures 9.58 and 9.59 show the finished models.

Figure 9.58. Kila final model after texturing and tweaking (See page C12 for color version.)


Figure 9.59. Grae final model after texturing and tweaking (See page C12 for color version.)


The good thing about the textures is that you can continue to work on them throughout the project, so these versions do not need to be the final ones. Keep coming back to them throughout the rest of the book. (The best way to improve upon them is to forget about them for a few days and then have a fresh look.)