PDA

View Full Version : Dot3 Bump Mapping ERROR



CHwang
08-31-2011, 05:44 AM
The same code render normally in nvidia , but abnormally in ATI .
//normal map
glClientActiveTexture(GL_TEXTURE0);
glActiveTexture( GL_TEXTURE0 );
glEnable( GL_TEXTURE_2D );
glBindTexture( GL_TEXTURE_2D, m_cStemTexture[1].ID());
glTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE );
glTexEnvf( GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_DOT3_RGB );
glTexEnvf( GL_TEXTURE_ENV, GL_SRC0_RGB, GL_PRIMARY_COLOR );
glTexEnvf( GL_TEXTURE_ENV, GL_OPERAND0_RGB, GL_SRC_COLOR );
glTexEnvf( GL_TEXTURE_ENV, GL_SRC1_RGB, GL_TEXTURE);
glTexEnvf( GL_TEXTURE_ENV, GL_OPERAND1_RGB, GL_SRC_COLOR );
glInterleavedArrays(GL_T2F_C4UB_V3F, c_nVertexSize, pVertex);

//diffuse map
glClientActiveTexture(GL_TEXTURE1);
glActiveTexture( GL_TEXTURE1 );
glEnable( GL_TEXTURE_2D );
glBindTexture( GL_TEXTURE_2D, m_cStemTexture[0].ID());
glTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE );
glTexEnvf( GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_MODULATE );
glTexEnvf( GL_TEXTURE_ENV, GL_SRC0_RGB, GL_PREVIOUS );
glTexEnvf( GL_TEXTURE_ENV, GL_OPERAND0_RGB, GL_SRC_COLOR );
glTexEnvf( GL_TEXTURE_ENV, GL_SRC1_RGB, GL_TEXTURE );
glTexEnvf( GL_TEXTURE_ENV, GL_OPERAND1_RGB, GL_SRC_COLOR );
glInterleavedArrays(GL_T2F_C4UB_V3F, c_nVertexSize, pVertex);

BionicBytes
09-01-2011, 04:20 AM
but abnormally in ATI
Why, what's abnormal. What do you see?


glInterleavedArrays(GL_T2F_C4UB_V3F, c_nVertexSize, pVertex);
Should be no need to draw the geometry twice between stages.