public void GetSourceModuleTest() { var source0 = new Constant(); var source1 = new Constant(); var control = new Constant(); var module = new Select() { Source0 = source0, Source1 = source1, Control = control }; Assert.Same(source0, module.Source0); Assert.Same(source1, module.Source1); Assert.Same(control, module.Control); Assert.Same(module.Source0, module.SourceModules[0]); Assert.Same(module.Source1, module.SourceModules[1]); Assert.Same(module.Control, module.SourceModules[2]); }
public static Module CreateNoiseTree() { var mountainTerrain = new RidgedMulti() { }; var baseFlatTerrain = new Billow() { Frequency = 2, }; var flatTerrain = new ScaleBias() { Source0 = baseFlatTerrain, Scale = 0.125, Bias = -0.75, }; var terrainType = new Perlin() { Frequency = 0.5, Persistence = 0.25, }; var terrainSelector = new Select() { Source0 = flatTerrain, Source1 = mountainTerrain, Control = terrainType, LowerBound = 0, UpperBound = 1000, EdgeFalloff = 0.125, }; var finalTerrain = new Turbulence() { Source0 = terrainSelector, Frequency = 4, Power = 0.125, }; return finalTerrain; }