Hi Robert, Actually i understand it does not make sense to mix state calls like shaders with the osg::Drawable. I would first like to explain my target.
Project Target - 1) Have a independent Cubic class whih renders any general Cubic using the Shader code. Shader code takes a cubic equation and renders a Cubic on the screen. 2) This Cubic class should allow the possibility of being attached to scene graph as one of the nodes in the Scene Graph. Either as a Drawable or as a Geode. So Since I have only Shader code to be used to draw the Cubic I was thinking I should be implementing the drawImplementation Function of the osg::Drawable after subclassing it. But Now I understand that I can just subclass from the osg::Node and which can use the Shader and render the cubic and i need not have the osg::Drawable at all . Am I right ? regards, Amal. On 7/16/07, Robert Osfield <[EMAIL PROTECTED]> wrote:
On 7/16/07, Amal <[EMAIL PROTECTED]> wrote: > Hi Robert, > I saw the osgTerrain::TerrainNode and I saw that It Uses a geometry > Technique and the Geometry Technique in turn had TerrainGeometry thich has > the drawImplementation function. I will also try to derive the Cubics class > from the osgNode or osgGroup only and hide the implementation. > > Actually I will like to see a example in the drawimplementation of the > osg::Drawable just calls a shader code and does nothing else . Is there any > example for that ? In general you don't want to mix state calls like shaders inside Drawables as the OSG is designed to do all state handling within osg::StateSet's and vertex array + primitive drawing calls kept within Drawables. The reason for this separation is to enable efficient state sorting and lazy state updating, break this and you break the ability to scale your applications performance. So... you won't see shaders mixed directly into Drawables as its not a good practice. W.r.t subclass osg::Drawable just search the source code and osgteapot example. _______________________________________________ osg-users mailing list osg-users@openscenegraph.net http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
_______________________________________________ osg-users mailing list osg-users@openscenegraph.net http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/