title: GLSL: How to get pixel x,y,z world position?
body: <p>I want to adjust the colors depending on which xyz position they are in the world.</p>
  
  <p>I tried this in my fragment shader:</p>
  
  <pre><code>varying vec4 verpos;
  
  void main(){
      vec4 c;
      c.x = verpos.x;
      c.y = verpos.y;
      c.z = verpos.z;
      c.w = 1.0;
  
      gl_FragColor = c;
  }
  </code></pre>
  
  <p>but it seems that the colors change depending on my camera angle/position, how do i make the coords independent from my camera position/angle?</p>
  
  <p>Heres my vertex shader:</p>
  
  <pre><code>varying vec4 verpos;
  
  void main(){
      gl_Position = ftransform();
      verpos = gl_ModelViewMatrix*gl_Vertex;
  }
  </code></pre>
  
  <p><strong>Edit2:</strong> changed title, so i want world coords, not screen coords!</p>
  
  <p><strong>Edit3:</strong> added my full code </p>