Hi Jason/Otto,

I was looking at something similar recently... The only problem I had was that osg::Geometry assumed that I wanted to draw from the start of the array attached. I think if you want some specialised behaviour, like e.g. having a single static array attached to a geometry and drawing from different start positions in it, you'll have to make your own drawImplementation. Other options might be using drawElements with multiple geometries and a shared array, or shaders.

jp

Jason Beverage wrote:
Hi Otto,

To use VBO's in OSG, you just need to set up an osg::Geometry as you normally would and then call:

geometry->setUseDisplayList( false );  //Disable display lists
geometry->setUseVertexBufferObjects( true ); //Enable VBO

After that everything is handled under the hood for you, you can look at the osgTerrain library or the osgdrawinstanced example for examples.

Thanks!

Jason

On Wed, Jan 6, 2010 at 9:12 AM, Otto Cologne <[email protected] <mailto:[email protected]>> wrote:

    Hi,

    I'm in the process of rewriting a program I did earlier but this
    time using OSG. One part contained rendering a large amount of lines
    which would be selected by various selection tools. For that I used
    VBO's and a bit mask. The rendering function (after all the
    initializations) then looked like this


    Code:

    for ( int i = 0; i < m_countLines; ++i )
    {
       if ( m_selected[i] )
               glDrawArrays( GL_LINE_STRIP, getStartIndexForLine( i ),
    getPointsPerLine( i ) );
    }




    Now i'm reading through the osg doc and  the tutorials, but the
    coverage on VBO's is rather thin. I'd appreciate some hints on how
    to do it if the functionality exists or if I have to write my own
    osg node.
    ...

    Thank you!

    Cheers,
    Otto

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





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



------------------------------------------------------------------------

_______________________________________________
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. MailScanner thanks Transtec Computers for their support.

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

Reply via email to