Get old style OpenGL code work in GLSL
<p>I am trying to draw this pattern in OpenGL :</p>

<p><a href="https://i.stack.imgur.com/NXFTx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NXFTx.png" alt="enter image description here"></a></p>

<p>To get this, I created the pattern like : </p>

<pre><code>vector&lt; vector&lt;DataPoint&gt; &gt; datas;
float Intensitytemp=0;
float xPos=0, yPos=0, angleInRadians=0;
for (float theta = 0.0f; theta &lt; 4096; theta += 1.f)
{
    vector&lt;DataPoint&gt; temp;
    angleInRadians = 2 * M_PI*theta / 4096;
    for (float r = 0; r &lt; 4096; r += 1.f)
    {
        xPos = cos(angleInRadians)*r / 4096;
        yPos = sin(angleInRadians)*r / 4096;
        Intensitytemp = ((float)((int)r % 256)) / 255;
        DataPoint dt;
        dt.x = xPos;
        dt.y = yPos;
        dt.Int = Intensitytemp;
        temp.push_back(dt);
    }
    datas.push_back(temp);
}
</code></pre>

<p>and I am drawing the pattern as : </p>

<pre><code>glBegin(GL_POINTS);
    for (int x = 0; x &lt; 4096; x++)
        for (int y = 0; y &lt; 4096; y++)
        {
            xPos = datas[x][y].x;
            yPos = datas[x][y].y;
            Intensitytemp = datas[x][y].Int;
            glColor4f(0.0f, Intensitytemp, 0.0f, 1.0f);
            glVertex3f(xPos, yPos, 0.0f);
        }
glEnd();
</code></pre>

<p>If I create the data in <code>glBegin()-glEnd()</code> block,it is working faster. But in both cases,I believe that  a better way is doing all in GLSL.I didn't understand the logic behind the modern OpenGL well.</p>

<p>I tried to create vertex buffer array and color arrays but could not get it work. The problem was not about transferring the arrays to graphics card.I am getting stackoverflows in arrays. <em>This is question of another topic</em> but here what I wonder is it possible to do this task in completely GLSL code <em>( those in .vert file )</em> without transferring these huge array to graphics card.</p>