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
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
Hi robert
thx for your answer
Ok I tried what you said, but I still have a pb.
I made a shader common.frag with a basic fog function
Code:
uniform vec3 fogColor;
uniform float fogDensity;
vec3 fog(in vec3 color)
{
const float LOG2 = 1.442695;
float z = gl_FragCoord.z / gl_FragCoord.w;
Hi Sebastian,
Declare the function stub in the main.frag
vec3 fog(in vec3 color);
void main()..
K.
2009/11/30 Sebastien Nerig overse...@hotmail.com:
Hi robert
thx for your answer
Ok I tried what you said, but I still have a pb.
I made a shader common.frag with a basic fog function
you right !
Thank you!
Cheers,
Sebastien
--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=20585#20585
___
osg-users mailing list
osg-users@lists.openscenegraph.org
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
6 matches
Mail list logo