> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:osg-users-
> [EMAIL PROTECTED] On Behalf Of Roger James
> Sent: 16 October 2006 17:53
> To: 'osg users'
> Subject: RE: [osg-users] Collada writer, materials and stateSets
>
>
>
> > -----Original Message-----
> > For this to work I'll have to change processMaterial to search for an
> > identical StateSet (in sense of the compare() method) and not only the
> > same StateSet as a pointer.
> > I think this should work well and at least all statesets would be taken
> > into account, even if it may not be optimal in terms of state switches.
> >
> >
> > --
> > Sebastien Grignard
>
> Sebastien,
>
> I have two questions that I need to think further about.
>
> 1. Can the stateSet comparison could be made robust enough. i.e. take into
> account image file names etc.
>
> 2. How this fits in with the writers current method of tying together the
> material URI (and local names) it generates for use in the <bind_material>
> clauses with the URIs it defines in the <library_materials>. At the moment
> these appear to be generated from the node name of the geode (if any). I
> would be worried about duplicates.
>
> Anyone else got any comments.
>
> Roger
>
>
>
Sebastien,
On yet further thought, what you are suggesting seems OK. The only
suggestion I would make is that before a stateSet is inserted in the map in
processMaterial it should be purged of all attributes that are not currently
involved in the generation of collada materials. This should help eliminate
some duplicate materials being inserted in the map.
So the material map would become
std::map< osg::StateSet, domMaterial *, BlackMagic > materialMap;
where BlackMagic is a function object that calls compare(xxxxxx, true) on
the stateSets to force compareAttributeContents. As you can tell by this I
have no idea how to define this without looking at my STL book!
That covers point 1 above. I think point 2 may be irrelevant.
Roger
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/