Texture Map Organisation

Started by
1 comment, last by superpig 17 years, 7 months ago
I just want to preface by saying I'm an artist, so this isn't really a technical question, but one I would like some advice on from a variety of programmers. For each item in my game, I have a diffuse map, and normal map. I also have a specular map, right now I'm going to use 24-bit specular maps. Also, some items may have opacity maps, and reflection maps (not the actual cubemap, but which part of the texture gives reflections). Now, a couple questions: I know the common convention in many games is to put the Opacity map as the Diffuse Alpha channel, and the Specular as the Normal Alpha channel. However, since only a small handful of objects use Opacity maps, and many objects use 24-bit specular (meaning they need their own RGB texture), and some also have a Reflection Map, should ANY of this be done through Alpha? Would it be more efficient to have an 8-bit DDS file for each the Opacity and Reflection and 8-bit specular? May I as well put all diffuse maps with an Alpha channel for Opacity? There are many possibilities, let me try to organize some of my thoughts: -Seperate file for each map (none with Alpha): what are the drawbacks with this (more files to load=?)? -Include an Alpha map when needed, so Diffuse alpha is always transparency and normal alpha is always reflection), and specular is a seperate 8 or 24 bit file. (Should I switch Normal Alpha to specular, and have reflection seperate, as its needed far less frequently and can be far, far smaller?) -Include an Alpha Map always, for the same files/channels listed above: again, what are the drawbacks (larger file sizes). My question is why would a game like Oblivion do it this way, always including the Alpha channel in the diffuse though its rarely used. Any guidance you can give I thank you for, or any questions you would like answered, please ask. Thanks again. For an example of a character using all these maps (and 24 bit specular: Free Image Hosting at www.ImageShack.us
-------------www.robg3d.com
Advertisement
Bump.

If you can't answer my questions, then how about:
What is the difference between loading 4x512 textures compared to 1x1024 texture (assuming each would be used once in the scene)?

The premise is sort of similar and I'm sure that's a more common one.
-------------www.robg3d.com
Quote:Original post by Professor420
What is the difference between loading 4x512 textures compared to 1x1024 texture (assuming each would be used once in the scene)?


Texture surfaces are handled as single blocks of memory that won't get split up. If you're talking about using a 1024x1024 texture versus 4 512x512 textures, the main difference will be in the way memory gets used; the 1024x1024 texture will always require a 4MB block of memory, while the 512x512 textures only require 1MB each. While the total memory used is the same, the fact that the 512x512 textures are individually smaller means it's easier for the video card to make room for one of them at a time.

If you're talking about one texture that is 4x512 versus one that is 1x1024, then the former uses twice as much memory as the latter.

As far as your original question goes: Don't feel you need to author things directly in the format that they'll be used in-engine. It's fairly simple to write a tool that takes two files (e.g. diffuse colours in one file, transparency in another) and combines them somehow - you could even do it at load-time, though you wouldn't want to come release.

When it comes to combining the files, you don't necessarily need to stick to any particular convention - you could just get all your material information (which materials use which maps and methods) and let your tech use that to figure out how best to combine the files. It can write out a very simple record of which data has gone into which channels. If you're not editing those files yourself, then it doesn't really matter which data is where, provided your engine can understand it all.

Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse

This topic is closed to new replies.

Advertisement