title: How to sample native resolution texture in glsl fragment shader
body: <p>I am trying to use a 2d texture as a lookup table to index into a larger texture.  Then texture map the color value onto a quad.  The issue I am having is that the larger texture appears to be smaller then its native resolution, when I sample it.  For example, I have a large 4k x 4k texture.  The lookup texture samples a 1k x 1k region of the large texture.  It then texture maps the result to a quad that fills the viewport, which is also 1k wide x 1k high.  I expect to still see a 1:1 map between the textured quad and a 1k x 1k portion of the original 4k x 4k texture.  However, the textured quad is very aliased.  It appears as if though the 4k x 4k texture was reduced to a 1k x 1k texture, and my lookup map samples a 512 x 512 portion of that texture.  </p>
  
  <p>In another word, it appears as if though I am sampling from a texture that has been resized to fit the 1k x 1k viewport, and not the native 4k x 4k texture.  Is there an issue with the why I am approaching this problem? </p>
  
  <p>Here is my vertex shader:</p>
  
  <pre><code>uniform mat4 pvm;
  
  void main()
  {   
      gl_TexCoord[0] = gl_MultiTexCoord0;
      gl_Position = ftransform();
  }
  
  and fragment shader:
  
  uniform sampler2D image;  //The large texture
  uniform sampler2D map;    //The lookup texture
  
  void main()
  {
  
      vec4 pos = texture(map,(gl_TexCoord[0].st * vec2(-1.0, 1.0)));  //Flip the origin
  
      vec4 color = texelFetch(image,ivec2(pos.s*4096,pos.t*4096),0);  
      gl_FragColor = color;
  }
  </code></pre>