osg,COLOR_BUFFER1怎么用?

时间:2014-06-24 16:10:29

标签: opengl buffer openscenegraph

我正在创建一个程序来更好地理解渲染过程并延迟渲染。在其中我需要从片段着色器传递屏幕的正常纹理并将其发送到另一个管道。

我尝试使用以下行归档它:

/////////////////////

osg::ref_ptr<osg::Texture2D> normText = new osg::Texture2D();

normText->setDataVariance(osg::Object::DYNAMIC);

normText->setInternalFormat(GL_RGBA);

cam2->attach(osg::Camera::COLOR_BUFFER1, normText);

// And in the first fragment shader I'm trying to write in this COLOR_BUFFER1 like this:

gl_FragData[1]=vec4(myNormals,1);

/////////////////////

由于某种原因,它不起作用。有了这些,我也传递了一种颜色和深度的纹理(就我所知,它们有自己的缓冲区......)虽然这两个没有问题。

0 个答案:

没有答案
相关问题