Let's say I have four floating point values that I want to send to the shader, of which the following is the best way to send them.
Sending them as separate floats:
uniform float uniformValue1;
uniform float uniformValue2;
uniform float uniformValue3;
uniform float uniformValue4;
void main()
{
}
Packing them in one vector:
uniform vec4 uniformValues;
void main()
{
}
I came across this document: https://www.khronos.org/webgl/public-mailing-list/archives/1003/pdf7z773meQcF.pdf
What talks about this subject is interesting to me: is OpenGL / OpenGLES / WebGL automatically wrapping uniforms, or is it something I should take care of myself?
source
share