Setting uniform on GLSLShaderObjectState without refresh

Hi!



I have the exact same GLSL-shader attached to a lot of meshes, which helps performance quite a bit, but have the need to set different uniforms to them (in this case uniform matrixes). I have not found a way to set the uniform value of a GLSLShaderObjectState without forcing a refresh of the entire shaderstate. Am I mistaken?



My current attempt at a "hack" is to write a custom RenderState (which borrows its ID from one of the higher numbered RenderStates that I do not use) which manually sets the shader's uniform value directly with LWJGL. To do this, I need the ID of the GLSL-shader. Unfortunately, the ID is not publically accessible. If there is no better way than the one I have described, could any of the devs add the following methods or something similar?



GLSLShaderObjectsState:

public abstract int getProgramID();



LWJGLShaderObjectsState:

public int getProgramID() {

  return programID;

}



Thanks!