I suppose this will be one of those things that is "undefined", but I cannot find a specific answer from google.
Say in my vertex shader:
layout(location = 0) in vec3 vPosition; layout(location = 1) in vec3 vNormal; layout(location = 2) in vec4 vColour;
But there is nothing buffered for location 2 with glEnableVertexAttribArray () or glVertexAttribPointer (). Can I expect the meaning to be something special?
I assumed for vec4 that it would be along the lines {0,0,0,0}, {0,0,0,1} or {1,1,1,1}, but in mine it is {0,0,1 ,one}.
When I previously used glBindAttribLocation () to specify locations, it was by default {1,1,1,1} on 4 different machines using 3 different operating systems (ubuntu 12.04, windows 7 and ubuntu 10.04).
Can we assume that the value will be {0,0,1,1} on the machines? or is it just a coincidence?
attributes shader opengl vertex-buffer
kbirk
source share