@Override
	public ColorRGB shade(Raytracer tracer, HitInfo hit) {
		ColorRGB totalColor = ColorRGB.BLACK;
		
		for (Light light: hit.getWorld().getLights()) {
			Vector3 lightPos = light.Sample();
			Vector3 inDirection = lightPos.minus(hit.getHitPoint()).normalized();
			double diffuseFactor = inDirection.dot(hit.getNormal());
			if (diffuseFactor < 0) { continue; }
			if (hit.getWorld().anyObstacleBetween(hit.getHitPoint(), lightPos)) { continue; }
			
			ColorRGB result = light.getColor().mult(materialColor).mult(diffuseFactor).mult(diffuseCoeff);
			double phongFactor = phongFactor(inDirection, hit.getNormal(), hit.getRay().getDirection().reverse());
			if (phongFactor != 0) { 
				result = result.plus(materialColor.mult(specular).mult(phongFactor)); 
			}
			totalColor = totalColor.plus(result);
		}
		
		return totalColor;
	}