title: Render into a 3D Texture
body: <p>I want to render a set of points into a 3D texture. But somehow I don't write in it. With glGetTexImage() I only get 0 for every entry. I am storing the 3D Texture in a Framebuffer and with a different render pass I want to read out informations out of the 3Dtexture stored in the frame buffer.</p>
  
  <pre><code>Initialization of the FrameBuffer.
  glGenFramebuffers(1, &amp;_fbo);
  glBindFramebuffer(GL_FRAMEBUFFER, _fbo);
  
  
  glGenTextures(1, &amp;texture);
  glBindTexture(GL_TEXTURE_3D, texture);
  
  glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
  glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
  
  glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
  glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
  glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE);
  
  glTexImage3D(GL_TEXTURE_3D, 0, GL_RGBA, GRID_SIZE, GRID_SIZE, GRID_SIZE, 0, GL_RGBA, GL_FLOAT, NULL);
  
  glFramebufferTexture3D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_3D, texture, 0, 0);
  
  if (glCheckFramebufferStatus(GL_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE) {
      std::cout &lt;&lt; "FBO successfully loadet" &lt;&lt; std::endl;
  }else{
      std::cout &lt;&lt; "FBO had en ERROR" &lt;&lt; std::endl;
  }
  </code></pre>
  
  <p><strong>Vertex shader:</strong></p>
  
  <pre><code>#version 330 core
  
  layout (location = 0) in vec3 position;
  
  void main(){
  
      gl_PointSize = 1.0;
  
      gl_Position = vec4(position,1.0);
  
  }
  </code></pre>
  
  <p><strong>Fragment Shader:</strong></p>
  
  <pre><code>#version 330 core
  
  out vec4 fragColor;
  
  void main(){
  
      fragColor = vec4(1.0,1.0,1.0, 1.0);
  
  }
  </code></pre>
  
  <p>Before that I tried it with a normal render pass and storing these points separately in a 3D texture. That seemed to work. But now with the frame buffer it writes only 0's.</p>