Well, there are always ways to crack an application. You can’t do anything about that. I mean, i can encrypt my files, but if you want the shaders, glIntercept can give you the code. So, if you want to be safe, you would need to send encrypted shaders to the gfx-card. Urgh, bad thing!
And with precompiled shaders it would be the same thing.
And, well shaders are not so long or complex, usually you know, what a shader does, anyway, so you won’t be hiding real secrets there.
If you are talking about CRACKING, well then you would need to make sure that a program doesn’t REPLACE a shader. That means, you want to bind a lighting-shader, and the crack simply binds something different.
So, if you are concerned about security, forget it. There is no way, you can make this safe and any approach to implement anything security-related into OpenGL is a waste of time.
Therefore this whole discussion has quickly been reduced to the problem of speed.
And yes, compiling shaders does not take that long. But in coming titles more and more shaders will be used, so the impact of shader-compiling will get stronger. I use 3 different shaders in my app, but my code selects only relevant parts of the shader and therefore disables/removes unnecessary code. This way i already get around 20 different shaders, at the moment, that are actually in use. Although they all are built from only 3 different base-shaders. I don’t want to know, how many shaders the Unreal 3 Engine uses.
This is one (IMHO promising) idea how to solve this problem. It is all about improving speed at startup and therefore it is all about satisfying the end-user. Nothing more. It’s not a necessarity, it would be a nice feature.
Jan.