6 Replies Latest reply on Apr 2, 2012 12:06 PM by settle

    New to OpenGL, Please Help.

    settle

      I'm trying to learn more about OpenGL after learning OpenCL, but I don't know how exactly to start.  Is there an OpenGL SDK like there is for OpenCL?  I can't quite find one.  Anyone got a link?

       

      Also, in OpenGL is there the concept of Installable Client Driver (ICD) like there is in OpenCL?  What if you have graphics cards from two different vendors or no graphics card at all and need to run the OpenGL program on the CPU?

       

      Thanks for the help!

        • Re: New to OpenGL, Please Help.
          gsellers

          Hi There,

           

          Welcome to OpenGL! First off, you should prepare yourself - OpenGL is large and complex and there's a steep learning curve. However, there's lots of good resources. I'll answer your second question about the ICD first. Yes, there is an ICD model. If you have the latest drivers from your graphics card manufacturer then you should have up-to-date OpenGL drivers installed. If you have GPUs from multiple vendors installed, everything should work fine. You won't be able to share resources between contexts created by different vendor drivers, but otherwise you should be fine to run two or more OpenGL contexts across different GPUs.

           

          As for good OpenGL resources, here's a few I recommend.

           

           

          Besides this, there are a huge number of tutorials and examples written by individuals across the world and available online. Start with the resources above and if you don't understand something, search online and I'm sure you will find your answer. If you're still stuck, come back here and I'll get you going again. Your background in OpenCL will be valuable. I'm sure you'll pick this up quickly.

           

          Cheers,

           

          Graham

          1 of 1 people found this helpful
            • Re: New to OpenGL, Please Help.
              settle

              Hi Graham,

               

              Thank you for your help!  I bought the OpenGL Programming Guide thinking it would be at a similar level to the OpenCL Programming Guide, but I must agree OpenGL seems to have a much steeper learning curve.  I've heard good things about the OpenGL SuperBible, so I'll see if I can order that as well.

              • Re: New to OpenGL, Please Help.
                Skysnake

                The Red Book is a great! We have used it at the university too.

                • Re: New to OpenGL, Please Help.
                  settle

                  Hi Graham,

                   

                  I just watched your WebGL Camp Orlando Session 3 presentation in which you discussed about OpenGL ES, and ICDs and Khronos.  I found your talk really helpful and gave me much more incite.  Thanks!

                   

                  I'm interested in trying to do some things with OpenGL which are somewhat similar to that done at IBM with OpenCL ICDs.  IBM created an ICD that integrates the AMD, NVIDIA, and Intel ICDs.

                  OpenCL Multi-ICD.pngOpenCL Unified ICD.png

                  *OpenCL Common Runtime for Linux on x86 Architecture.

                   

                  I'd like to try to do something similar with OpenGL, for example an entirely software-based Crossfire/SLI solution with heterogeneous devices (and vendors?) or a local/remote renderer.  I've asked a few other places and the only feedback I've gotten was to try to do something similar to glIntercept and ApiTrace, but I feel an custom ICD would be much more flexible and elegant solution, especially if I can call to the AMD ICD.

                   

                  I bought the SuperBible in addition to the Red Book, but there isn't enough detailed information about the inner workings of ICDs for what I want to do.  I was hoping you could tell me if this is possible in OpenGL and where I could find the information needed to even start, do I have to join Khronos, etc.?  Thanks again!

                   

                  Cheers,

                  Sean

                    • Re: New to OpenGL, Please Help.
                      gsellers

                      Hi there,

                       

                      Well, the ICD model for OpenGL already exists on several platforms and is generally a feature of the operating system. For example, on Windows, the ICD loader is actually opengl32.dll - this is what you link to when you create an OpenGL application for Windows. When you create an OpenGL context, opengl32.dll uses the registry to discover the name of the underlying ICD and calls its functions on behalf of your application. See this link http://msdn.microsoft.com/en-us/library/windows/hardware/ff568203%28v=vs.85%29.aspx. When you install your vendor's drivers, the installer will set these registry keys and copy the ICD DLLs into the right place on your machine.

                       

                      If the function you're calling is one of the original OpenGL 1.4 functions such as glGetString or glDrawArrays, then that call will go into opengl32.dll and from there to the appropriate ICD. If the function you are calling is part of an extension or newer version of OpenGL, then the call will generally go directly to the ICD. Similar mechanisms may exist on other platforms.

                       

                      In theory, it would be possible to intercept calls to or even completely replace opengl32.dll. I would not advise this, as it is an extremely complex piece of software with many undocumented features.

                       

                      Also, you should be aware that Khronos does not own or publish the ICD model for Windows. Microsoft owns that, although it has not been updated in some time. Khronos may publish extension specifications for WGL or other windowing systems, but those are not officially part of any ICD model.

                       

                      Cheers,

                       

                      Graham

                        • Re: New to OpenGL, Please Help.
                          settle

                          Hi Graham,

                           

                          A quick follow-up question, who publishes the ICD model for Linux?  I know there is XGL for the X windowing system and in my Linux system I've got a libGL.so, but that just points to a fglrx-libGL.so.  Does that mean if I also had a non-AMD graphics card that it wouldn't be detected by OpenGL applications?

                           

                          Thanks,

                          Sean