GPUImage and Syphon

123 views Asked by At

I have implemented a syphon server within a GPUImage application. However it produces a triangular area as seen in the attached image.

Can anyone say what’s wrong looking at the image? syphon glitch

Or Code?

  1. In MyView#viewDidLoad

    NSOpenGLContext *ctx = [[GPUImageContext sharedImageProcessingContext] context]; syphonServer = [[SyphonServer alloc] initWithName:@”MyServer” context:ctx.CGLContextObj options:[NSDictionary dictionaryWithObject:SyphonImageFormatRGBA8 forKey:SyphonServerOptionImageFormat]];

  2. At the end of the myFilter#renderToTextureWithVertices

    [myServer publishFrameTexture:[firstInputFramebuffer texture] textureTarget:GL_TEXTURE_RECTANGLE_EXT imageRegion:NSMakeRect(0, 0, size.width, size.height) textureDimensions:size flipped:YES];

Thanks for the input.

1

There are 1 answers

2
Paul Houx On

My hypothesis is that two things are wrong:

  1. You're not clearing the back buffer before drawing the texture, leading to the garbled text you see.
  2. The full screen rectangle you draw uses the wrong indices for the second triangle. If numbered 0, 1, 2, 3 (clockwise, starting at top left), it looks like the indices are [0, 1, 3] and [0, 2, 3], instead of [0, 1, 3] and [1, 3, 2].