title: How to avoid int->float conversion when passing data to pixel shader?
body: <p>I have a pixel shader:</p>
  
  <pre><code>varying vec2 f_texcoord;
  uniform vec4 mycolor_mult;
  uniform sampler2D mytexture;
  void main(void) {
      gl_FragColor = (texture2D(mytexture, f_texcoord) * mycolor_mult);
  };
  </code></pre>
  
  <p>and corresponding C++ code:</p>
  
  <pre><code>GLint m_attr = glGetUniformLocation(m_program, "mycolor_mult");
  // ...
  unsigned int myColor = ...; // 0xAARRGGBB format
  float a = (myColor &gt;&gt; 24) / 255.f;
  float r = ((myColor &gt;&gt; 16) &amp; 0xFF) / 255.f;
  float g = ((myColor &gt;&gt; 8) &amp; 0xFF) / 255.f;
  float b = (myColor &amp; 0xFF) / 255.f;
  glUniform4f(m_attr, r, g, b, a);
  </code></pre>
  
  <p>I keep sprite's color as <code>unsigned int</code> and have to convert it to 4 floats to pass them to the shader.</p>
  
  <p>Can it be optimized? I mean can I pass not floats, but unsigned chars as components to the shader and avoid "divide by 255" operations? What should I change in shader and in C++ code to do it?</p>