I want to draw geometric primitives in Blenders Game Engine by using a GLSL Shader.
For example:
glBegin(GL_LINE_STRIP);
glVertex2f(-0.6,0.3);
glVertex2f(-0.3,0.2);
glVertex2f(-.65, 0.2);
glVertex2f(-0.4, 0.05);
glEnd();
How to wrap this into VertexShader = """ ...code... """ or does it even belong there at all since this shape has nothing to do with a scene-objects vertecies? And do I enable it in the Logic Editor to an object by using an always sensor that links to the script in order for it to work?
All I want to do is to draw a line, along some x and y coordinates (z is 0 in this case). Also it should be scalable enough to draw an entire array of values, but after hours of research i'd be happy to just get three points to work! A simple example would be appreciated a lot.
So its all about how to geht basic stuff like this displayed in BGE by using gpu based GLSL: http://www.informit.com/articles/article.aspx?p=328646&seqNum=6 or here on stackoverflow Is it possible to draw line thickness in a fragment shader?
PS. I could not find anything fitting for my Problem on http://en.wikibooks.org/wiki/GLSL_Programming
And Rasterizer.drawLine() from bge doesn't work for my purposes, since it behaves odd, disappears immediately and the points cant be accessed/edited/moved afterwards.