PDA

View Full Version : Alpha blending using multi-texture



MPech
04-26-2002, 03:38 AM
here is my problem :
I want to fill texture0's alpha mask with texture1 (display texture1 in the alpha mask of texture1)
I'm using ARB_multitexture and ARB_texture_env_combine extensions.

here is my algo :

activate Unit0
bind(texture0)
enable(TEXTURE_2D)
texture environement settings :
ENV_MODE -> COMBINE
SOURCE0 -> TEXTURE
COMBINE mode -> REPLACE

activate Unit1
bind(texture1)
enable(TEXTURE_2D)
texture environement settings :
ENV_MODE -> COMBINE
SOURCE0 -> PREVIOUS
SOURCE1 -> TEXTURE

OPERAND1 -> ONE_MINUS_SRC_ALPHA
OPERAND2 -> SRC_ALPHA
COMBINE mode -> MODULATE

what i get is :
-texture0 display well
-the alpha mask choosen is the one of texture1 (i would like the one of texture0)
- nothing is display in the mask place (i would like to display texture1 in palce of the mask).

I got it work using multi-pass but i'm a newbie in multitexturing, please help ! http://www.opengl.org/discussion_boards/ubb/wink.gif

what could i forget ?

regards

[This message has been edited by MPech (edited 04-26-2002).]

davepermen
04-26-2002, 05:33 AM
there is a mode GL_INTERPOLATE_EXT with wich you can set the alpha source as well.. i think http://www.opengl.org/discussion_boards/ubb/wink.gif

MPech
04-26-2002, 05:53 AM
Yes, I know but it returns me black and white rendering without any texture.

MPech
04-26-2002, 06:29 AM
Any other suggestions ? or any site/docs from which I could get information about advance mutitexture rendering ?
I'm really stuck, here...

hophop
04-26-2002, 09:53 AM
Did U take a look to Nehe's tuts on gamedev ?
I think that lesson 22 should answer your question.

MPech
04-26-2002, 11:22 AM
I 've read it but, want i'm looking for is an "advanced" documentation, upon multitexture lightmaping or alpha blending.
I'd rather buy a book I think... ;-)

Elixer
04-26-2002, 12:01 PM
Here, this nice util will generate the code you need, and you can play around with all the options. http://www.ati.com/developer/sdk/rage128sdk/Multex/OGLMultex.html

Three cheers for ATI for making this http://www.opengl.org/discussion_boards/ubb/wink.gif

MPech
04-26-2002, 12:49 PM
Exactly what i needed !!
thanks a lot ! B)

[This message has been edited by MPech (edited 04-26-2002).]

knackered
04-26-2002, 01:46 PM
Yes, thanks for that - very nice little app.