title: Android OpenGL ES Framebuffer objects - rendering depth-buffer to texture
body: <p>I am using an Android device running Froyo supporting OpenGL ES 1.1 and OpenGL ES 2.0</p>
  
  <p>I want to render the depth buffer to a texture. Having seen a number of examples for OpenGL, OpenGL ES on other platforms (including iPhone) I have tried a number of FBO configurations.</p>
  
  <p>I seem to be able to get an FBO set-up with a colour texture but every time I attach a depth texture it fails.</p>
  
  <p>My current code is based on <a href="http://www.fabiensanglard.net/shadowmapping/index.php">this example</a> but creating a colour texture as well instead of setting draw and read buffers to none.</p>
  
  <p>Is there a simple example of configuring an OpenGL ES FBO on Android to render depth to a texture? Alternatively is there a document describing what is and is not supported?</p>
  
  <hr>
  
  <p>Thanks for the comments - I specifically needed a solution for ES 1.1, if it could be found and work on Android. I also want to look at ES 2 - I am not sure I understand the idea of packing the depth information into colour buffer - do you have a reference I can look at to understand the idea better? </p>
  
  <p>Regarding code - my source is barely different from the link I posted above. The Framebuffer status is that it is not complete.</p>
  
  <hr>
  
  <p>Thanks for the fragment shader suggestion - I get the idea now. Will look at that if I can't get another solution working. My ideal is to get depth and colour at the same time - don't really want to render colour and depth separately if I can help it.</p>