On 5/31/06, David Lascombe <[EMAIL PROTECTED]> wrote:
Thanks for answering.
Actually I'd like to have everything in greyscale.
I never programmed shaders but if I have to I'll get at it. So GLSL is a
shader language, isn't it? Is this specific to Nvidia adapters? I'd like to
have a final program able to run on as much graphic systems as possible, as
long as it is compiled under a unix OS.
GLSL is the OpenGL Shaderl Language and a core part of OpenGL 2.0, so
all systems that support 2.0 support GLSL, although they might have to
provide a software fallback path for all or part of the GLSL
functionality. All modern ATI and NVidia hardware support GLSL.
Under OSX there isn't yet OpenGL 2.0, but OpenGL 1.5 + GLSL as an
extension, but the OSG is able to handle GLSL as an extension without
any problems so you won't notice any difference.
A shader is basically like writitng a C program, albeit range specific
in form, have a look through the glsl_*.osg examples in
OpenSceneGraph-Data and the OSG examples which reference osg::Shader
in the OpenSceneGraph/examples directory - grep is your friend!
As for writing a shader to convert a colour scene into grey scale, the
basic idea would be to render the scene as usual so replicant all the
usual fragment operations, then add on at the end of the fragment
program an colour matrix op to convert the RGBA colour to a grey scale
equivilant.
Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/