Multitexturing

Started by
11 comments, last by MV 20 years, 5 months ago
> My last question, but I think Vincoof has answered :
> how many textures can be used for multitexturing ?
That depends on your hardware. You can count at least on two texture units for almost any kind of current hardware.
Better hardware like GeForce3/4 can support 4 texture units, Radeon8500 can support 6 texture units.

> Should 3 textures be used with rgb chanels of a 4th texture
> indicating the percentage of the blending ?
> r -> % of 1st texture
> g -> % of 2nd texture
> b -> % of 3rd texture
No you can't do it with texture combiners. At best you could use the alpha channel of each image like Corrail described nicely once again.

[edit: what Corrail proposed can be done in a single texture stage in fact]
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_TEXTURE_ENV_COMBINE);glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COMBINE, GL_INTERPOLATE_ARB);glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB_ARB, GL_TEXTURE0_ARB);glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB_ARB, GL_TEXTURE1_ARB);glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_RGB_ARB, GL_TEXTURE0_ARB);glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB_ARB, GL_SRC_COLOR);glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB_ARB, GL_SRC_COLOR);glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_RGB_ARB, GL_SRC_ALPHA);


[edited by - vincoof on October 25, 2003 7:59:39 AM]
Advertisement
Yeah, this might be faster than my version! :-)
But you still need 2 Texture Units...

--------------------------------------------------------

"If it looks good, it is good computer graphics"
"If it looks like computer graphics, it is bad computer graphics"

Corrail
corrail@gmx.at
ICQ#59184081
--------------------------------------------------------There is a theory which states that if ever anybody discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable.There is another theory which states that this has already happened...
quote:Original post by Corrail
Yeah, this might be faster than my version! :-)
But you still need 2 Texture Units...

Yes obviously
But with this you have a free texture stage that can perform post-texturing color operations, which happen to be handy in many effects such as brightening/darkening, color masks, inversion, etc

This topic is closed to new replies.

Advertisement