[osg-users] Strange behaviour on GBufferCamera with 2 attached osg::Image

Werner Modenbach Werner.Modenbach at texion.eu
Wed Jun 27 05:53:03 PDT 2018


Hi all,

I found a strange behavior of a GBufferCamera. I want to get the color
channel in one image and the depth channel in another image.When
What I do:

if(!renderImage.valid()){

renderImage=newosg::Image;

renderImage->allocateImage(width,height,1,GL_RGBA,GL_UNSIGNED_BYTE,1);

renderImage->setInternalTextureFormat(GL_RGBA8);

}

if(includeDepth&&!depthImage.valid()){

depthImage=newosg::Image;

depthImage->allocateImage(width,height,1,GL_DEPTH_COMPONENT,GL_FLOAT,1);

renderImage->setInternalTextureFormat(GL_LUMINANCE32F_ARB);

}

if(!includeDepth)
renderCamera=view->createRTTCameraImage(osg::Camera::COLOR_BUFFER,0,renderImage.get(),true);
else
renderCamera=view->createRTTCameraGBufferImage(osg::Camera::COLOR_BUFFER0,renderImage.get(),osg::Camera::DEPTH_BUFFER,depthImage.get(),
osg::Camera::COLOR_BUFFER1,0,0,true);

The definition of createRTT...

osg::Camera*createRTTCameraGBufferImage(osg::Camera::BufferComponent_bufferType1,osg::Image*_image1,
osg::Camera::BufferComponent_bufferType2,osg::Image*_image2,

osg::Camera::BufferComponent_bufferType3,osg::Image*_image3,

int_orderNumber,bool_isAbsolute,bool_withScreenQuad=true);


When rendering without depth, I get a correct color channel image.
When rendering both, color and depth, the depth image is OK but the
color image seems having only the red color information.
Are there any limitations in using 2 images?

Has anybody else had such an effect already or can anybody give me a hint?

Many thanks in advance

- Werner -

Many thanks in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20180627/2803bcb0/attachment.html>


More information about the osg-users mailing list