I have an array of polyline’s points (x, y). Each time I shoud process 3 neighbour points and generate 2 output points.
For example, something like this:
void someFunc(float x0, float y0, float x1, float y1, float x2, float y2, float *pXout1, float *pYout1, float *pXout2, float *pYout2)
{
*xout1 = x1 - 1;
*xout2 = x1 + 1;
*yout1 = MIN(y0, y2);
*yout2 = MAX(y0, y2);
}
So I have 2 problems which I should implement in my vertex shader:
1)How to input several neighbor points at once?
2)How to output several points at once?
Vertex shader has no ability to input neighbouring vertex data. If you really need this, then you can implement this through redundant vertex attributes by supplying neighbouring vertex data (the same way you would supply colour, normals, etc.).
Do you mean passing multiple vertex data to fragment shader? If so then the same rule applies as for question #1, only you should use redundant varyings.