I am not sure if I can fully describe what I mean but the idea is simple:
Today nobody knows how many texture units will be available at the user’s computer.
Some older graphics card may have only two of them. So to implement really flexible
multipass multitexturing, we need to be able to start rendering triangle without
rasterizing color.
It would probably be the best to implement as Enable/Disable (GL_something), or with
function glSomething() that would take the argument. It could also be alpha value, not
only boolean but this may make it too complicated.
If you don’t understand what I mean, lets say that:
glEnable( GL_something ); // would be enabled as default
// here bind texture 0 to unit 0 and texture 1 to unit 1
glBegin(GL_TRIANGLES);
for (int i=0; i IS SMALLER THAN 3; ++i) BEGIN
glMultiTexCoord4fv( GL_TEXTURE0, texture_coord_0[i] );
glMultiTexCoord4fv( GL_TEXTURE1, texture_coord_1[i] );
glVertex4fv( vertex_coord[i] );
END
glEnd();
glDisable( GL_something ); // would be enabled as default
// here bind texture 2 to unit 0 and texture 3 to unit 1
glBegin(GL_TRIANGLES);
for (int i=0; i IS SMALLER THAN 3; ++i) BEGIN
glMultiTexCoord4fv( GL_TEXTURE0, texture_coord_2[i] );
glMultiTexCoord4fv( GL_TEXTURE1, texture_coord_3[i] );
glVertex4fv( vertex_coord[i] );
END
glEnd();
Would have been rasterized exactly as this would be:
glEnable( GL_something ); // would be enabled as default
// bind textures to according units
glBegin(GL_TRIANGLES);
for (int i=0; i IS SMALLER THAN 3; ++i) BEGIN
glMultiTexCoord4fv( GL_TEXTURE0, texture_coord_0[i] );
glMultiTexCoord4fv( GL_TEXTURE1, texture_coord_1[i] );
glMultiTexCoord4fv( GL_TEXTURE2, texture_coord_2[i] );
glMultiTexCoord4fv( GL_TEXTURE3, texture_coord_3[i] );
glVertex4fv( vertex_coord[i] );
END
glEnd();
I know that similar effect can be archieved with blending but this allows to get exactly
the same effect especially when texture combiners are used.
I suppose the GL_RASTERIZED_COLOR token or something like this.
I hope you understand. Perhaps this could be an extension. And I don’t think it would be
too difficult for driver developers to implement.
If you want to tell me something about this, mail to: Tringi at Mx-3 do cz.