我想通过opengl es实现像colorsplash效果的效果,所以我在网站上搜索并获得指南(http://www.idevgames.com/forums/thread-899.html)
现在我在第三步阻止了抽奖时间,我不知道如何按照指南创建多重纹理,你能帮助我吗?给我一些建议或一些代码
答案 0 :(得分:1)
要进行多纹理处理,您需要将不同的纹理放入各种纹理单元中,并为它们设置纹理坐标。像这样:
// Put a texture into texture unit 0
glActiveTexture (GL_TEXTURE0);
glBindTexture (GL_TEXTURE_RECTANGLE_EXT, texID0);
...
// Put a texture into texture unit 1
glActiveTexture (GL_TEXTURE1);
glBindTexture (GL_TEXTURE_RECTANGLE_EXT, texID1);
...
// Now draw our textured quad - you could also use VBOs
glBegin (GL_QUADS);
// Set up the texture coordinates for each texture unit for the first vertex
glMultiTexCoord2f (GL_TEXTURE0, x0, y0);
glMultiTexCoord2f (GL_TEXTURE1, x1, y1);
// Define the first vertex's location
glVertex2f (x, y);
... // Do the other 3 vertexes
glEnd();