[osg-users] multiple pixel shaders for one program ?

Paul Martz pmartz at skew-matrix.com
Mon Nov 30 12:27:27 PST 2009


Just a note for the archives, for people who come across this later... 
This is not really an OSG topic per se, so I wanted to make sure that 
people were aware of the orange book: OpenGL Shading Language. And also 
the GLSL spec is absolutely free for download as a PDF from opengl.org. 
Shader topics are covered in those sources quite completely.

Paul Martz
Skew Matrix Software LLC
_http://www.skew-matrix.com_ <http://www.skew-matrix.com/>
+1 303 859 9466



Sebastien Nerig 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
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> 
> 


More information about the osg-users mailing list