Can anyone explain or point me in the right direction of a good explaination of the different functions used to set uniform values. In the cheat sheet here we get this:
void uniform[1234][fi](uint location, ...)
void uniform[1234][fi]v(uint location, Array value)
void uniformMatrix[234]fv(uint location, bool transpose, Array)
but i'd like to know what each of these is doing and what the f's and i's are for.
1234
= dimensionsf
= floati
= integerv
The final character, if present, is v, indicating that the command takes an array (a vector) of values rather than a series of individual argumentsFor a non array uniform the only difference between
v
andnon v
versions of the uniform functions is just how you provide the data to it:uniform1fv(loc,[3.14159])
vsuniform1f(loc,3.14159)
.uniform3fv(loc,[.5,1.,.5])
vsuniform3f(loc,.5,1.,.5)
but for an array uniform you can set the entire array using the
v
functionsin shader
in js
To do that with the non
v
functions you'd have to look up every location