Looking at osg::State::setVertexPointer(const Array *array), I see that the "stride" parameter is always 0. If we relaxed this constraint, and allowed an Array to have a stride, I might be able to overcome the problem I am working on. Any comments on what impact this might have ?
Also, in order to accomplish what I'm after, I'd need a mechanism to allocate the underlying array on a 16 byte boundary. It looks as if this should be easily doable as MixinVector is a std::vector. Any thoughts on this? sean _________________________________________________________ Sean Spicer Executive Vice President & Chief Technology Officer Aqumin (www.aqumin.com) Office....+1.713.781.2121 Mobile...+1.713.447.2706 Fax.......+1.713.781.2123 On Thu, Mar 25, 2010 at 3:05 PM, Sean Spicer <[email protected]> wrote: > Without giving away too much IP, one of the reasons why one might want > to think about using Vec4Arrays is to take advantage of host-side SIMD > operations - which commonly use 128bit registers (4 floats). > > I agree, this is a can of worms. > > sean > _________________________________________________________ > Sean Spicer > Executive Vice President & Chief Technology Officer > Aqumin (www.aqumin.com) > Office....+1.713.781.2121 > Mobile...+1.713.447.2706 > Fax.......+1.713.781.2123 > > > > On Thu, Mar 25, 2010 at 2:53 PM, Jason Daly <[email protected]> wrote: >> Sean Spicer wrote: >>> >>> I came across a nasty little bug today: >>> >>> (a) Create an osg::Geometry and assign a vertex array that is an >>> osg::Vec4Array >>> (b) Try to pick with a LineSegmentIntersector >>> (c) CRASH >>> >>> Digging a little bit, it looks like LineSegmentIntersector assumes >>> that vertex arrays are always of type osg::Vec3Array. Are there any >>> plans to change this ? It looks like a tedious, but not terribly >>> invasive change. >>> >> >> Interesting find, Sean... >> >> My first reaction is, "Why would you ever use a Vec4Array for vertex >> coordinates?!", but an equally valid counter-argument would be that OpenGL >> allows 4-element vertices them, so OSG should support them. >> >> Next, you have to ask how to intersect a line segment with a geometry with >> Vec4Array vertices. Would you have to do the w-divide on the vertices >> before you did the intersection tests to be correct, or is it more correct >> to not do it, or do you have to do the modelview transform, then the >> w-divide, then the intersection... >> >> Then, you have to start wondering if there are any other assumptions like >> this being made anywhere (I found other possible cases in Tessellator and >> Optimizer, though it looks as if they just bail out instead of crashing when >> they don't find a Vec3Array). >> >> I think you may have opened a can of worms here :-) >> >> --"J" >> >> _______________________________________________ >> osg-users mailing list >> [email protected] >> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org >> > _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

