Opengl 如何在GPUImage过滤器中传递静态数组?

Opengl 如何在GPUImage过滤器中传递静态数组?,opengl,glsl,gpuimage,Opengl,Glsl,Gpuimage,我想用 filter.arrayValue = array[80]; 在my.swift控制器中,将数组[80]输入到GPUImage过滤器 有人能给我举个例子如何实现这一点吗 以下是如何将CGFloat传递给(texelWidth in)GPUImage过滤器 in.h 英寸 您的示例是将数组传递给过滤器的着色器文件,而不是过滤器本身。你的意思是吗?你的例子是将数组传递给过滤器的着色器文件,而不是过滤器本身。你是这个意思吗? CGFloat texelWidthUniform; @prope

我想用

filter.arrayValue = array[80];
在my.swift控制器中,将数组[80]输入到GPUImage过滤器

有人能给我举个例子如何实现这一点吗

以下是如何将CGFloat传递给(texelWidth in)GPUImage过滤器

in.h

英寸


您的示例是将数组传递给过滤器的着色器文件,而不是过滤器本身。你的意思是吗?你的例子是将数组传递给过滤器的着色器文件,而不是过滤器本身。你是这个意思吗?
CGFloat texelWidthUniform;
@property(nonatomic, readwrite) CGFloat leftEyeParameter;
@synthesize texelWidth = _texelWidth;

- (id)initWithFragmentShaderFromString:(NSString *)fragmentShaderString;
{
    .....

    texelWidthUniform = [filterProgram uniformIndex:@"texelWidth"];
    ....    
    return self;
}

- (void)setTexelWidth:(CGFloat)newValue;
{
    hasOverriddenImageSizeFactor = YES;
    _texelWidth = newValue;

    [self setFloat:_texelWidth forUniform:texelWidthUniform program:filterProgram];
}