The engine uses merged batches (see id Software's stuff) so it's not really possible to assign extra per-material uniforms as the scene is being drawn, because the renderer draws all materials at once. The easiest way to do this is to pack the values into a shader and then use texelFetch() to read a value from the texture using precise integer coordinates. The other alternative would be a per-shader SetUniform method, which I already use in the renderer, but it would affect every surface that uses that shader, so I am not sure if that's very useful.