[osg-users] RE : Re: RE : multitexturing coordinates

Jean-Sébastien Guay jean-sebastien.guay at cm-labs.com
Thu Jul 10 20:40:59 PDT 2008

Hello Franclin,

> But for shape drawable, geometry information is hidden to clients (and 
> I don't know why but I suspect performance issues) that is why you need 
> to use shaders for them.

Well actually the Shape / ShapeDrawable classes were originally designed 
as simple debugging tools, so little thought was put into their design. 
They're just implemented as simple display lists with little 
customization possible, and no access to the internals. If you want to 
do any serious geometry with any acceptable level of control, you'll 
want to use osg::Geometry and define the vertices yourself.

One side of the coin:
I had suggested to Robert that I could reimplement the Shape / 
ShapeDrawable classes using an underlying osg::Geometry, so that they 
would behave as they do now but offer more control if needed (probably 
as it should have been done right from the beginning). He was open to 
this, but I haven't had time to do it yet.

The other side of the coin:
Do you know how easy it is to download Blender, create a sphere, save it 
and load it up with OSG? And when you do, it will be a full-fledged 
osg::Geometry and you will have total control over it. If you use the 
osg exporter for Blender you can even edit the .osg file and make sure 
it's structured exactly how you want it.

I generally favor using data for everything (as much as possible / 
reasonable) as opposed to hard-coding things, since later it's much 
easier to replace the sphere model by something else if it's a model 
file than if I have to open the project, find the relevant code, change 
it, compile it, test it...

This is just my opinion though, and the Shape / ShapeDrawable classes 
still have uses, which is why I still want to do what I mentioned above, 
someday. :-)

Hope this clears things up.

Jean-Sebastien Guay    jean-sebastien.guay at cm-labs.com

More information about the osg-users mailing list