Just one more question...

I will go "osg::Geometry" way. Just one more question. Can I decide on each
frame how many lines will be draw? If I set a large buffer and than on each
frame decide that i want to render 234 lines of all possible 1000?




2006/12/12, Robert Osfield <[EMAIL PROTECTED]>:

Hi Ivan,


On 12/12/06, Ivan Bolčina <[EMAIL PROTECTED]> wrote:
> About my problem. Simple. There are bullets on scene(laser beams). Their
> number can be in typical range from 1 to 1000. They are represented with
> lines. Line has a length of 10, and two colors.
>
> I ment to draw them using a single drawable that is in geode. Drawable
would
> use glbegin,glvertex....,glend stuff. I would'n do any geometry
> transformation etc..  For culling I would relly on openGL.
> At least that was my idea.

A couple of suggestions:

1) if you are concerned about performance don't use glBegin/glEnd.

2) osg::Geometry supports rendering of lines, you can update the
vertex positions on the fly. See the osggeometry example.  For
updating geometry on the fly you'll need to disable
display lists via geometry->setUseDisplayList(false).

3) Perhaps osgParticle is appropriate.

4) Finally if you really want great performance but low CPU dispatch
overhead consider
  using a static geometry but animating the vertex position via
shaders.  The rain and
  snow precipitations effects work this way and are able to handle
hundreds of thousands
  or particles per frame at 60Hz with minimal load on the CPU and
pretty light load on the
  GPU.

Personally I creating a subclass from osg::Drawable for this task
would be anywhere on my possible range of ways of tackling the task.

Robert.





Fo

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to