title: GLSL stops rendering
body: <p>I want to write a signed distance interpretation. For that I am creating a voxelgrid 100*100*100 for example (the size will increase if it is working).
  Now my plans are to load a point cloud into a 1d texture:</p>
  
  <pre><code>glEnable(GL_TEXTURE_1D);
  glGenTextures(1, &amp;_texture);
  glBindTexture(GL_TEXTURE_1D, _texture);
  
  glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
  glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
  
  glTexImage1D(GL_TEXTURE_1D, 0, GL_RGBA, pc-&gt;pc.size(), 0, GL_RGBA, GL_FLOAT, &amp;pc-&gt;pc.front());
  
  glBindTexture(GL_TEXTURE_1D, 0);
  </code></pre>
  
  <p>'pc' is just a class which holds a vector of structure Point, which has only floats x,y,z,w.</p>
  
  <p>Than I want to render the hole 100x100x100 grid, so each voxel and iterate trough all points of that texture, calculate the distance to my current voxel and store that distance in a new texture (1000x1000). For the moment this texture I am creating holds only color valuables which stores the distance in the red and green component and blue is set to 1.0.
  So I can see the result on screen. </p>
  
  <p>My problem is now, that when I have about 500 000 points in my point cloud, It seems to stop rendering after a few voxels(less than 50 000). My guess is that if it takes to long, it stops and just trow out the buffer that it has. 
  I don't know if that can be the case but if it is, is there something I can do against it, or maybe something I can do to make this procedure better/faster.</p>
  
  <p>My second guess is, that there is something I don't consider with the 1D Texture. But is there a better way to pass in a high amount of data? Because I will surely need a few hundred thousand points data.</p>
  
  <p>I don't know if it helps if I show the full fragment shader, so I will only show some parts, which I think is important for that problem:</p>
  
  <p>Distance calculation and iteration through all points:</p>
  
  <pre><code>for(int i = 0; i &lt; points; ++i){
          vec4 texInfo = texture(textureImg, getTextCoord(i));
          vec4 pos = position;
          pos.z /= rows*rows;
          vec4 distVector = texInfo-pos;
          float dist = sqrt(distVector.x*distVector.x + distVector.y*distVector.y + distVector.z*distVector.z);
          if(dist &lt; minDist){
              minDist = dist;
          }
      }
  </code></pre>
  
  <p>Function getTexCoord:</p>
  
  <pre><code>float getTextCoord(float a)
  {
      return (a * 2.0f + 1.0f) / (2.0f * points);
  }
  </code></pre>
  
  <p>*Edit:</p>
  
  <pre><code>vec4 newPos = vec4(makeCoord(position.x+Col())-1,
                     makeCoord(position.y+Row())-1,
                     0,
                     1.0);
  
  float makeCoord(float a){
  return (a/rows)*2;
  }
  
  int Col(){
  float a = mod(position.z,rows);
  return int(a);
  }
  
  int Row()
  {
      float a = position.z/rows;
      return int(a);
  }
  </code></pre>