Advertisement

A little hazy on Multipass vs Multitexture

Started by July 22, 2004 12:26 PM
5 comments, last by vincoof 20 years, 7 months ago
I've been doing some research on multipass versus multitexture with ARB rendering. From what I have discovered there are two ways to apply two textures to an object: Multipass - Requires two passes over a single polygon. The first pass is done with "Texture 1" bound and blending turned off. Blending is turned on and the second pass is done with "Texture 2" bound. Multitexture - An extension enabled in OpenGL (ARB_multitexture, if I remember correctly) that renders multiple textures in hardware. Once this is enabled, you can bind up to 32 textures at a time. When you use glTexCoord2f, it applies to all texture units, not just the current one. I'm a little bit confused on the performance in comparieson though. It seems that, because the hardware is doing the calculation and only one set of vertices data needs to be passed, the multitexturing would be noticably faster than the multipass for doing the exact same scene. I have made a small program that illustrates this, and also the fact that blending slows down a videocard tremendously. From what I've found though, that's exactly the opposite. Take NeHe's bump-mapping. If you do it multipass, it's noticably faster than singlepass. Also, I've found a few review sites that list 3dmark scores, and the multipass seems to be faster than the multitexture. Mind you, I'm not necessarily asking how they did it in 3DMark, I'm just wondering if this is a typical result or the result of some really low-level optimizations. Please do correct me if anything I've found is incorrect so far. Now if multi-pass rendering is indeed faster than multitexturing, how do you actually do it? Blend one texture onto the other? Disable depth desting? Change the alpha values?
I do real things with imaginary numbers
You've got multipassing and multitexturing right. Though, no cards support binding 32 textures with multitexturing. I think some support up to eight, but I'm not quite sure what the standard is.

Multitexturing should be faster in any ordinary case. Old graphics cards might not support multitexturing, and in that case you will have to use multipass.

They might just have been special cases that you've encountered with multipassing being quicker. In any case, I can't quite tell you what could cause something like that without any more information on the specific information.
Advertisement
In just about any case where you can choose multipass versus multitexture you should go for multitexture.

NeHe's example is just that: example. It shows how to use multitexture. It that case multipass can be faster. But try doing a scene with a few 100k tris on screen and you'll see the difference. I don't remember exacly how 3Dmark benchmarks this. But I think it displays FPS or number of pixels per second. You get lower number with multitexture but thats natural becouse you are using 2(or more?) textures at same time. Try multiplying this result with number of textures used and you'll see that multitexture is a way to go.

Quote:
Original post by James Trotter
You've got multipassing and multitexturing right. Though, no cards support binding 32 textures with multitexturing. I think some support up to eight, but I'm not quite sure what the standard is.

I don't know about GF6800 or X800 but GF-FX supports 16 textures using ARB_FP/GLSlang or 8 using fixed function pipeline.
You should never let your fears become the boundaries of your dreams.
I think the FX still only supports 4 texture units in fixed function mode... ( but 16, as you say using shaders ).
If at first you don't succeed, redefine success.
Thanks for the replies. I'll try and find that 3d-mark result sheet where it says multitexturing is slower.

One quick question in regards to "Scarring", like if a bullet the side of a house and you wanted to leave a "bullet hole" in the wall... that would be done with multipass rendering, correct? I don't think that you can multitexture on only a part of a texture/polygon as far as I've found.
I do real things with imaginary numbers
Techicly you could use multitexturing. But I don't think its the best way in this case. Mostly becouse only few faces will have bullet marks, and you might as well do it on another pass.
You should never let your fears become the boundaries of your dreams.
Advertisement
Sure multitexturing is slower, if you consider the fillrate of each polygon independently. The first texture unit is always faster than the second, so it's faster to render two polygons of 10000 pixels each, rather than rendering a single polygon of 20000 pixels with multitexturing. However, it will (almost) always be faster to render a single polygon of 10000 pixels with multitexturing rather than rendering twice the SAME polygon with single-texturing, especially considering blending is enabled.

GF FX supports eight texture coordinate sets and sixteen texture image units. The limitation of 4 does only concerns 'traditional' use of multitexturing (ie without fragment programs or fragment shaders). But still you can call :
glActiveTextureARB(GL_TEXTURE7_ARB);glBindTexture(GL_TEXTURE_2D, myTexture);


You should not render the bullet using multitexuring since the surface of the bullet will not likely cover a great surface of the wall, so there will be some major fillrate wasted. As a side note, please use polygon offset when your render your bullet holes as individual polygons over the wall. Otherwise you will face the typical Z-fighting problem.

[Edited by - vincoof on July 22, 2004 5:02:00 PM]

This topic is closed to new replies.

Advertisement