Last week I decided that it was silly to keep using
vertexAttribPointer for both the vertex positions and their colours for the squares in my second and third lessons, and for the faces of the cube in the fourth. After all, each of the squares is all one colour, so it would make more sense to use
Thanks to a commenter called Ray, who I’ve also been talking to on the Khronos forums, I’ve learned that the change causes problems. Vladimir Vukićević came up with a plausible diagnosis: there seems to be a problem with certain ATI graphics cards that means that if you don’t specify all attributes per-vertex, your objects don’t get drawn.
This is a pain, and is likely to cause enough problems in the future that I figured it was worth backing out the changes. Then, while I was at it, I realised that the way I was drawing the cube in lesson 4 was actually pretty bad, and there’s a much more elegant way to do it, using element array buffers — so, rather than teach people bad habits, I figured it was worth retrospectively changing that, too…
So, when we get on to lesson 5 (which is code-complete and just needs a description) then don’t be surprised if the code I refer back to is a little different to how it was last week… If you want to re-visit lesson 4 to see the changes, here’s a link to the place where the changed stuff starts.
Sorry for any confusion.