Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: ARB vertex/fragment shader programming on Linux?

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2003
    Posts
    17

    ARB vertex/fragment shader programming on Linux?

    I'm trying to play around with vertex and fragment programming on Linux and I've run into a wall.

    I have an ATI Radeon 9700 and have installed the ATI Linux drivers for XFree86 version 4.2.1. I also have the DRI version of Mesa installed so that when I query the supported extensions using glGetString(GL_EXTENSIONS) in my program, I can see GL_ARB_vertex_program and GL_ARB_fragment_program in the list.

    However, because the Mesa headers and libraries installed on my system don't support the function calls and constants necessary to load vertex and fragment programs, I can't compile my program.

    I tried compiling and installing the latest version of Mesa (5.0.1), and while it has the right functions for loading vertex/fragment programs onto the graphics card, it doesn't support the ARB vertex and fragment extensions (only the NV ones). Also, it's not hardware accelerated since it doesn't use DRI.

    So I was wondering if it's currently possible to do shader programming on Linux using OpenGL with the ARB extensions?

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Dec 2001
    Location
    Wellington, New Zealand
    Posts
    544

    Re: ARB vertex/fragment shader programming on Linux?

    NVidia provide the appropriate headers and libraries with their Linux drivers. Do ATI not do the same?

    If not, use the extension specifications to find the constants and function signatures and create your own header. Use glxGetProcAddress(EXT|ARB) to load the functions at runtime.

  3. #3
    Advanced Member Frequent Contributor
    Join Date
    May 2001
    Location
    France
    Posts
    765

    Re: ARB vertex/fragment shader programming on Linux?

    You should forget about MESA as long as you want to benefit hardware acceleration.
    First of all, uninstall MESA and get back to your ATI implementation.

    Seconly, if you want to use extensions, you may need to get the "glext.h" header which is available at the OpenGL Extension Registry, be it for fancy extensions like fragment programs or for wide-spread extensions like multitexturing.

    And in order to load extensions, you may also need the glX headers in order to use the glXGetProcAddress function, at least if you're running X.

  4. #4
    Junior Member Newbie
    Join Date
    Jul 2003
    Posts
    17

    Re: ARB vertex/fragment shader programming on Linux?

    Here's what ATI provide with their Linux driver:

    - source for compiling their kernel module
    - libGL.so.1.2
    - configuration and test programs
    - X driver, DRI and DRM support in X
    - sample code

    So no OpenGL headers... not a big deal though, I just grabbed the ones from the extension registry site.

    However, I checked the list of symbols in ATI's libGL.so.1.2 using nm and couldn't find glGenProgramsARB(), glBindProgramARB(), glProgramString(), or glGetProgramiv() so I'm pretty sure that using glXGetProcAddress() to load those functions at runtime isn't going to work.

    I did see a link to some other ATI driver in Germany posted up in a few places. Anyone know if that driver provides the necessary files for shader development?

  5. #5
    Junior Member Regular Contributor
    Join Date
    Dec 2002
    Location
    Silicon Valley
    Posts
    234

    Re: ARB vertex/fragment shader programming on Linux?

    Yes. I have a Radeon 9800pro running on RedHat 9. I downloaded the glx1_linux_X4.3.zip driver from http://www.schneider-digital.de/html/download_ati.html and it works fine. I've been playing around with fragment programs for a while now.

    Oh, and I'm using an extension loading library. I think it's extgl.


    [This message has been edited by mogumbo (edited 07-23-2003).]

  6. #6
    Junior Member Newbie
    Join Date
    Jul 2003
    Posts
    17

    Re: ARB vertex/fragment shader programming on Linux?

    Thanks for the link. I downloaded those drivers and converted the .rpm file they contain to a .tgz file (I use Debian).

    However, it's really not my day... I unpacked the files to a temporary directory just to see what the package contained, and then typed the following command to start removing the unpacked files from the temp directory:

    rm -rf /usr

    oops...

    I stopped it, but not before I wiped out all of /usr/bin (and some other stuff). And yes, I dunno why I didn't just remove the entire temp directory.

    I'm now learning everything I didn't want to know about ext3 filesystem undeletion.

    Yup, really not my day...

    [This message has been edited by luxo (edited 07-23-2003).]

  7. #7
    Advanced Member Frequent Contributor
    Join Date
    May 2001
    Location
    France
    Posts
    765

    Re: ARB vertex/fragment shader programming on Linux?

    The very Gold rule : never login as root.

    At least, try to keep root sessions minimal. For instance, don't open a console with the root user. Prefer the 'su -c' command instead.

  8. #8
    Junior Member Newbie
    Join Date
    Jul 2003
    Posts
    17

    Re: ARB vertex/fragment shader programming on Linux?

    Yeah... technically, I wasn't logged in as root but I was doing a bunch of rooty stuff and was too lazy to type "sudo" before each command so I just used "su".

    I'm in the process of upgrading my computer and wanted to move all my files to a newer, bigger drive anyways so I guess this is as good an excuse as any to reinstall Linux. It's been about 4 years with the same install now and I've built up a lot of cruft on my system. And though I've discovered that ext3 undeletion is possible, undeleting that many files is far too painful.

    Anyways, this is about as far removed from OpenGL as you can get, so I'll stop posting and get to reinstalling.

  9. #9
    Junior Member Newbie
    Join Date
    Jul 2003
    Location
    BP
    Posts
    2

    Re: ARB vertex/fragment shader programming on Linux?

    Download latest extension library headers
    (glext.h, glxext.h) from:
    http://oss.sgi.com/projects/ogl-sample/registry/`

    Fast and ugly way:

    And simple overwrite existing (mesa header) files in /usr/include/GL/

    Note: package upgrading is dangerous in this case !

    Or

    Create your own modified package with new extension header files.

    Regards,
    Potyi

  10. #10
    Junior Member Newbie
    Join Date
    Jul 2003
    Posts
    17

    Re: ARB vertex/fragment shader programming on Linux?

    Yeah, I did that and I was still getting compilation errors about the functions I needed not being defined.

    I finally figured out the problem by grepping through glext.h though. I needed to define GL_GLEXT_PROTOTYPES in order to have those functions defined.

    Did that and now my program compiles fine and loads up my vertex program. Now that I've got past that part, I just need to display something to see if it works.

    Hopefully, it won't lock up my system like all the OpenGL games I've tried have (Unreal Tournament, Quake 3, UT2003)...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •