Originally posted by efikkan
View Post
And there you gave me definite evidence that you don't know anything about what shader programs really is.
Shader programs are never recompiled based on "parameters", never!
Shaders have something we call "uniforms", which the developer has to connect to pointers on compile time, but the data can be updated at any time without any recompilation or reactivation of the shader program. E.g. if I have a matrix representing position and orientation for a object, I can update this between draw calls to draw the next one or the same one at a different location.
Shader programs are never recompiled based on "parameters", never!
Shaders have something we call "uniforms", which the developer has to connect to pointers on compile time, but the data can be updated at any time without any recompilation or reactivation of the shader program. E.g. if I have a matrix representing position and orientation for a object, I can update this between draw calls to draw the next one or the same one at a different location.
I'm not claiming the shader is recompiled just because new parameters are passed in.
I'm saying the engine dynamically creates a string to generate glsl, and it results in completely different shaders being created left and right. If they were smart about it, they would start using uniforms and have the shader handle it properly - instead they just generate new glsl code and compile a new shader.
If you have experience with Unreal Engine 3 and can better explain what that engine is doing, then by all means we're listening. But so far it seems that it's you who doesn't really understand what's actually happening in these games. And just to clarify - I'm specifically speaking about certain games, like Borderlands. Not how a proper OpenGL game "should" work.
Leave a comment: