ios - How to create a filter with four input textures using GPUImage -
ios - How to create a filter with four input textures using GPUImage -
i have fragment shader code requires 4 input textures this:
precision lowp float; varying highp vec2 texturecoordinate; uniform sampler2d inputimagetexture; uniform sampler2d inputimagetexture2; uniform sampler2d inputimagetexture3; uniform sampler2d inputimagetexture4; void main() { vec4 texel = texture2d(inputimagetexture, texturecoordinate); vec3 bbtexel = texture2d(inputimagetexture2, texturecoordinate).rgb; texel.r = texture2d(inputimagetexture3, vec2(bbtexel.r, texel.r)).r; texel.g = texture2d(inputimagetexture3, vec2(bbtexel.g, texel.g)).g; texel.b = texture2d(inputimagetexture3, vec2(bbtexel.b, texel.b)).b; vec4 mapped; mapped.r = texture2d(inputimagetexture4, vec2(texel.r, .16666)).r; mapped.g = texture2d(inputimagetexture4, vec2(texel.g, .5)).g; mapped.b = texture2d(inputimagetexture4, vec2(texel.b, .83333)).b; mapped.a = 1.0; gl_fragcolor = mapped; } and gpuimage provide gpuimagethreeinputfilter @ most, how write filter 4 input texture ? have read ifimagefilter available more 3 input textures (up 6 input textures), can not compiled latest gpuimage.
ios opengl-es gpuimage
Comments
Post a Comment