title: How to normalize image coordinates for texture space in OpenGL?
body: <p>Say I have an image of size <strong>320x240</strong>. Now, sampling from an <code>sampler2D</code> with integer image coordinates <code>ux, uy</code> I must normalize for texture coordinates in range <strong>[0, size]</strong> (size may be width or height).</p>
  
  <p>Now, I wonder if I should normalize like this</p>
  
  <pre><code>texture(image, vec2(ux/320.0, uy/240.0))
  </code></pre>
  
  <p>or like this</p>
  
  <pre><code>texture(image, vec2(ux/319.0, uy/239.0))
  </code></pre>
  
  <p>Because <strong>ux = 0 ... 319</strong> and <strong>uy = 0 ... 239</strong>. The latter one will actually cover the whole range of <strong>[0, 1]</strong> correct? That means <strong>0</strong> corresponds to the e.g. left-most pixels and <strong>1</strong> corresponds to the right most pixels, right?</p>
  
  <p>Also I want to maintain filtering, so I would like to not use <code>texelFetch</code>.</p>
  
  <p>Can anyone tell something about this? Thanks.</p>