Hi J-S,

I've now had chance to have a look at your suggested optimisations, and I think 
they form the basis of a solution for me, so thanks for that. However there is 
one thing which troubles me a little, which is that the 
FLATTEN_STATIC_TRANSFORMS_DUPLICATING_SHARED_SUBGRAPHS optimisation, whilst 
flattening the static scalings, applies those scalings to the normals as well 
as the vertices. Whilst I can understand that this might be desirable for some 
strange effects, would you agree that the normals should at least be normalised 
after this process, else undesirable lighting anomalies can occur?

Neil.


---- "Jean-Sébastien Guay" <jean-sebastien.g...@cm-labs.com> wrote: 
> Hi Neil,
> 
> I'm reordering your questions a bit to make the response more linear :-)
> 
> > Has anyone considered this already and come up with a really neat solution 
> > ? I recognise that coding around driver issues is not ideal, and may not be 
> > desireable.
> 
> Yes, the osgUtil::Optimizer supports what you want. So you could use one 
> of the osgUtil::Optimizer classes to the work for you (independently of 
> whether your input model was COLLADA or any other format). Optionally 
> you could just call osgconv with the appropriate OSG_OPTIMIZER 
> environment variable on your model. Here are the relevant 
> classes/environment options:
> 
> > One of the comments I read on the mail archive seemed to imply that in 
> > general to  avoid these scaling problems, the model vertices should be 
> > scaled directly, and not via matrix operations. 
> 
> osgUtil::FlattenStaticTransformsVisitor
> FLATTEN_STATIC_TRANSFORMS
> 
> > I guess there are some complications here as if differing nodepaths to the 
> > same model produce differing scaling factors, the collada export is going 
> > to need to write geometry definitions for each of these nodepath scaled 
> > model instances.
> 
> osgUtil::FlattenStaticTransformsDuplicatingSharedSubgraphsVisitor (wow 
> what a mouthful :-)
> FLATTEN_STATIC_TRANSFORMS_DUPLICATING_SHARED_SUBGRAPHS
> 
> I have never used those myself, but they should work. Let us know how 
> you get on. The Optimizer also has a lot more things it can do to help 
> you optimize your scene graph, so it's worth it to explore the options 
> (osgconv --help-env) and the osgUtil/Optmizer header.
> 
> Hope this helps,
> 
> J-S
> -- 
> ______________________________________________________
> Jean-Sebastien Guay    jean-sebastien.g...@cm-labs.com
>                                 http://www.cm-labs.com/
>                          http://whitestar02.webhop.org/
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to