HI Sebastien, You can have multiple vertex, geometry and fragment osg::Shaders attached to a single osg::Program. All you need to do is make sure that just one of the osg::Shaders contains the main for each of the vertex, geometry and fragment components of the program - from you example it looks like you probably already have this planned so would expect you code as is to work.
Robert. On Mon, Nov 30, 2009 at 12:48 PM, Sebastien Nerig <[email protected]> wrote: > Hi, > > I would like to know if it is possible to do that : > > > Code: > > osg::Program* program = new osg::Program; > osg::Shader* shader = new osg::Shader(osg::Shader::FRAGMENT); > shader->loadShaderSourceFromFile("main.frag"); > program->addShader(shader); > > osg::Shader* shader1 = new osg::Shader(osg::Shader::FRAGMENT); > shader1->loadShaderSourceFromFile("common.frag"); > program->addShader(shader1); > > > > > Is it possible to add multiple pixel shaders for one program ? > So I can put all my "common" function into a shader into multiple shader > program. > > Thank you! > > Cheers, > Sebastien > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=20576#20576 > > > > > > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

