From: Michael Brooks Date: 2010-01-15T08:05:06+09:00 Subject: Re: 3D with Ruby (Ogre ?) Hello Michal: >"Michal Suchanek" wrote: >> >> I used the the gears.rb as the basis for a OpenGL programmable shader >> (i.e. >> GLSL) version of the gears program. The intro to it and download can be >> found through here: >> >> http://osdir.com/ml/ruby-talk/2009-03/msg00749.html >> >FWIW this does nt work for me on Linux. > >$ ruby gears_using_shaders.rb >Error - The program has terminated because the environment does not s>upport OpenGL 2.0 or greater GLSL shaders. >$ glxinfo >name of display: :0.0 >display: :0 screen: 0 >direct rendering: Yes >server glx vendor string: SGI >server glx version string: 1.2 >OpenGL vendor string: DRI R300 Project >OpenGL renderer string: Mesa DRI R300 (RV515 7153) 20090101 TCL >OpenGL version string: 1.5 Mesa 7.6.1 I implemented the OpenGL 2.0 or greater version of the shader functions so you'll likely need to install OpenGL 2.0 or greater drivers for your video card. It looks like you're running the software-only OpenGL drivers that come with Linux. In the initialize procedure I do the following check for the required OpenGL functions: # Exit if the environment can't handle the OpenGL 2.0 style # GLSL shader api commands if not (GL.respond_to?('CreateProgram') and GL.respond_to?('CreateShader') and GL.respond_to?('ShaderSource') and GL.respond_to?('CompileShader') and GL.respond_to?('AttachShader') and GL.respond_to?('LinkProgram') and GL.respond_to?('DeleteShader') and GL.respond_to?('DeleteProgram')) puts('Error - The program has terminated because the environment does ' + 'not support OpenGL 2.0 or greater GLSL shaders.') exit end In theory, if your MESA / SGI driver supported shaders through ARB extensions (like some earlier OpenGL's did) instead of as built in functions (like OpenGL 2.0+ in the recent ATI, Nvidia and Intel drivers) then you could modify this section and other sections of code to use the alternate (i.e. older) function names. However, I don't believe your drivers support shaders at all. Michael