Hi Aurelien,

I'm also using FBO and mipmaps and I would like to know if you're solved your 
problem. I'm assuming FBO doesn't generate mipmap automatically as described is 
this document http://www.songho.ca/opengl/gl_fbo.html. 

So I created a drawcallback to my render-to-texture geometry and add this code:

Code:
struct DrawCallback : public osg::Drawable::DrawCallback
{
    DrawCallback(osg::Texture* texture) 
        : osg::Drawable::DrawCallback()
        , _texture(texture)
    {}

    ~DrawCallback()
    {}

    void drawImplementation(osg::RenderInfo& ri,const osg::Drawable* dr) const
    {
        dr->drawImplementation(ri);

        osg::FBOExtensions* fbo_ext = 
osg::FBOExtensions::instance(ri.getContextID(),true);
        ri.getState()->setActiveTextureUnit(0);
        ri.getState()->applyTextureAttribute(0, _texture.get());
        fbo_ext->glGenerateMipmapEXT(_texture->getTextureTarget());
    }
    osg::ref_ptr<osg::Texture> _texture;
};



I'm not sure about the final result as I've still some bugs. So I'm very 
interesting by your solution.

Regards,
Kenzo

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





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

Reply via email to