Hi there, Sorry to interrupt, I have a similar issue with a flat scene graph and it's on my "Todo" list to remove position attitude transforms and flatten them onto the Geodes.
My application is a CAD style application, with a scene graph that consists of 300,000 objects, each object is 1x PAT, 1x Geode and 1x Geometry, each Geometry is about 100 vertices (average) and multiple primitives. Each "Object" is wrapped in a class I have defined that contains the OSG nodes. The PAT's are used to position the objects, however I only actually need them when updating an objects position via picking/manipulating and also in-code manipulation. I was thinking to store the position/attitude/scale in my wrapper class and when they are updated, get the geometry vertices, inverse transform them with the old matrixtransform, and forward transform them with a new matrix transform. Does this sound like a feasible way of removing the Pats? Thank you, Andrew On Tue, Aug 11, 2009 at 1:29 AM, Jean-Sébastien Guay < [email protected]> wrote: > Hi Jimmy, > > Regarding of having a flat scene graph. Does it matter if the whole scene >> will always be seen? Would it still improve the performance if I balance the >> scene graph more? >> > > In the case where the whole scene will always be seen (think about it > carefully, though, because I think these cases should be rare in practice) > then balancing the graph will not help, but removing groups and transforms > will. That is to say, if all your objects will always be visible, then in > order to reduce the cull time you need to reduce the number of objects to > traverse to get to the geometry. To reduce the draw time, you need to group > geometry so that data is uploaded to the card in good-sized chunks. > > So for example, if two objects will always be in the same position relative > to one another, place both in the same osg::Geometry, transforming the > vertices of the second one to be where the transform would have placed it > relative to the first. > > Say object 0 has vertex array V0 and object 1 has vertex array V1, and > suppose that object 0 is at world position T0 and object 1 is at position > T1, then you can build a vertex array V2 containing the vertices of both > objects like this: > > V2 = (V0, V1 + (T1 - T0)) > > (suppose the addition above will apply the same translation to all vertices > in V1) and then position the composite object at position T0. > > You can extend this if you have groups of many objects that will always be > in the same relative position from each other, of course. For example if a > city has buildings and all the buildings are static in world space, then > place them all in the world coordinate frame with no transforms or groups. > They can still be in different geometry objects if they have a sufficient > number of vertices (thousands). If not, then group several of them in the > same geometry object and use a texture atlas to texture them all with the > same texture file. > > Similar scene graph optimization tips have been discussed in the past on > the list. The archives should contain even more tips. I don't know if there > is a wiki page on openscenegraph.org that collects such tips, but if there > isn't we should create one... > > Hope this helps, > > J-S > -- > ______________________________________________________ > Jean-Sebastien Guay [email protected] > http://www.cm-labs.com/ > http://whitestar02.webhop.org/ > _______________________________________________ > 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

