[英]Do I need attach renderbuffer to a framebuffer that has a texture attached already?
I created a framebuffer for offscreen rendering. 我创建了用于屏幕外渲染的帧缓冲区。 I made an empty texture with no data set up. 我没有设置数据就制作了一个空纹理。 I did not attached a color renderbuffer since there is the texture backing. 我没有附加颜色渲染缓冲区,因为有纹理支持。
In code: 在代码中:
//Generate framebuffer, hook up renderbuffer.
glGenFramebuffers(1, &_frameBufferName);
glBindFramebuffer(GL_FRAMEBUFFER, _frameBufferName);
//DON'T Attach texture to framebuffer (RGBA).
//glGenRenderbuffers(1, &_colorRenderBufferName);
//glBindRenderbuffer(GL_RENDERBUFFER, _colorRenderBufferName);
//glRenderbufferStorage(GL_RENDERBUFFER, GL_RGBA4, _layerWidth, _layerHeight);
//glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, _colorRenderBufferName);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, _textureName, 0);
glClear(GL_COLOR_BUFFER_BIT);
It works actually, but xCode profiler always claims that the framebuffer has no attachments. 它实际上可以工作,但是xCode事件探查器始终声称帧缓冲区没有附件。 Do I need color renderbuffer here? 我需要彩色渲染缓冲区吗?
Seems no. 好像没有 http://developer.apple.com/library/ios/DOCUMENTATION/3DDrawing/Conceptual/OpenGLES_ProgrammingGuide/WorkingwithEAGLContexts/WorkingwithEAGLContexts.html#//apple_ref/doc/uid/TP40008793-CH103-SW6 http://developer.apple.com/library/ios/DOCUMENTATION/3DDrawing/Conceptual/OpenGLES_ProgrammingGuide/WorkingwithEAGLContexts/WorkingwithEAGLContexts.html#//apple_ref/doc/uid/TP40008793-CH103-SW6
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.