Hi all,
I'm struggling to find the cause for an issue where my uniforms seem to be changing value in the middle of a glDrawArrays call. The attached program should display alternating blue/green columns of triangles, where each triangle's color is passed to the shader as a uniform. Apologies for the messy code, but it's a (minimal) cut-down example from a larger app. I'm using the latest stable LWJGL 3 release.
It all works fine if I loop through my VAOs and render them individually. However, if I create a (temporary) VAO & populate a VBO during rendering, the colors become random - even down to individual fragments within a triangle (see screenshots). I'm a relative newbie to OpenGL, so would appreciate any advice on what I'm doing wrong.
Thanks.