Descenterace
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?
Anyway...
* 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?
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?
Anyway...
* 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?