I need to apply a texture (actually a letter) onto the face of an object and then apply an spherical environment map to the object. I have arranged the alpha to be zero on the first texture over the area covered by the letter and need this area to be excluded from the environment map.
I can achieve this in a multipass render but I can’t afford the performance hit. I have eventually found the following code works but it uses GL_COMBINE4_NV and I believe that this is specific and only supported by NVidia cards.
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE4_NV);
glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_ADD);
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB_EXT, GL_PREVIOUS_EXT);
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB_EXT, GL_SRC_COLOR);
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB_EXT, GL_ZERO);
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB_EXT, GL_ONE_MINUS_SRC_COLOR);
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_RGB_EXT, GL_TEXTURE);
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_RGB_EXT, GL_SRC_COLOR);
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE3_RGB_EXT, GL_TEXTURE0_ARB);
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND3_RGB_EXT, GL_SRC_ALPHA);
I’m working to a very tight deadline and wondered if what I want can be achieved and if so how ?
Whilst not exactly new to OpenGL, my experience with multitexturing is new and I would appreciate any links that might help me in my understanding of this subject.
Many thanks,
Andrew