Jump to content
  • Advertisement
Sign in to follow this  
ForgottenMaster

OpenSceneGraph and shaders

This topic is 3611 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi guys, I'm starting to learn OSG and have tried to run a couple of the sample programs using shaders, also some sample code I found on the net using shaders and OSG. They run perfectly fine except that there are no shaders. The output in the console says: Error: glUseProgram not supported by OpenGL driver I am using windows and have the OpenGL 1.1 libraries and headers, but my graphics card supports OpenGL 2.1 and have used shaders through the extensions system in a piece of pure OpenGL software I have written, with no problems. So, I know that shaders should be used through the extension functions, e.g. glUseProgramObjectARB, glCreateShaderObjectARB, etc. and it is also my understanding that OSG should load the correct function ( either glUseProgramObjectARB or glUseProgram ) as long as one method exists. Please could somebody tell me why i'm getting this error when shaders have full support on my graphics card through extensions. Thanks in advance P.S. I am using OpenSceneGraph version 2.6.1

Share this post


Link to post
Share on other sites
Advertisement
If you develop opengl on a windows platform using the windows opengl libs, you can only support opengl version 1.1 for xp and 1.5 for vista.
The entry points for the functions you want to use are missing.

There are some free projects which use the extension and map the entry points to the known function names. One of those projects is glew (http://glew.sourceforge.net/).

I used glew for myself and it worked pretty well. Just be sure that the functions you are calling really exist in the graphics driver. There a glew function to help you find out which function you might call and which isnt supported by the driver.

Share this post


Link to post
Share on other sites
yeah, glew is the library I used for accessing the extensions in my pure OpenGL program and it worked okay so I know that the extensions I need are supported in hardware

In OSG though, it seems that everything is encapsulated, even the shaders and programs, so i'm not really sure how to use the extension functions such as glCreateShaderObjectARB with the OSG libraries since the shader and program objects in OSG are responsible for calling the correct functions.

Is there any way to tell the OSG libraries to use the extension function calls rather than the standard function calls such as glCreateProgram?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!