OpenGL自动生成纹理步骤

1.带参数的情况,包括GL_OBJECT_LINEAR,GL_EYE_LINEAR; 1.打开开关,使能纹理坐标自动生成: glEnable(TEXTURE_GEN_S); //TEXTURE_GEN_S,TEXTUE_GEN_R,TEXTURE_GEN_Q 2.设置模式: glTexGeni(GL_S,GL_TEXTURE_GEN_MODE,GL_OBJECT_LINEAR); 3.设置参数: GLfloat params[]={1.0,0.0,0.0,0.0}; glTexGenv(GL_S,GL_OBJECT_PLANE,params); 4.关闭开关 glDisable(TEXTURE_GEN_S); 2.不带参数的情况,包括GL_SPHERE_MAP,GL_REFLECTION_MAP,GL_NORMAL_MAP 1.打开开关 glEnable(TEXTURE_GEN_S); //TEXTURE_GEN_S,TEXTUE_GEN_R,TEXTURE_GEN_Q 2.设置模式: glTexGeni(GL_S,GL_TEXTURE_GEN_MODE,GL_NORAML_MAP); 3.关闭开关 glDisable(TEXTURE_GEN_S);

你可能感兴趣的:(OpenGL自动生成纹理步骤)