HI Sajjad,

osg::Program has have a list of shaders, think of shaders like .cpp's
that go together to make a C++ program.  You can have just the main or
a whole series of separate files.  The osg::Program is what tells the
OSG/OpenGL what shaders should linked together to make the final
program downloaded to the GPU.

Now if you want different compositions of shaders at different points
in your scene graphs then you'll need to link them together with
separate osg::Program, or use a single osg::Program and uniforms to
option select different paths in the shaders.

Robert.

On Sat, Apr 25, 2009 at 7:54 AM, ami guru <dosto.wa...@gmail.com> wrote:
> Hello forum,
>
> I am trying to implement some of  the shaders in a single OSG application.
> At  the same time i was going through the osgshaders example and if i have
> understood that correctly,
> i saw that the example has separate osg::program for different shaders
>
> I was wondering if it is possible to have one single program to manage all
> the shaders. I think osg::Program
> contains a vector of shaders.
>
> Is that possible to store different shaders by different name and load that
> according to  the user selection;
> delete previous shader and load the currently selected one.
>
>
> Or separate osg::program for different shader example is best approach.
>
> I am considering different design issue here.
>
> Any opinion regarding that will be helpful.
>
>
> Thanks
> Sajjad
>
> _______________________________________________
> 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

Reply via email to