uniform and nullPointerException

Started by Thomas., June 21, 2012, 12:17:35 PM

Previous topic - Next topic

Thomas.

app
exponents = new float[8];
shader
uniform highp float spotExp[8];

EgonOlsen

I see...as the docs state, float[] is only supported for 1-4 elements ATM. I can remove this limitation, but it won't happen until the weekend. As a workaround until then, you can enlarge the array to 9 elements and store the values in the components of 3 SimpleVectors...yes, that's cludgy...but it should work.

Thomas.

#17
Oh, this limitation has somehow escaped me... I'll wait for her removed (8 per-pixel spot lights are not important for me and for my phone :) ), and thanks for your help :)

EDIT: hmm, array length 1 working, but 2 not...

EgonOlsen

Maybe there's another problem with float-arrays...i'll look into it tomorrow.

EgonOlsen

At least i found the reason for the problem with float[] to set a float[] uniform in the shader...it's not meant for that purpose, albeit the docs somehow suggest that it might be. These setters are actually to fill a float, vec2, vec or vec4 with the float[]-array's data. To set an actual float[], another method will be needed. I'll add it tomorrow.

EgonOlsen

I've updated the jar and added a method called setFloatArrayUniform(...). Again, this is untested and i coded it while being forced to listen to children songs...so bear with me, if it's just an epic fail...

Thomas.

I believe it must have been sheer torture :) But everything seems to be fine ;)