I'm reading through learningwebgl.com and what confuses me is that it draws the first buffer I bound as last element?
red triangle
green square
blue square
I expected to see only the blue square because everything else gets overdrawn, the output seems to be in reverse order?
I've also read about stencil buffers, so what I tried to do is create a mask (red) and then there should be a green triangle on the blue square.
the mask works ( http://jsfiddle.net/D3QNg/3/ ) but I don't know if it's right or if I'm just lucky.
Would appreciate some help.