PDA

View Full Version : shader file call in .osg file



Mr. D
03-24-2008, 10:35 AM
Hello

was wondering if anyone has got a shader to load and run from a .osg file (not strictly openGL).

in file had simple
Program...
Shader...
code {
"void main (void)"
"{"
" gl_FragColor = vec4( 0.0, 0.0, 1.0, 1.0 );"
"}"
}

which does give me a blue shaded object as expected.
but tried to replace code with a blue.frag file
code {
file "blue.frag"
}
which does nothing, though it does appear the file is read, just does not apply itself.

so was wondering if other gl-language is needed other the just the file name?
such as using a file call on a texture which then needs futher parameters to work.

thank you Mr. D