multitexturing

Texture units and vertex arrays in OpenGL

☆樱花仙子☆ 提交于 2019-12-11 04:57:59
问题 I'm trying to draw one cube with different textures for each face. I've come across many tutorials which state that in the display() routines, you need to enable all texture units before calling glDrawElements() . I do this my calling: gl.glClientActiveTexture(GL.GL_TEXTURE0); gl.glBindTexture(GL.GL_TEXTURE_2D, textureId); gl.glBindBuffer(GL.GL_ARRAY_BUFFER, getTexCoordBufferObject()); gl.glTexCoordPointer(2, GL.GL_FLOAT, 0, 0); gl.glClientActiveTexture(GL.GL_TEXTURE1); gl.glBindTexture(GL.GL

OpenGL ES (iPhone) multi-texturing (2D) code

前提是你 提交于 2019-12-10 19:13:23
问题 I have a texture from this PNG: And another from this PNG: They both have the same blend function: glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); I want to see them on one single polygon first. I just couldn't find a simple example of this. Draw them to different polygons works perfect, but I just cannot "merge" them into one texture. Any working sample codelines would be appreciated well. Second problem is to make the specular map's alpha variable. I can see that I have to texture combine

OpenGL ES 1 multi-texturing with different uv coordinates

橙三吉。 提交于 2019-12-04 08:42:28
问题 I need to render an object using multi-texturing but both the textures have different uv coordinates for same object. One is normal map and other one is light map. Please provide any useful material regarding this. 回答1: In OpenGL ES 2 you use shaders anyway. So you're completely free to use whatever texture coordinates you like. Just introduce an additional attribute for the second texture cooridnate pair and delegate this to the fragment shader, as usual: ... attribute vec2 texCoord0;