title: How to use unsigned short in an opengl shader?
body: <p>I'm trying to upload a texture with unsigned shorts in a shader but it's not working.</p>
  
  <p>I have tried the following:</p>
  
  <pre><code>glActiveTexture(GL_TEXTURE1);
  glBindTexture(GL_TEXTURE_2D, vbt[1]);
  glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 640, 480, 0, GL_RED, GL_UNSIGNED_SHORT, kinect_depth);
  glUniform1i(ptexture1, 1);
  GLenum ErrorCheckValue = glGetError();
  </code></pre>
  
  <p>I know I'm binding correctly the texture because I get some results by using</p>
  
  <pre><code>glActiveTexture(GL_TEXTURE1);
  glBindTexture(GL_TEXTURE_2D, vbt[1]);
  glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 640, 480, 0,
      GL_RG, GL_UNSIGNED_BYTE, kinect_depth);
  glUniform1i(ptexture1, 1);
  GLenum ErrorCheckValue = glGetError();
  </code></pre>
  
  <p>In particular, I get part of my values in the red channel. I would like to upload the texture as a unsigned byte or as a float. However I don't manage to get the glTexImage2D call correctly. Also, is it possible to something similar using a depth texture? I would like to do some operations on the depth information I get from a kinect and display it.</p>