Hi Harald,
On Tuesday 08 May 2007, Harald JOHNSEN wrote:
> To recap we have (or should have in the future) :
> - one drawable per model / part of model
Not sure what this means, the Drawable's are the leaf nodes in osg. They can
have StateSet's attached to it. With one Drawable there is one display list.
That means if we want to share the geometry te drawables must be shared.
When you get models from the loaders there might be textures attached to the
drawables which is not that good in presence of liveries and material
animations.
When a new model is loaded osgDB provides you a cached model that is already
loaded. This one is cloned except the Texture StateAttributes and the
drawables. This way you will share the display lists and the textures.
> - one texture per texture loaded
Yes. osgDB hands you over a cached Image. Comparing two texture state
attributes with the same parameters and the same texture are identical and
the osgDB step during model loading to share duplicate state will collapse
them together.
> - one state per static / animation material
??
> - adding a 'model' will add a geode with a new state pointing to a
> cached texture and to a cached drawable
Not only a geode, but a whole tree. You get a cached complete tree. That is
cloned except the drawables and textures. These are shared.
Note that the StateSet's are not shared anymore, just the Texture
StateAttributes.
> - animation material can be shared by several geodes
> (by animation material I mean any animation that can alter the state,
> not the one we have atm).
Yes.
But that fine grained rewriting of materials that we have done in plib is a
kind of a problem.
IMO, we should change the material animation to require a whole material set.
One remaining thing we cannot really get around is when we have colors
attached to the drawables.
Also a side note: We have currently a post processing step that cripples down
the material information in the loaded models to match the plib behavior (the
color material is changed hard from ambient(?) to ambient and diffuse). But
the ac3d loader loads the models with the material information that is in the
ac3d file. In the longer term we should rework the models so that they do not
need to be changed. That will leave the modeler more room for working with
the materials.
Greetings
Mathias
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Flightgear-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/flightgear-devel