In shader code I have a float array:
float _X[250];
Doing this in a script then works fine:
material.SetFloatArray("_X", x);
However, for each update I only want to change a single value of the array.
I tried doing this:
material.SetFloat("_X[" + i.ToString() + "]", x[i]);
but that naturally didn't work.
Is there any work around? It seems silly to have to transfer a full array every frame if only one value changes, but I can't see any other way at the moment.
Thank you.
↧