title: OpenGL program port to Android OpenGL ES2.0
body: <p>I have a OpenGL program on desktop, now I am going to port to Android.</p>
  
  <p>I used one API on desktop version is:</p>
  
  <pre><code>// Allocate graphics memory.
  glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32F, w, h, 0, GL_RGBA,
              GL_FLOAT, NULL);
  </code></pre>
  
  <p>but in OpenGL ES2.0, I can only use the API like this:</p>
  
  <pre><code>// Allocate graphics memory.
  glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, w, h, 0, GL_RGB,
              GL_UNSIGNED_BYTE, NULL);
  </code></pre>
  
  <p>So the internal format changed from GL_RGBA32F to GL_RGB, and type from GL_FLOAT to GL_UNSIGNED_BYTE, and in my shaders, I calculate the fragment colour in float values, I can see the result image got some problem, e.g, the white color pixels become green color.</p>
  
  <p>I want to know is this problem because of the glTextImage2D in OpenGL ES2.0 not supporting float type?</p>