title: Set and get data from FBO
body: <p>I am trying to do a 2D fluid simulation by OpenGL ES 2.0. After reading some books and searching on internet for while. I have some basic ideas, but I am not sure if it's correct. Maybe you can help me on it.</p>
  
  <p>Firstly, I read some book says we can use the Texture as a 2D array, we can get/set the data in fragment shader. Is this what the FBO doing? We can set and get the data by gl_FragData[n]? However, if we store a integer in a texture, how can we set/get data by float?</p>
  
  <p>Secondly, how can we get the right 2D index by gl_FragCoord? As we know, we use the (s,t) to represent the texture coord, but it between [0,1]. If I just want to draw a rectangle, which is (0,0) (0,1) (1,0) (1,0) and the texture is 512*512. How can we get the right 2d index in the fragment shader?</p>
  
  <p>After question is coming from shader Toy <a href="http://www.iquilezles.org/apps/shadertoy/" rel="nofollow">http://www.iquilezles.org/apps/shadertoy/</a></p>
  
  <pre><code>vec2 p = -1.0 + 2.0 * gl_FragCoord.xy / resolution.xy;
  </code></pre>
  
  <p>I don't quite understand what this line means. I know this is about the position, I think. However, I don't understand why. </p>
  
  <p>Sorry for my poor english.</p>