VASIMR
01-04-2012, 03:43 PM
Hi,
I am starting to learn GLSL, and have been working on a simple tutorial that involves drawing a triangle with different colored vertices. So far however, I have only been able to change the vertex color attribute with a VBO. Is there an alternative method of linking attributes (not just color) to vertices?
Additionally I have run into a strange problem with the VAO/VBO setup. If I place all of the calls in the draw function, the triangle draws. If I place all of the calls except for the glBindVertexArray and glDrawArrays in the init function, and then place those two commands in the draw function, the screen becomes blank... Also, the vaoHandle which is being called is "Global". Does anyone have any ideas what might cause this problem?
Thanks.
I am starting to learn GLSL, and have been working on a simple tutorial that involves drawing a triangle with different colored vertices. So far however, I have only been able to change the vertex color attribute with a VBO. Is there an alternative method of linking attributes (not just color) to vertices?
Additionally I have run into a strange problem with the VAO/VBO setup. If I place all of the calls in the draw function, the triangle draws. If I place all of the calls except for the glBindVertexArray and glDrawArrays in the init function, and then place those two commands in the draw function, the screen becomes blank... Also, the vaoHandle which is being called is "Global". Does anyone have any ideas what might cause this problem?
Thanks.