title: OpenGL ES 3.0. Floating point texture
body: <p>I have OpenGL ES 3.0 and I'm trying to create a texture:</p>
  
  <pre><code>case 1: glTexImage2D(GL_TEXTURE_2D, 0, GL_R16F, width, height, 0, GL_RED, GL_HALF_FLOAT, 0); break;
  case 2: glTexImage2D(GL_TEXTURE_2D, 0, GL_RG16F, width, height, 0, GL_RG, GL_HALF_FLOAT, 0); break;
  case 3: glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB16F, width, height, 0, GL_RGB, GL_HALF_FLOAT, 0); break;
  </code></pre>
  
  <p>(for this code glGetError() return 0)</p>
  
  <pre><code>glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, textureHandle, 0);
  </code></pre>
  
  <p>But when attaching to framebuffer the glCheckFramebufferStatus(GL_FRAMEBUFFER) return 36054.</p>
  
  <pre><code>Surface CreateSurface(GLsizei width, GLsizei height, int numComponents)
  {
   GLuint fboHandle;
   glGenFramebuffers(1, &amp;fboHandle);
   glBindFramebuffer(GL_FRAMEBUFFER, fboHandle);
  
   GLuint textureHandle;
   glGenTextures(1, &amp;textureHandle);
   glBindTexture(GL_TEXTURE_2D, textureHandle);
   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
  
   switch (numComponents) {
          case 1: glTexImage2D(GL_TEXTURE_2D, 0, GL_R16F, width, height, 0, GL_RED, GL_HALF_FLOAT, 0); break;
          case 2: glTexImage2D(GL_TEXTURE_2D, 0, GL_RG16F, width, height, 0, GL_RG, GL_HALF_FLOAT, 0); break;
          case 3: glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB16F, width, height, 0, GL_RGB, GL_HALF_FLOAT, 0); break;
          default: PezFatalError("Illegal slab format.");
      }
  
  
   PezCheckCondition(GL_NO_ERROR == glGetError(), "Unable to create normals texture");
  
   GLuint colorbuffer;
   glGenRenderbuffers(1, &amp;colorbuffer);
   glBindRenderbuffer(GL_RENDERBUFFER, colorbuffer);
   glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, textureHandle, 0);
   PezCheckCondition(GL_NO_ERROR == glGetError(), "Unable to attach color buffer");
  
   PezCheckCondition(GL_FRAMEBUFFER_COMPLETE == glCheckFramebufferStatus(GL_FRAMEBUFFER), "Unable to create FBO.");
   Surface surface = { fboHandle, textureHandle, numComponents };
  
   glClearColor(0, 0, 0, 0);
   glClear(GL_COLOR_BUFFER_BIT);
   glBindFramebuffer(GL_FRAMEBUFFER, 0);
  
   return surface;
  }
  </code></pre>
  
  <p>What am I doing wrong?</p>