There’s a little problem, I’ve got to solve, but I didn’t find the way to yet. Problem is the following:
I want to draw a polygon with two textures, each vertex of the polygon has it’s own color (using GL_Modulate). Light has to be disabled. The first texture shall be solid and the second shall be blended over the first, with an own intensity for every vertex. In immediate-mode it would about like this:
glDisable(GL_BLEND);
glDisable(GL_ALPHA_TEST);
glBegin(GL_QUADS);
glTexCoord2f(0.0f,0.0f);
glColor3f(0.5f,0.5f,0.5f);
glVertex3fv(&V1);
glTexCoord2f(0.0f,1.0f);
glColor3f(0.4f,0.4f,0.4f);
glVertex3fv(&V2);
glTexCoord2f(1.0f,1.0f);
glColor3f(0.3f,0.3f,0.3f);
glVertex3fv(&V3);
glTexCoord2f(1.0f,0.0f);
glColor3f(0.2f,0.2f,0.2f);
glVertex3fv(&V3);
glEnd();
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
glBegin(GL_QUADS);
glTexCoord2f(0.0f,0.0f);
glColor4f(0.5f,0.5f,0.5f,0.7f);
glVertex3fv(&V1);
glTexCoord2f(0.0f,1.0f);
glColor4f(0.4f,0.4f,0.4f,0.6f);
glVertex3fv(&V2);
glTexCoord2f(1.0f,1.0f);
glColor4f(0.3f,0.3f,0.3f,0.5f);
glVertex3fv(&V3);
glTexCoord2f(1.0f,0.0f);
glColor4f(0.2f,0.2f,0.2f,0.4f);
glVertex3fv(&V3);
glEnd();
How to do the same using multitexturing?
Thanks,
Michael Ikemann / Virtual XCitement Gmbh.