title: Changing colors in a shader
body: <p>I have a Grey Scale Shader for the Shaders Mod for Minecraft. I have the final.fsh, and it works real nice with this resource pack:</p>
  
  <p><img src="https://i.imgur.com/hm0pu32.png" alt="">
  "Craftboy Grey"</p>
  
  <p>However, I'd like to modify the shader to show up in green, similar to the grey does.</p>
  
  <p><img src="https://i.imgur.com/uZYgQdR.jpg" alt="">
  "Craftboy Green"</p>
  
  <p>The reason I need the shader, is to modify all the colors the resource pack cannot, and also change other player's skins to the same scale, without them needing to manually do it.</p>
  
  <p>Here's the code for the shader:</p>
  
  <pre><code>// Grayscale shader by daxnitro.
  // Small edit by Edrem
  // It makes the green brighter =D
  
  uniform sampler2D sampler0;
  uniform sampler2D sampler1;
  uniform sampler2D sampler2;
  
  uniform float near;
  uniform float far;
  
  float getBrightness(vec4 color);
  float getDepth(vec2 coord);
  
  void applyEffect() {
          float brightness = getBrightness(gl_FragColor);
          gl_FragColor = vec4(brightness, brightness, brightness, gl_FragColor[3]);
  }
  
  void main() {
      vec4 baseColor = texture2D(sampler0, gl_TexCoord[0].st);
  
          gl_FragColor = baseColor;
  
          float depth = getDepth(gl_TexCoord[0].st);
  
          if (gl_FragColor[3] == 0.0) {
                  gl_FragColor = gl_Fog.color;
          }
  
          applyEffect(); 
  }
  
  float getBrightness(vec4 color) {
          return color[0] * 0.299f + color[1] * 0.587f + color[2] * 0.114f;
  }
  
  float getDepth(vec2 coord) {
          float depth = texture2D(sampler1, coord).x;
          float depth2 = texture2D(sampler2, coord).x;
          if (depth2 &lt; 1.0) {
                  depth = depth2;
          }
  
      depth = 2.0 * near * far / (far + near - (2.0 * depth - 1.0) * (far - near));
  
      return depth;
  }
  </code></pre>