Hi,
search for "hdr" in osgprerender and osgmultiplerendertargets examples.
jp
On 12/08/2011 09:54, "Martin Großer" wrote:
Hello Guys,
I am a little bit dissatisfied. I want to render into an Image. I need the
pixel data on the cpu memory. That is the reason why I don't use a texture as
target. Anyway I need a higher precision than 8 bit. So I tried to render into
an 16 Bit luminance image. Then I got an OpenGL error:
Warning: detected OpenGL error 'invalid enumerant' after RenderBin::draw(,)
I tried other internal formats (i.e. GL_RGBA16F_ARB and GL_RGBA32F_ARB), but I
got the same message.
Here is partial code from me:
// init image
_sumImg = new ::osg::Image;
_sumImg->allocateImage(1, 1, 1, GL_LUMINANCE16, GL_FLOAT);
//...
// init pre render camera
_preCam = new ::osg::Camera;
_preCam->setViewport(0,0,1,1);
_preCam->setProjectionMatrixAsOrtho2D(0,0.1,0,0.1);
_preCam->setClearColor(::osg::Vec4(0,0,0,1));
_preCam->setReferenceFrame(::osg::Transform::ABSOLUTE_RF);
_preCam->setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
_preCam->setRenderTargetImplementation(::osg::Camera::FRAME_BUFFER_OBJECT);
_preCam->attach(::osg::Camera::COLOR_BUFFER0, _sumImg);
_preCam->setRenderOrder(::osg::Camera::PRE_RENDER);
// get the pixel color at location (0,0)
::osg::Vec4 c = _sumImg->getColor(0,0);
Thanks
Martin
--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard.
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.
This message has been scanned for viruses and dangerous content by MailScanner,
and is believed to be clean.
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org