title: Custom Depth Shader from grayscale to RGBA
body: <p>What do i have to change in this vertexshader/fragmentshader from simple grayscale depth to RGBA encoded depth, especially to display ChromaDepth(tm)-color-scheme instead of grayscale?
  <a href="http://www.chromatek.com/pix/101color.jpg" rel="nofollow">http://www.chromatek.com/pix/101color.jpg</a></p>
  
  <pre><code>&lt;script id="vert" type="webgl/fragment-shader"&gt;
      uniform float near;
      uniform float far;
      varying vec3 color;
  
      void main() {
          gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
          float depth = 1.0 - ((gl_Position.z - near) / (far - near));
          color = vec3(depth);
      }  
  &lt;/script&gt;
  &lt;script id="frag" type="webgl/fragment-shader"&gt;
      varying vec3 color;
  
      void main() {
          gl_FragColor = vec4(color, 1.0);
      }
  &lt;/script&gt;
  </code></pre>