WebGLSamples / WebGL2Samples

Short and easy to understand samples demonstrating WebGL 2 features
Other
1.02k stars 143 forks source link

[qu] draw_instanced.html question #141

Closed quantuminformation closed 7 years ago

quantuminformation commented 7 years ago

Thanks, I'm trying to understand why do you need to call

    `gl.bindVertexArray(vertexArray);`

twice? I see that if you don't do the initial call you get a black screen.

shrekshao commented 7 years ago

Hi Nikos, Cuz we do a

gl.bindVertexArray(null);

at https://github.com/WebGLSamples/WebGL2Samples/blob/master/samples/draw_instanced.html#L90, indicating we finish defining a vertex array.

You can comment this line and the second gl.bindVertexArray(vertexArray); together to get the sample still working

quantuminformation commented 7 years ago

Thanks for this!