View Full Version : Looking for the complete SDK

03-10-2004, 05:13 AM
What exactly do I need to download to build an OpenGL program with all the recent extensions? As far as I can tell, there's about five dozen different versions scattered over the 'net, and half of these don't have the GL extensions, and most of those that do won't deal with shaders...
Then there's this business with having to query the OS for routine entry points at runtime. Can someone point me to an all-in-one download for this stuff which takes care of entry points?

* Is there an online reference for the OpenGL shader assembly language, or for that matter the shading language? I've found a 'spec', but that seems to be a Q&A for compiler writers.
* If I assemble a DirectX shader into a binary, can I load the resulting binary using OpenGL routines? DirectX provided a way of precompiling shaders to save recompiling them every time they're loaded (or, more likely, just to hide the source). I've got several shaders all prepared in DX9 assembly code, and I just need a way of either getting them into the GPU or translating them to the OGL equivalent code.
* If I use one of the aforementioned binaries, how does the parameter-passing system differ between OGL and DirectX? With DX9 you could set shader constants from buffers, so entire matrices could be loaded at once. OpenGL, as far as I can tell, defines constants received from the host program with PARAM.
* Can I send arbitrary data structures to the shader in the pipeline? DX9 didn't allow this with older shader types, but later ones could take up to 8 4-dimensional vectors, plus about 8 texture coordinates, per vertex. I don't quite need this capability... but how about a position and 3 normals?

03-10-2004, 07:23 AM
For an online reference try: http://www.clockworkcoders.com/oglsl/tutorials.html
it is a start.

There is also a book available titled OpenGL Shading Language, ISBN 0-321-19789-5
I have found it to be a huge help.

[This message has been edited by kingjosh (edited 03-10-2004).]

03-11-2004, 04:18 AM
I've now ordered the book on Amazon, and I'm eagerly awaiting its delivery!

It has now occurred to me why distributing shader binaries is a bad idea: the binary is different depending on the driver library used to compile it, eg. a Radeon 9700 driver would compile PS2.0 code as a hardware-executed shader, but a GF2MX driver would compile it to run in software because the GF2 hardware doesn't support shaders, right? If this is correct, everything suddenly becomes clear...

But I still need a complete OGL SDK from somewhere.

03-11-2004, 07:18 AM
There is no "OpenGL SDK" per se.
All you need to write OpenGL programs comes with the compiler and the OS (ok, for Windows NT based systems at least).
The current features of OpenGL are described in the specs which are mainly targeted at implementors and difficult to read.
A good start is the Programming Guide (RedBook).
For all sorts of OpenGL extensioin look at the official extensions page http://oss.sgi.com/projects/ogl-sample/registry/

For SDKs with lots of headers and samples ready for use look at ATI's and NVIDIA's developer sites.

That should give you about a year to read. http://www.opengl.org/discussion_boards/ubb/wink.gif

03-11-2004, 10:19 AM
You have a opengl2.0 sdk in the 3Dlabs site. It contains some example of shaders, a glut application with source code, a stand alone compiler with source and the man pages of the ogl2.0 related extension.
You have the Shader Designer too. It's a windows application thought to design GLSL shaders (at www.typhoonlabs.com (http://www.typhoonlabs.com) )

03-11-2004, 02:15 PM
You might find my GLee (http://elf-stone.com/downloads.php#GLee) library useful. It loads all the extensions supported by your hardware at runtime, as well as core functions up to OpenGL 1.5. Just call GLeeInit() after you have a rendering context. See the readme for details.

[This message has been edited by bunny (edited 03-11-2004).]