[osg-users] Shader Problems
Robert Osfield
robert.osfield at gmail.com
Thu Jan 3 12:15:02 PST 2008
Hi Steven,
The rather too little in the way of actual information about what you
have to done to know what's up - its a case of "my unspecified code
doesn't work, what's wrong". Shaders and Camera's do work just fine
in OSG-2.x so you've done some thing irregular, might this be a bug on
yourside, on the OSG? Who knows far to few details to hazard a gues.
The only point I can't comment on that setting modes on a Program has
no effect as GLSL doesn't have any OpenGL modes that control it so its
a non op.
Robert.
The best I can recommend is just moving your shaders onto another node
and see if it works,.
Robert.
On Jan 3, 2008 6:10 PM, Steven Powers <spowers at gdrs.com> wrote:
>
>
>
>
> I'm having problems getting my shaders to work properly. I had this working
> with OSG 1.2 on Windows.
>
>
>
> I'm setting them to a state set on a osg::Camera that is entered onto the
> scenegraph on the root node:
>
>
>
> osg::ref_ptr<osg::StateSet> ss =
> _camera->getOrCreateStateSet();
>
> osg::ref_ptr<osg::Program> program = new
> osg::Program;
>
> program->setName( "shader");
>
> program->addShader( new osg::Shader(
> osg::Shader::VERTEX, vertexShaderSrc ) );
>
> program->addShader( new osg::Shader(
> osg::Shader::FRAGMENT, fragShaderSrc ) );
>
>
>
> ss->setAttributeAndModes( program.get(),
> osg::StateAttribute::ON || osg::StateAttribute::PROTECTED);
>
> ss->setAttributeAndModes( mode.get(),
> osg::StateAttribute::ON || osg::StateAttribute::PROTECTED);
>
>
>
>
>
> I don't get any errors … the shader simply doesn't load. I've added syntax
> errors into the shader code and I don't get any errors reported.
>
>
>
> I do, however, get this output when I set the debug level to INFO:
>
>
>
> OpenGL extension 'GL_ARB_vertex_program' is not supported.
>
> OpenGL extension 'GL_ARB_framebuffer_object' is not supported.
>
> OpenGL extension 'GL_ARB_fragment_program' is not supported.
>
>
>
> The osgShaders example does not work either and I get repeated errors like:
>
> Error: glGetShaderiv not supported by OpenGL driver
>
> Error: glCreateProgram not supported by OpenGL driver
>
> Error: glAttachShader not supported by OpenGL driver
>
> Error: glAttachShader not supported by OpenGL driver
>
> Error: glLinkProgram not supported by OpenGL driver
>
> Error: glGetProgramiv not supported by OpenGL driver
>
> glLinkProgram "blocky" FAILED
>
>
>
>
>
> Something else (probably related) is when I use a FRAME_BUFFER_OBJECT as the
> target Implementation for the camera I get an error message:
>
> Error: Unable to create Window.
>
> This also happens in osgShadow
>
>
>
> Does this look like a driver problem?
>
>
>
>
> Steven Powers
>
> General Dynamics Robotic Systems
>
> Software Engineer
>
> 1234 Tech Court
>
> Westminster, MD 21157-3029
>
> (410) 876-9200 Fax: 410-876-9470
>
>
>
>
>
>
> _______________________________________________
> 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