Hi James,

On 14 January 2014 14:29, James Turner <[email protected]> wrote:

> Firstly, am I correct that osg::Geometry::compileGLObjects is required for
> VBOs to function? Or is this purely an optional step?
>

compileGLObjects() will be called automatically for you, there is rarely
need to call it directly, and then only when you want to explicitly compile
objects prior to rendering such as when paging, but even then if you use
the OSG's built in osgDB::DatabasePager then the pre compile will be do for
you anyway.


>
> The motivation for this, is I can see two control-paths which call
> compileGLObjects; the GLObjectsVisitor triggered when the scene is set via
> View::setSceneData -> Renderer::setCompileOnNextDraw, and the
> ‘DoPreCompile’ path on the DatabasePager. The Geometry I’m adding above
> doesn’t enter the scene via either of these mechanisms, so as far as I can
> see from debugging, it is never compiled (perhaps this is a bug, and there
> is something I should be doing to force compilation, but I can’t see a safe
> way to get the Renderer and hence invoke setCompileOnNextDraw myself)
>

I don't know enough about your code to know whether anything is actually
being done wrong or going wrong somewhere.

In general you don't need to force a GL boejct compile, it'll happen
automatically for you when it comes to rendering the geometry



>
> Regardless of the answer to the above, are there any additional steps I
> need besides setUseVertexBufferObjects(true) on the osg::Geometry? And is
> there a good way at runtime to verify VBOs are being used successfully, for
> a particular Geometry?
>

There isn't any stats recorded for how many geometries use VBO's but you
could easily put a print statement into osg::Geometry/osg::BufferObject to
check when code paths it's using, or simply use a debugger and set a
breakpoint.

Normally one just needs to setUseVertexBufferObjects(true) and that's it,
so it's should be that your app is already using VBO's.  If there anything
that makes you think it's not?


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

Reply via email to