LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: Orangy Tang on September 24, 2005, 21:33:31

Title: GLSL + uniform arrays
Post by: Orangy Tang on September 24, 2005, 21:33:31
I'm not quite sure what I'm doing wrong here, but I suspect I'm making a silly buffer error. I've got a uniform float weights[numWeights] array in a GLSL fragment shader. I can successfully get the location, type and length in my Java code and all is good.

However I can't seem to update them properly - I'm doing:
buffer.rewind();
buffer.put(dataArray);
buffer.flip();

ARBShaderObjects.glUniform1ARB(location, buffer);

Where dataArray is a float[] and buffer is a FloatBuffer. In my fragment shader I can get correct values out of my uniform array for indices 1 to numWeights-1, but weights[0] is always 0. :shock:

Is there something special about
Title: GLSL + uniform arrays
Post by: spasi on September 25, 2005, 11:37:28
No, there's nothing special about