   Compiled GLSL files?
  Is there a way to compile out a GLSL script to a binary file and load it without needed to recompile the shader every time?   
  Support for this was just added in OpenGL 4.1, I have no idea what kind of video cards currently support this though. You can read a little bit about it in the spec, section 2.11. Functions ProgramBinary/GetProgramBinary/ShaderBinary.I don't see any command like GetShaderBinary, so I have no idea where the shader blobs are supposed to come from, but it looks like you can compile a program and then get the binary for offline storage.   ;Support for this was just added in OpenGL 4.1, I have no idea what kind of video cards currently support this though. You can read a little bit about it in the spec, section 2.11. Functions ProgramBinary/GetProgramBinary/ShaderBinary.I don't see any command like GetShaderBinary, so I have no idea where the shader blobs are supposed to come from, but it looks like you can compile a program and then get the binary for offline storage.Glad that 4.1 supports it for the future but that's not going to do me much good right now. I read that I could use CG to do it, is that right?   ;Support for this was just added in OpenGL 4.1, I have no idea what kind of video cards currently support this though. You can read a little bit about it in the spec, section 2.11. Functions ProgramBinary/GetProgramBinary/ShaderBinary.I don't see any command like GetShaderBinary, so I have no idea where the shader blobs are supposed to come from, but it looks like you can compile a program and then get the binary for offline storage.It's worth pointing out that this only allows the binary shader to be reloaded on the exact same graphics card it was compiled on (so you still have to do the compilation the first time you run your app on a particular machine). It's not the same as compiling an HLSL shader into portable byte code that can be loaded by all devices. There's huge thread on opengl.org arguing the merits of both approaches if you're interested in the background of this issue.;[quote name='karwosts' timestamp='1303498064' post='4801696']Support for this was just added in OpenGL 4.1, I have no idea what kind of video cards currently support this though. You can read a little bit about it in the spec, section 2.11. Functions ProgramBinary/GetProgramBinary/ShaderBinary.I don't see any command like GetShaderBinary, so I have no idea where the shader blobs are supposed to come from, but it looks like you can compile a program and then get the binary for offline storage.It's worth pointing out that this only allows the binary shader to be reloaded on the exact same graphics card it was compiled on (so you still have to do the compilation the first time you run your app on a particular machine). It's not the same as compiling an HLSL shader into portable byte code that can be loaded by all devices. There's huge thread on opengl.org arguing the merits of both approaches if you're interested in the background of this issue.[/quote]Well I guess I may as well start using [color="#1C2837"]4.1 and in a couple years I'll have polished out all of the bugs on my project. Hopefully 4.1 will be standard by then...   ;  I really don't get the point why someone would need some pre compiled shaders.Some mention speed concerns but I'm sure there are a lot of stuff u can do to work around these issues.   ;I really don't get the point why someone would need some pre compiled shaders.Some mention speed concerns but I'm sure there are a lot of stuff u can do to work around these issues.Well for one thing I actually need the shaders compiled into the exe file and without any binary format compiling a text string during runtime will increase the load time for my project to a point where it would be ridiculous.   ;I really don't get the point why someone would need some pre compiled shaders.Some mention speed concerns but I'm sure there are a lot of stuff u can do to work around these issues.Compiling complex shaders can take several seconds, in some case minutes. And, thanks to the way OpenGL is designed, it is not trivial to accelerate the build process using multiple processor cores either. This can dominate load times more than anything else. Binary shader programs offer compile-once-use-many programs that the application can cache.   ;  Well, we have to make some things clear:1. Binary shaders are supported by all SM4 cards (like NV 8xxx and newer), so they are already widely supported. OpenGL 4.1 introduced them into the core, but you don't need OpenGL 4.0+ hardware in order to use binary shaders.2. Binary shaders have to be recompiled each time graphics card or driver is changed; hence not only on the first start, but also after each graphics driver installation.3. You cannot compile shaders into exe files. You'll get compiled and linked shader programs that can be stored in binary file and later loaded and activated with glProgramBinary().4. Binary shaders can reduce load time and also can be useful in saving intellectual property. Although your code in binary shaders is not completely safe, it could not be read easily by every kid in the neighborhood. ;Well, we have to make some things clear:1. Binary shaders are supported by all SM4 cards (like NV 8xxx and newer), so they are already widely supported. OpenGL 4.1 introduced them into the core, but you don't need OpenGL 4.0+ hardware in order to use binary shaders.2. Binary shaders have to be recompiled each time graphics card or driver is changed; hence not only on the first start, but also after each graphics driver installation.3. You cannot compile shaders into exe files. You'll get compiled and linked shader programs that can be stored in binary file and later loaded and activated with glProgramBinary().4. Binary shaders can reduce load time and also can be useful in saving intellectual property. Although your code in binary shaders is not completely safe, it could not be read easily by every kid in the neighborhood. Thanks for that! It cleared up some stuff I was wondering!   