0

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.

eight
  • 167
  • 2
  • 13
  • I have no knowledge of those frameworks, but the triangular area looks like uncleared video memory. – Tara Dec 01 '15 at 03:13
  • @Dudeson: It sure is. It seems the texture layout is wrong in some sense, so it does not fill this triangle. – eight Dec 01 '15 at 08:56
  • Could it be that the rectangle you're trying to draw is not covering the whole screen (leaving out the triangle region)? – Tara Dec 01 '15 at 14:14
  • @Dudeson: no, it is exactly equal to the screen's area – eight Dec 01 '15 at 15:19

1 Answers1

2

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].
Paul Houx
  • 1,984
  • 1
  • 14
  • 16
  • Thanks Paul. Your answer got me going. I found that if I change GL_TRIANGLE_FAN in the SyphonServer.m (Syphon Framework), to GL_TRIANGLE_STRIP, the glitch is no more. – eight Dec 02 '15 at 13:32