Example #1
0
        private void Update(EvaluationContext context)
        {
            var value   = Value.GetValue(context);
            var seed    = Seed.GetValue(context);
            var period  = Frequency.GetValue(context);
            var octaves = Octaves.GetValue(context);
            //var zoom = Zoom.GetValue(context);
            var rangeMin = RangeMin.GetValue(context);
            var rangeMax = RangeMax.GetValue(context);

            //var noiseSum = ComputePerlinNoise(value, period, octaves, seed);
            var noiseSum = MathUtils.PerlinNoise(value, period, octaves, seed);

            Result.Value = (noiseSum + 1f) * 0.5f * (rangeMax - rangeMin) + rangeMin;
        }
Example #2
0
        private void Update(EvaluationContext context)
        {
            var value    = Value.GetValue(context);
            var seed     = Seed.GetValue(context);
            var period   = Frequency.GetValue(context);
            var octaves  = Octaves.GetValue(context);
            var rangeMin = RangeMin.GetValue(context);
            var rangeMax = RangeMax.GetValue(context);
            var scale    = Scale.GetValue(context);
            var scaleXYZ = ScaleXYZ.GetValue(context);

            Result.Value = new Vector3(
                (MathUtils.PerlinNoise(value, period, octaves, seed) + 1f) * 0.5f * (rangeMax.X - rangeMin.X) + rangeMin.X,
                (MathUtils.PerlinNoise(value, period, octaves, seed + 123) + 1f) * 0.5f * (rangeMax.Y - rangeMin.Y) + rangeMin.Y,
                (MathUtils.PerlinNoise(value, period, octaves, seed + 234) + 1f) * 0.5f * (rangeMax.Z - rangeMin.Z) + rangeMin.Z) * scaleXYZ * scale;
        }
Example #3
0
        private void Update(EvaluationContext context)
        {
            var value = OverrideTime.IsConnected
                            ? OverrideTime.GetValue(context)
                            : (float)context.LocalFxTime;

            var seed    = Seed.GetValue(context);
            var period  = Frequency.GetValue(context);
            var octaves = Octaves.GetValue(context);
            //var zoom = Zoom.GetValue(context);
            var rangeMin = RangeMin.GetValue(context);
            var rangeMax = RangeMax.GetValue(context);
            var scale    = Scale.GetValue(context);

            //var noiseSum = ComputePerlinNoise(value, period, octaves, seed);
            var noiseSum = MathUtils.PerlinNoise(value, period, octaves, seed);
            var dist     = rangeMax - rangeMin;

            Result.Value = ((scale * noiseSum + 1f) * 0.5f * dist + rangeMin);
        }