예제 #1
0
 protected CloudEffectConfigToken(CloudEffectConfigToken copyMe)
     : base(copyMe)
 {
     this.frequency = copyMe.frequency;
     this.persistance = copyMe.persistance;
     this.amplitude = copyMe.amplitude;
     this.cloudCoverage = copyMe.cloudCoverage;
     this.cloudDensity = copyMe.cloudDensity;
     this.octaves = copyMe.octaves;
     this.displayOption = copyMe.displayOption;
     this.r1 = copyMe.r1;
     this.r2 = copyMe.r2;
     this.r3 = copyMe.r3;
 }
예제 #2
0
        private double PerlinNoise2d(int x, int y, CloudEffectConfigToken configToken)
        {
            double total = 0.0;
            double frequency = configToken.Frequency;
            double persistence = configToken.Persistance;
            double octaves = configToken.Octaves;
            double amplitude = configToken.Amplitude;

            double cloudCoverage = configToken.CloudCoverage;
            double cloudDensity = configToken.CloudDensity;

            for (int lcv = 0; lcv < octaves; lcv++)
            {
                total = total + Smooth(x * frequency, y * frequency) * amplitude;
                frequency = frequency * 2;
                amplitude = amplitude * persistence;
            }

            total = (total + cloudCoverage) * cloudDensity;

            if (total < 0) total = 0.0;
            if (total > 1) total = 1.0;

            return total;
        }
 protected override void InitialInitToken()
 {
     theEffectToken = new CloudEffectConfigToken(0.015, 0.65, 8, 1.00, 0.0, 1.0, CloudEffect.REPLACE_SOURCE, 15731, 789221, 1376312589);
 }