Game Development Community

Uses for Multi-texturing

by William Finlayson · in Technical Issues · 08/18/2002 (12:52 pm) · 5 replies

I was just wondering if anyone could give me some examples where mult-itexturing would be used, and why? I'm not clear on why you would want to blend multiple textures. Is it for things like reflections?

#1
08/18/2002 (1:07 pm)
Lightmaps, combing textures to produce new surfaces, detail textures, and more.
#2
08/18/2002 (1:20 pm)
Here is a copy of a post I made a while ago when someone wanted a basic description of what multi-texturing was...

Essentially what you have on modern graphics cards is a Graphics Processing Unit (GPU) which is comprised of (amongst other things) multiple Texture Mapping Units (TMU's).

Each TMU is essentially a pipeline which can read incoming pixel fragments, process them and then spit them out the other side.

It's difficult to explain the whole rendering pipeline here but essentially the TMU's don't get hold of pixel fragments until a certain amount of processing has been done on the vertices like clipping etc.

This is the crux of the matter. If you have 100,000 vertices which eventually get rasterised and end up as pixel fragments, you can do some processing on a single TMU and then send it to the screen. This would be known as a single pass.

If you wanted to use the same vertices and blend another texture on-top of the previous 100,000 vertices rendering you would set your state and render again. This would be a second pass and involves processing all the vertices again from the beginning to the end of the rendering pipeline.

If we could do multiple texturing in a single pass this would be faster right? Well that's exactly what you can do by assigning each TMU to a task you can get each to do some processing. You essentially set them up into a chain so that TMU#0 runs which feeds it's output to TMU#1 which runs which feeds it's output onto TMU#2 etc.

Different cards have different TMU counts and therefore certain cards may have the advanatge that they can do lots of work in a single pass.

If you've heard of the OpenGL extension (It's actually now part of OpenGL 1.3) 'GL_ARB_multitexture', it actually refers to the ability to give TMU's texturing tasks so that you can do multiple-texturing in a single pass.

If your card supports GL_ARB_multitexture then you must have a minimum of 2 TMU's. If you've got a geForce4 Ti4600 or a Parhelia then you've got 4 TMU's.

Hope this helps. There is much more to multi-texturing than this but I was trying to keep the post to a minimum, honest!! 8)

- Melv.
#3
08/18/2002 (2:32 pm)
Wow Melv. I'm impressed.

Some practicle uses might be like on terrain. To go from a grassy texture to a rocky texture, the graphics card via the engine would overlap the two textures to form a smooth transition.

In other words, it saves someone from having to create a third texture in that instance. In reality, however, it saves that person from making a transition texture for every time your grass runs up to a different texture--mud, rock, sand...whatever.

I believe that environmentally mapped bumpmaps would fall under the multi-texturing class as well. They are often used for reflections, or to make a model look glossy.
#4
04/14/2003 (11:12 am)
on the previous Xbox project I was working on we used multiple textures with multiple mapping coordinates for the following.

Straight blending of 2 textures,

detail textures with a falloff, usually to enhance terrain so that stretched bitmaps have mmore detail and look less smoothed out and low res.

a basic use of multi texturing might be as an alpha mask allthough if you blend 3 textures you can have a fairly diverse set of shader effects.

masking between 2 textures so that you can blend in say a rust into a metalic surface.

you can also have masked reflections, so that you can use a 3rd mono bitmap to define reflective areas of your geometry, this can be combined with cubic environment maps if you want more realistic reflections on curved surfaces.

You can also use the mask to attach decals to your objects with seperate mapping coordinates.

also used for bump mapping which can be combined with reflection masks etc.

basicly if you take the 3ds max blend material, and mix it with bump mapping and reflective sub matterials and mapping, its pretty much possible if you have good engine programmers. However you still need to consider what hardware your targetting as reflection masks and particularly bump maps are pretty expensive. Part of the reason they aren't often used even though almost all standard PC hardware and Xbox supports it.

Often I have found in any game there's a trade off between shaders and AI as both are expensive if they are going to be particularly impressive.
#5
05/29/2003 (10:16 pm)
Hi. I posted a question in the programing forum about wrapping a texture around a shape, like in T2 with the cloak texture. Can this be done wtih multi-texturing? If it can be done, how can I do it? Also, is it possible to do this so that only certain clients can see it(for infrared vision)?

Thanks -
The_Force