本文主要是介绍RenderStage::runCameraSetUp(), FBO setup failed, FBO status= 0x8cd6,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
RenderStage::runCameraSetUp(), FBO setup failed, FBO status= 0x8cd6
Warning: RenderStage::runCameraSetUp(State&) Pbuffer does not support multiple color outputs.
1、attach(BufferComponent buffer, osg::Texture* texture…)
经测试,相同的源码osg3.4版本报错,osg3.6版本正常。后来经过对3.4版本下,rtt、mtr横向对比,发现出问题的原因是{
osg::Texture2D::setInternalFormat(internalFormat);
osg::Texture2D::setSourceFormat(GL_RGBA);
osg::Texture2D::setSourceType(GL_FLOAT);
}代码段,3.4版本必须明确指定多目标的输出格式如:osg::Texture2D::setSourceFormat(GL_RGBA);而3.6则不用,从此可见 osg不同版本对glsl的支持是有差异的。
2、attach(BufferComponent buffer, osg::Image* image…)
attach到image,但image没有分配内存,错误示例:
osg::ref_ptr<osg::Texture2D> texture = new osg::Texture2D;texture->setInternalFormat(GL_RGBA32F_ARB);texture->setSourceFormat(GL_RGBA);texture->setSourceType(GL_FLOAT);texture->setTextureSize(s, t);...pCamera->attach(osg::Camera::COLOR_BUFFER1, texture ->getImage());
正确示例:
osg::ref_ptr<osg::Texture2D> texture = new osg::Texture2D;osg::ref_ptr<osg::Image> img = new osg::Image;img->allocateImage(s, t, 1, GL_RGBA, GL_FLOAT);img->setInternalTextureFormat(GL_RGBA32F_ARB);texture->setImage(img);...pCamera->attach(osg::Camera::COLOR_BUFFER1, texture ->getImage());
这篇关于RenderStage::runCameraSetUp(), FBO setup failed, FBO status= 0x8cd6的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!