Hi,

maybe check code in osgfpdepth example.

jp

On 26/01/2012 12:13, Aurelien Albert wrote:
Hi,

I've done all the tests, and they are all ok.

May the problem comes from the depth buffer attachment ?

When I use :


Code:
p_camera->attach(osg::Camera::COLOR_BUFFER, p_renderTextureColor, 0, 0, false, 
4, 4);
p_camera->attach(osg::Camera::DEPTH_BUFFER, p_renderTextureDepth, 0, 0, false, 
4, 4);

or :

p_camera->attach(osg::Camera::COLOR_BUFFER, p_renderTextureColor, 0, 0, false, 
4, 4);
p_camera->attach(osg::Camera::DEPTH_BUFFER, p_renderTextureDepth);




There is black screen, but if I don't attach depth buffer, I got something rendered and 
no "Warning: detected OpenGL error 'invalid operation' at after 
RenderBin::draw(..)" errors in the console.

Here is how I create my textures :


Code:
// Main color texture
p_renderTextureColor = new osg::Texture2D();
p_renderTextureColor->setTextureSize(p_osgViewport->width(), 
p_osgViewport->height());
p_renderTextureColor->setInternalFormat(GL_RGBA32F_ARB);
p_renderTextureColor->setSourceFormat(GL_RGBA);
p_renderTextureColor->setSourceType(GL_FLOAT);
p_renderTextureColor->setFilter(osg::Texture2D::MIN_FILTER, 
osg::Texture2D::LINEAR);
p_renderTextureColor->setFilter(osg::Texture2D::MAG_FILTER, 
osg::Texture2D::LINEAR);
p_renderTextureColor->setWrap(osg::Texture::WRAP_S, 
osg::Texture::CLAMP_TO_EDGE);
p_renderTextureColor->setWrap(osg::Texture::WRAP_T, 
osg::Texture::CLAMP_TO_EDGE);
p_renderTextureColor->setDataVariance(osg::Object::DYNAMIC);
p_renderTextureColor->setUseHardwareMipMapGeneration(false);
p_renderTextureColor->setResizeNonPowerOfTwoHint(false);

// Main depth texture
p_renderTextureDepth = new osg::Texture2D();
p_renderTextureDepth->setTextureSize(p_osgViewport->width(), 
p_osgViewport->height());
p_renderTextureDepth->setSourceFormat(GL_DEPTH_COMPONENT);
p_renderTextureDepth->setSourceType(GL_FLOAT);
p_renderTextureDepth->setInternalFormat(GL_DEPTH_COMPONENT32F);
p_renderTextureDepth->setFilter(osg::Texture2D::MIN_FILTER, 
osg::Texture2D::LINEAR);
p_renderTextureDepth->setFilter(osg::Texture2D::MAG_FILTER, 
osg::Texture2D::LINEAR);
p_renderTextureDepth->setWrap(osg::Texture::WRAP_S, 
osg::Texture::CLAMP_TO_EDGE);
p_renderTextureDepth->setWrap(osg::Texture::WRAP_T, 
osg::Texture::CLAMP_TO_EDGE);
p_renderTextureDepth->setDataVariance(osg::Object::DYNAMIC);
p_renderTextureDepth->setUseHardwareMipMapGeneration(false);
p_renderTextureDepth->setResizeNonPowerOfTwoHint(false);





Thank you!

Cheers,
Aurelien[/code]

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=45036#45036





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

--
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
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to