¡@

Home 

2014/10/15 ¤U¤È 10:10:27

iphone Programming Glossary: inputtexturecoordinate

How do I blend two textures with different co-ordinates in OpenGL ES 2.0 on iPhone?

http://stackoverflow.com/questions/12242443/how-do-i-blend-two-textures-with-different-co-ordinates-in-opengl-es-2-0-on-ipho

GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA glVertexAttribPointer position 2 GL_FLOAT 0 0 imageVertices glVertexAttribPointer inputTextureCoordinate 2 GL_FLOAT 0 0 textureCoordinates glClearColor 0.0 0.0 0.0 0.0 glClear GL_COLOR_BUFFER_BIT glDrawArrays GL_TRIANGLE_STRIP.. viewRenderbuffer context presentRenderbuffer GL_RENDERBUFFER Vertex shader... attribute vec4 position attribute vec4 inputTextureCoordinate varying vec2 textureCoordinate void main gl_Position position textureCoordinate inputTextureCoordinate.xy Fragment shader..... attribute vec4 inputTextureCoordinate varying vec2 textureCoordinate void main gl_Position position textureCoordinate inputTextureCoordinate.xy Fragment shader... varying highp vec2 textureCoordinate uniform sampler2D inputTextureTop uniform sampler2D inputTextureBot..