【发布时间】:2015-12-01 02:53:22
【问题描述】:
我在 GPUImage 应用程序中实现了虹吸服务器。但是,它会产生一个三角形区域,如附图所示。
还是代码?
-
在我的视图中#viewDidLoad
NSOpenGLContext *ctx = [[GPUImageContext sharedImageProcessingContext] context]; syphonServer = [[SyphonServer alloc] initWithName:@”MyServer” context:ctx.CGLContextObj options:[NSDictionary dictionaryWithObject:SyphonImageFormatRGBA8 forKey:SyphonServerOptionImageFormat]];
-
在 myFilter#renderToTextureWithVertices 的末尾
[myServer publishFrameTexture:[firstInputFramebuffer texture] textureTarget:GL_TEXTURE_RECTANGLE_EXT imageRegion:NSMakeRect(0, 0, size.width, size.height) textureDimensions:size flipped:YES];
感谢您的意见。
【问题讨论】:
-
我不知道那些框架,但是三角形区域看起来像未清除的视频内存。
-
@Dudeson:确实如此。似乎纹理布局在某种意义上是错误的,所以它没有填满这个三角形。
-
会不会是您要绘制的矩形没有覆盖整个屏幕(省略三角形区域)?
-
@Dudeson:不,正好等于屏幕的面积