标签:
一、使用MipMap贴图(主要是应用在纹理缩小过滤中)modelViewMatrix.PushMatrix(); M3DMatrix44f mCamera; cameraFrame.GetCameraMatrix(mCamera); modelViewMatrix.MultMatrix(mCamera);; modelViewMatrix.PushMatrix(); //翻转Y轴,绘制倒影 modelViewMatrix.Scale(1.0f,-1.0f,1.0f); modelViewMatrix.Translate(0.0f,0.8f,0.0f); //反正之后,原先的正面变成了顺时针了,所以要改变顶点环绕模式:顺时针为正面 glFrontFace(GL_CW); DrawSongAndDance(yRot); //绘制完倒影之后改回来顶点环绕模式 glFrontFace(GL_CCW); modelViewMatrix.PopMatrix(); //开启颜色混合,使倒影和底板的透明度混合 glEnable(GL_BLEND); glBindTexture(GL_TEXTURE_2D,uiTexture[0]); glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); static GLfloat vFloorColor[] = {1.0f,1.0f,1.0f,0.75f}; shaderManager.UseStockShader(GLT_SHADER_TEXTURE_MODULATE,transformPipline.GetModelViewProjectionMatrix(), vFloorColor,0); floorBatch.Draw(); glDisable(GL_BLEND); DrawSongAndDance(yRot); modelViewMatrix.PopMatrix();
标签:
原文地址:http://blog.csdn.net/zh13544539220/article/details/45580361