¡@

Home 

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

iphone Programming Glossary: vec4

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_RENDERBUFFER viewRenderbuffer context presentRenderbuffer GL_RENDERBUFFER Vertex shader... attribute vec4 position attribute vec4 inputTextureCoordinate varying vec2 textureCoordinate void main gl_Position position textureCoordinate.. viewRenderbuffer context presentRenderbuffer GL_RENDERBUFFER Vertex shader... attribute vec4 position attribute vec4 inputTextureCoordinate varying vec2 textureCoordinate void main gl_Position position textureCoordinate inputTextureCoordinate.xy.. uniform sampler2D inputTextureTop uniform sampler2D inputTextureBot uniform highp float alphaTop void main lowp vec4 pixelTop texture2D inputTextureTop textureCoordinate lowp vec4 pixelBot texture2D inputTextureBot textureCoordinate gl_FragColor..

How do I modify a GPUImageGaussianSelectiveBlurFilter to operate over a rectangle instead of a circle?

http://stackoverflow.com/questions/12257429/how-do-i-modify-a-gpuimagegaussianselectiveblurfilter-to-operate-over-a-rectangl

uniform lowp vec2 excludeCirclePoint uniform lowp float excludeBlurSize uniform highp float aspectRatio void main lowp vec4 sharpImageColor texture2D inputImageTexture textureCoordinate lowp vec4 blurredImageColor texture2D inputImageTexture2 textureCoordinate2.. uniform highp float aspectRatio void main lowp vec4 sharpImageColor texture2D inputImageTexture textureCoordinate lowp vec4 blurredImageColor texture2D inputImageTexture2 textureCoordinate2 highp vec2 textureCoordinateToUse vec2 textureCoordinate2.x.. uniform lowp vec2 excludeCirclePoint uniform lowp float excludeBlurSize uniform highp float aspectRatio void main lowp vec4 sharpImageColor texture2D inputImageTexture textureCoordinate lowp vec4 blurredImageColor texture2D inputImageTexture2 textureCoordinate2..

Transitioning from OpenGL ES 1.1 to OpenGL ES 2.0

http://stackoverflow.com/questions/5866256/transitioning-from-opengl-es-1-1-to-opengl-es-2-0

using the model view matrix to adjust your vertices is as simple as placing a line like this in your vertex shader vec4 transformedPosition modelViewProjMatrix position Personally I replaced the glRotate etc. functions a long while ago using..

How can I improve the performance of my custom OpenGL ES 2.0 depth texture generation?

http://stackoverflow.com/questions/6051237/how-can-i-improve-the-performance-of-my-custom-opengl-es-2-0-depth-texture-gener

1.0 255.0 void main float distanceFromCenter length impostorSpaceCoordinate if distanceFromCenter 1.0 gl_FragColor vec4 1.0 else float calculatedDepth sqrt 1.0 distanceFromCenter distanceFromCenter mediump float currentDepthValue normalizedDepth.. ceiledValue ceil currentDepthValue 765.0 vec3 intDepthValue vec3 ceiledValue scaleDownFactor stepValues gl_FragColor vec4 intDepthValue 1.0 On an iPad 1 this takes 35 68 ms to render a frame of a DNA spacefilling model using a passthrough shader.. varying mediump float normalizedDepth varying mediump float adjustedSphereRadius void main gl_FragColor vec4 adjustedSphereRadius normalizedDepth impostorSpaceCoordinate 1.0 2.0 normalizedDepth 1.0 it takes 18 35 ms on iPad 1 but..