 uniform float fogEnd;
 uniform vec3 fogColor;
 
+uniform int blendingMode;
+
 vec3 saturate(vec3 value) {
   vec3 result = clamp(value, 0.0, 1.0);
   return result;


vec4 applyFog(vec4 color) {
  float fogFactor = (fogEnd - cameraDistance) / (fogEnd - fogStart);
  fogFactor = fogFactor * fogModifier;
  fogFactor = clamp(fogFactor, 0.0, 1.0);
  color.rgb = mix(fogColor.rgb, color.rgb, fogFactor);

  // Ensure alpha channel is gone once a sufficient distance into the fog is reached. Prevents
  // texture artifacts from overlaying alpha values.
  if (cameraDistance > fogEnd * 1.5) {
    color.a = 1.0;
  }

  return color;

    color = applyDiffuseLighting(color);
  }

  color = applyFog(color);

  return color;
}
