added more efficient way to set shader uniforms