Jump to content
  • Advertisement
Sign in to follow this  
vince35

using precompiled shaders

This topic is 3172 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I'm wondering if there's a way to save a compiled or linked shader. The idea is to avoid having people messing with the shaders source code, and possibly improve the shader creation time as well. In other words, is there a way to get my application to use a shader without calling glShaderSource at any time? Thanks for the suggestions.

Share this post


Link to post
Share on other sites
Advertisement
As far as I know, the only way not to load GLSL source code is to use the old ASM (assembly) shaders ARBvp1.0 and ARBfp1.0 (ARB_vertex_program, ARB_fragment_program) or vendor specific new ASM shader extensions. But of course people can mess with ASM shaders as well.

Share this post


Link to post
Share on other sites
that and its not going to be very compatible... btw. protecting your shader code is mostly a waiste of time. For example you can go copy all the shaders out of the Unreal engine in plane text format! with comments!. If they dont feel it nessesary to protect their shader code i dont think you should waiste your time with it either.

Share this post


Link to post
Share on other sites
You can't...

You could of course hard code the shaders source in your executable instead of loading them from a text file. But that wouldn't make your shaders very easily changeable while developing your program. And you still have to call glShaderSource, compile your shaders and link your glsl programs.

People on the OpenGL forums are asking storing shader binaries for a long time already. Who knows it will be part of the next iteration of OpenGL...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!