<<< GLSL elements of vectors and matrices | Index | matrix component selection >>> |
Vector operations are supported by GPU hardware directly
This is slower:
vPos.x = vPos2.x + 1.0f; vPos.y = vPos2.y + 3.0f; vPos.z = vPos2.z + 2.0f;
This is faster:
vPos.xyz = vPos2.xyz + vec3( 1.0f, 3.0f, 2.0f );
<<< GLSL elements of vectors and matrices | Index | matrix component selection >>> |