If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Multiple lines with more than one color

I'm able to get several thousand lines on the the screen and I am happy with that. The problem is I can't figure how how to make each line a different color.

I guess you have to tell the vertex shader and fragment shader to have color attributes for each vertex, but I don't know how to make that change reflect in the drawing code, and it seems like then the glUniform4fv() would then not be used?

...
private final String vertexShaderCode =
// This matrix member variable provides a hook to manipulate
// the coordinates of the objects that use this vertex shader
"uniform mat4 uMVPMatrix;" +
"attribute vec4 vPosition;" +
"void main() {" +
// The matrix must be included as a modifier of gl_Position.
// Note that the uMVPMatrix factor *must be first* in order
// for the matrix multiplication product to be correct.
" gl_Position = uMVPMatrix * vPosition;" +
"}";