hi roger, > The main thing that I not sure on is whether any new materials encountered > at the osg::Geode and osg::Geometry stateSet levels need to be put in a > global "library" as they can never be referenced outside of the scope of the > geode node in the osg tree(on reviewing this I am not sure I am correct > here, what about geometries shared between geodes?). You definitely can share a osg::Program instance between the states, I'm not sure about the osg::Uniforms though, as they are directly connected with the osg::stateset.
If you put the materials in a global library (in exported COLLADA-files), it would be possible to tweak or use them in another context. I think when exporting to collada you don't just want to write to an OSG-intern fileformat, you might want to edit the shaders (materials) in one program, change models in another one, tweak the physics somewhere and then put it all together again, or use it in another app. But I think there is definitely a need for a better material/FX-presentation in OSG. Maybe we could use the osgFX-class for that, any ideas? It might be a lot easier to think of the material handling when the material is nicely encapsulated in some form of a FX-Class. The real power of COLLADA(FX) lies in its shader-handling and representation of techniques/passes, those are far beyond and more powerful than the usual fixed-function gl-statesets. Maybe we should also think about that, before pushing the reader/writer ahead. heinrich > I do not know whether > there is any local material mechanism or if the way the writer puts > geometries into a library-geometries forces a library_materials to be used. > I still cannot get my head round this. It may be better to implement as > closely as possible to original model used in the writer and then look for > optimisations later. > > Any comments? > > Roger > > > _______________________________________________ > 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/
