I'd think the combination of X and Y data would have to be done somewhere,
so even if OSG or OpenGL provided some mechanism for letting you keep these
as separate arrays, OSG or OpenGL would still have to do the combination
(eventually), and presumably at the same cost as if you had done it
yourself.

But then I thought about this a little more, and I couldn't help but wonder
if a vertex program might be able to help you out. I haven't experimented
with this, and I don't even know if it's possible. But perhaps there's a way
to keep a separate buffer object for each axis and combine them in a vertex
program or perhaps in a prerender pass? If so, this would probably execute
much faster on modern graphics hardware than attempting to combine them on
the CPU, due to parallel processing of vertices.

You could also use a vertex program to transform just one axis.

I'll let someone who has done more with vertex programs comment on this. If
I'm full of it, don't hesitate to say so; I'll readily admit I haven't
tinkered with vertex programs much.

Good luck with this,
   -Paul


> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of E. Wing
> Sent: Tuesday, November 28, 2006 3:54 PM
> To: [email protected]
> Subject: [osg-users] Dealing with separate X-Y-Z data arrays 
> (performance)
> 
> I'm using osg as a plotting system to plot data points to the 
> screen quickly. I have been putting osg::Vec3 points in 
> osg::Vec3Arrays and using osg::Geometry to draw points, lines, etc.
> 
> The code I'm integrating with likes to keep data on each axis 
> separate. Specifically, X and Y data points are kept in 
> separate C arrays. Currently, I do my own data copies to 
> combine the X-Y points (and add a fake Z) to build up a 
> Vec3Array. This is not exactly the speediest thing, so I'm 
> wondering if there is something in OpenGL or OSG that lets me 
> keep separate arrays for each axis.
> 
> To further impact things, it is possible that I might have to 
> do a non-linear transform on just one axis (e.g. turn the 
> X-axis to log10 scale). I have been throwing away my original 
> axis only copy of the data to save memory (though maybe I 
> shouldn't). So I would have to loop through my Vec3Array and 
> transform just the x components. There are low-level APIs 
> available to me that do fast math operations, but I don't 
> thnk they work on interleaved data structures like this 
> (assume a primitive array of data).
> 
> I'm wondering if anybody has any thoughts/recommendations on 
> how I might better approach this?
> 
> Thanks,
> Eric
> _______________________________________________
> 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