Advertisement

interpolate between two textures

Started by August 04, 2002 08:50 AM
5 comments, last by adema 22 years, 6 months ago
i want to interpolate between two textures to get a smooth animation effect at the beginning the first texture should be totally opaque and the second texture should be fully transparent and at the end the first texture should be fully transparent and the second texture should be opaque. i use glActiveTextureARB() and glMultiTexCoord2fARB() for multitexturing how can i set this blending factor for each texture?
glActiveTextureARB(GL_TEXTURE1_ARB);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
/*
GL_MODULATE ==> Modulate de 2 textures
GL_REPLACE ==> Replace the first texture
*/
glBindTexture(GL_TEXTURE_2D, Texture_BMP[1]);
glEnable(GL_TEXTURE_2D);
// Draw your poly here ...

========================
Leyder Dylan
http://ibelgique.ifrance.com/Slug-Production/
========================Leyder Dylan (dylan.leyder@slug-production.be.tf http://users.skynet.be/fa550206/Slug-Production/Index.htm/
Advertisement
Leyder Dylan : your code will blend textures together over whole triangle(mesh).

use ARB_texture_env_combine extension:
INTERPOLATE_ARB Arg0 * (Arg2) + Arg1 * (1-Arg2)
Where:
Arg0 = color component of texture on unit 0
Arg1 = color component of texture on unit 1
Arg2 = alpha component of primary color



You should never let your fears become the boundaries of your dreams.
You should never let your fears become the boundaries of your dreams.
_DarkWIng_:
i searched for information about ARB_texture_env_combine on the net but i didn''t find much information. i don''t have a concrete idea how to implement it.
some sample code or a link to it would be nice
DarkWing: you must be talking about that
jp! That''s the one

You should never let your fears become the boundaries of your dreams.
You should never let your fears become the boundaries of your dreams.
Advertisement
thx for the link. i''m sure the code works but unfortunately my graphics card doesn''t support the ARB_texture_env_combine extension so i simple draw 2 blended quads at the same position and interpolated their alpha values through time.

This topic is closed to new replies.

Advertisement