Example #1
0
        /// <inheritdoc />
        public double Noise(INoise2D sourceNoise, double x, double y)
        {
            INoiseDistorter2DContracts.Noise(sourceNoise);

            return(this.distorter.Noise(sourceNoise, x, y).ConvertRange(
                       this.sourceNoiseStart, this.sourceNoiseEnd, this.resultNoiseStart, this.resultNoiseEnd));
        }
        /// <inheritdoc />
        public double Noise(INoise2D sourceNoise, double x, double y)
        {
            INoiseDistorter2DContracts.Noise(sourceNoise);

            double result = 0;

            foreach (var distorter in this.distorters)
            {
                result += distorter.Noise(sourceNoise, x, y);
            }

            return(result);
        }
        /// <inheritdoc />
        public double Noise(INoise2D sourceNoise, double x, double y)
        {
            INoiseDistorter2DContracts.Noise(sourceNoise);

            double result = this.distorter.Noise(sourceNoise, x, y);

            int weight = 2;

            for (int octave = 2; octave <= this.numberOfOctaves; octave++)
            {
                result += this.distorter.Noise(sourceNoise, x * weight, y * weight) / weight;
                weight *= 2;
            }

            return(result);
        }
Example #4
0
        /// <inheritdoc />
        public double Noise(INoise2D sourceNoise, double x, double y)
        {
            INoiseDistorter2DContracts.Noise(sourceNoise);

            return(this.distorter.Noise(sourceNoise, x + this.xShift, y + this.yShift));
        }
Example #5
0
        /// <inheritdoc />
        public double Noise(INoise2D sourceNoise, double x, double y)
        {
            INoiseDistorter2DContracts.Noise(sourceNoise);

            return(this.distorter.Noise(sourceNoise, x, y) * this.amplitude);
        }
        /// <inheritdoc />
        public double Noise(INoise2D sourceNoise, double x, double y)
        {
            INoiseDistorter2DContracts.Noise(sourceNoise);

            return(this.distorter.Noise(sourceNoise, x * this.xFrequency, y * this.yFrequency));
        }
        /// <inheritdoc />
        public double Noise(INoise2D sourceNoise, double x, double y)
        {
            INoiseDistorter2DContracts.Noise(sourceNoise);

            return(sourceNoise.Noise(x, y));
        }
Example #8
0
        /// <inheritdoc />
        public double Noise(INoise2D sourceNoise, double x, double y)
        {
            INoiseDistorter2DContracts.Noise(sourceNoise);

            return(this.distorter.Noise(sourceNoise, x, y).Clamp(this.min, this.max));
        }