private void HorizontalGradient() { for (int i = 1; i < ((float)_gradientSizeX * _gradientSizeY); i++) { if (_invertGradient) { gradientColours [i - 1] = Grad.Evaluate(1 - (1f / _gradientSizeY * Mathf.FloorToInt(i % _gradientSizeX))); } else { gradientColours [i] = Grad.Evaluate(1f / _gradientSizeY * Mathf.FloorToInt(i % _gradientSizeX)); } } }
/// <summary> Returns color for given vertex. </summary> protected Color GetColor(Vector3 point) { var value = (Noise.Perlin3D(point, 0.0f) + 1f) / 2f; return(Gradient.Evaluate(value)); }
protected Color GetColor(GradientWrapper gradient, float colorNoiseFreq, Vector3 point) { var value = (Noise.Perlin3D(point, colorNoiseFreq) + 1f) / 2f; return(gradient.Evaluate(value)); }
public static Color GetColor(GradientWrapper gradientWrapper, Vector3 point, float freq) { var value = Math.Abs(freq) > 0.0001 ? (Noise.Perlin3D(point, freq) + 1f) / 2f : 0.5f; return(gradientWrapper.Evaluate(value)); }