Thanks Robert,
I found a (maybe temporary) solution with DrawArrays. I already submitted
changes to PrimitiveSet to make DrawElements* more flexible about how much
they draw. I think it's good functionality to have in any case. If it
doesn't interest you I'll try deriving from DrawElementsUShort and see if I
can get better performance than my DrawArrays solution.
--
Terry Welsh
www.reallyslick.com



> Hi Terry,
>
> On 17 July 2013 01:20, Terry Welsh <[email protected]> wrote:
>
> > I'm updating some old code and getting rid of deprecated Geometry
> > features. With DrawArrays I could change the number of vertices drawn
> with
> > setCount(). As far as I can tell, there is no equivalent call when using
> > DrawElementsUShort. Am I missing something? Is there a recommended
> solution
> > for only drawing part of your geometry and not all of it?
> >
>
> osg::DrawElement*() doesn't have support for varying the number of it's
> elements set to OpenGL, it just passes the whole array on.
>
> There are three routes you could possible take:
>
> 1) Have multiple DrawElements objects that target specific parts of the
> overall mesh that you want to render and just add/remove these as required.
>
> 2) Change the original draw so that it duplicates the vertex data and then
> just uses DrawArrays as before.
>
> 3) Subclass from osg::DrawElementsUShort to override the way it calls
> OpenGL so that it passes a custom set size rather than the
> std::vector::size() used in the default implementation.
>
> Robert
>
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to