¡@

Home 

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

iphone Programming Glossary: inputtexturebot

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

glActiveTexture GL_TEXTURE3 glBindTexture GL_TEXTURE_2D textureBot glUniform1i inputTextureTop 2 glUniform1i inputTextureBot 3 glUniform1f alphaTop alpha glEnable GL_BLEND glBlendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA glVertexAttribPointer position.. Fragment shader... varying highp vec2 textureCoordinate uniform sampler2D inputTextureTop uniform sampler2D inputTextureBot uniform highp float alphaTop void main lowp vec4 pixelTop texture2D inputTextureTop textureCoordinate lowp vec4 pixelBot.. float alphaTop void main lowp vec4 pixelTop texture2D inputTextureTop textureCoordinate lowp vec4 pixelBot texture2D inputTextureBot textureCoordinate gl_FragColor someBlendOperation pixelTop pixelBot iphone ios opengl es opengl es 2.0 textures share..