I did something similar a while back. http://www.vrlab.umu.se/research/colosseum3d/images/cables2.avi
This is 100 segments simulated in 300Hz and controlled by a phantom haptic device. This is then refined using splines into more segments used for rendering. This version did not account for rotation of the controlpoints, which sometimes caused some rotation artefacts (where the normals were not defined). Also I did not spend that much time on the calculation of texture coordinates, which is as far as I know a fairly hard problem. The dynamic interpolation (depending on the gradient of the tangent) causes the total length of the cable to vary (whereas the texture coordinate is based in the linear distance of total length derived from the controlpoints). Using a vertexshader would speedup the skinning by an order of a magnitude. But in this example the rendering-time was not that bad. I was more or less drawing a skewed cylinder between the interpolated points. /Anders On Feb 4, 2008 7:40 PM, Mike Weiblen <[EMAIL PROTECTED]> wrote: > Hi J-S > > Some thoughts... > > - any ideas on exactly where you're bottlenecked? > > - if perception of cable width is critical, how are you ensuring the quads > are orthogonal to the viewer? Billboards, adjusting the quad verts, > viewer/quad relationship is fixed, etc? > > - quadstrips are converted to tristrips in the driver; perhaps there's > advantage in dispatching tristrips directly. > > - Ideally, and your target hardware supports it, suggest dispatch > linestrip and tessellate each linesegment into a pair of tris in a geometry > shader. A vertex shader could take care of texcoord computation given > cable/segment lengths. > > Cheers > -- mew > > > > > > -----Original Message----- > > From: [EMAIL PROTECTED] [mailto:osg-users- > > [EMAIL PROTECTED] On Behalf Of Jean-Sébastien Guay > > Sent: Monday, February 04, 2008 9:43 AM > > To: OpenSceneGraph Users > > Subject: [osg-users] Displaying cables > > > > Hello, > > > > I imagine this is pretty common, I'm just looking for a few hints of > > how > > to optimize things. > > > > Our apps need to display cables (and most of the time, a large number > > of > > them). The cables themselves are controlled by a physical simulation > > which gives us a set of transforms for the ends of each segment of a > > cable. > > > > For now, we are creating some geometry (quad strips, specifically) to > > display the cables, and assigning texture coordinates to that geometry, > > on the fly. This is needed because if, for example, a cable is > > lengthened (because it's being spooled out of a pulley system for > > example) the texture shouldn't stretch over it. Similarly, if the > > physical simulation subdivides the cable into more segments than it was > > in the last frame, we need to have correct texture coordinates to > > (hopefully) make the fact that the cable now has more, shorter segments > > invisible to the user. > > > > I know the cable display needs to be optimized because if I just set > > the > > cables' nodemasks to 0, the draw times go from 6.6ms to 2.2ms (for the > > same view). And there are not *that* many cables... There's a lot of > > other geometry in the scene which is still drawn in the 2.2ms time... > > > > So I would appreciate some pointers. I would have assumed quad strips > > are pretty fast, so perhaps something else is the problem? > > > > There's the fact that the geometry is dynamic, which could mean that > > OSG > > is trying to recreate display lists each frame, but I tried > > setUseDisplayList(false) on the geometry and the cables just did not > > display anymore... Is there something else I need to do in that case? > > > > Thanks in advance, > > > > J-S > > _______________________________________________ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > -- ________________________________________________________________ Anders Backman Email: [EMAIL PROTECTED] HPC2N/VRlab Phone: +46 (0)90-786 9936 Umea university Cellular: +46 (0)70-392 64 67 S-901 87 UMEA SWEDEN Fax: +46 90-786 6126 http://www.cs.umu.se/~andersb
_______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org