Hi Baptiste, I would recommend trying to keep a minimal set of osg::Program that are provided high up in the scene graph and apply to whole chunks. To do the multi-pass you'll then duplicate the high level nodes but share the subgraphs so the bulk of the scene graph remains the same.
Robert. On 21 August 2013 18:12, Baptiste S. <baptiste.sansie...@noos.fr> wrote: > Hello, > > I have a big 3d scene, so I have some drawables, each drawable have his > stateSet and each stateSet have a program (shader.vsh+shader.fsh) > (lambert/phong/...). > It works fine for a single pass. > > But if I want to make my rendering in 2 passes using different shading ?... > I explain : > - In the first pass I wan't to bake some data in some textures (using FBO) -> > One unique shader for the scene > - In the second pass, I will use classical illumination shaders and render to > a texture too -> One shader per drawable > - In the last pass, I just render a quad with a shader wich will cook my > different textures ... > > So my problem is : how do I render the same scene twice with 2 different > shading without parsing all my drawables in my draw func to modify shaders ? > Is it possible to override stateSets ? > (Do not tell me to duplicate my scene please :? ) > > Thank you for your help ! > > Cheers, > Baptiste > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=55936#55936 > > > > > > _______________________________________________ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org