PDA

View Full Version : Texture Blending Capabilities



Zeno
05-15-2001, 12:02 PM
I've been looking into the different modes of texture blending / pixel blending a bit lately, and I have some questions that I was hoping you guys could answer.

There seems to be a huge multitude of ways to blend textures together and I wanted some clarification about the differences.

Here are the different methods I'm talking about:

1. Multi-pass rendering using GL_BLEND to blend the geometry the textures are sitting on.

2. Multitexture blending using glTexEnvi with GL_TEXTURE_ENV_MODE.

3. Multitexture blending using EXT_texture_env_combine.

4. Multitexture blending with NV_texture_shader

5. Register combiners


And here are some specific questions:

a. Under what circumstances would I want to use each of the above methods?

b. Does 5 supercede 4 supercede 3 supercede 2 -- that is, if I have 5 available, can it do everything 2-4 can do? Can 4 do everything 3 and 2 can do?

c. Are texture shaders just a simplified interface to the register combiners that have the ability to automatically do standard effects like cube map and bump map?

d. I saw an nvidia example with some code that sortof looked like vertex program code. I think they passed it to nvparse or something like that. What does this do? Does it automatically set up one of the above things to shade the textures? If so, it seems like this might be the best interface....

e. If I have 4 texture units on one card, and 2 on another, will it always be possible to achieve the same effect using more than one pass? I'm guessing no...you couldn't do a cube-mapped and bump-mapped surface without at least 3 texture units, right?

Thanks in advance for any help http://www.opengl.org/discussion_boards/ubb/smile.gif

-- Zeno

mcraighead
05-15-2001, 12:11 PM
NV_texture_shader and NV_register_combiners are separate and address different aspects of the graphics pipeline. You can use one without the other, or both.

- Matt

ET3D
05-15-2001, 12:19 PM
What I'd say is - use heigher methods when they are available. Make the lower ones available for compatibility.

You can create many effects in multiple passes, but it's usually not practical due to speed limitations. In particular, the chips that don't support multitexturing will also be old ones with a pretty low fill rate. It's still worth supporting them, but going overboard with features like "true" bump mapping won't do much good.

Zeno
05-16-2001, 10:29 AM
Maybe I'm really off-base here, but don't texture shaders specify how textures get blended together? Don't the register combiner capabilities overlap with this? Which comes first in the pipeline?

I assume the register combiners are last.

Suppose I use 3 texture units. Suppose I set up texture shaders to combine them a certain way. Will there be 3 textures or only 1 combined one that comes into the register combiners then?

-- Zeno

davepermen
05-16-2001, 10:50 AM
textureshader implements dependend textureing, means color of tex0 = texcoord of tex1 and color of tex1 at its place is texcoord of tex2.. no blending, just dependend sampling

register_combiners give you most access to a gf-board and like that it is an upper set to texture_env and those.. means its the best way ( the most flexible way ) to combine textures/colors etc together..

GL_BLEND is different.. it acts at drawing on the image itselfs and uses an equation for it.. its very usefull for multipassing.. but as you know.. multipass is slow..

try to do as much as possible in one pass.. and you can do as much as possible with register_combiners

if you want environment bump mapping effects, means per pixel distortion of texture-pixels, you need texture_shader