/// <summary> /// /// </summary> public void Create() { Remove(); //Data manager this.DataManager = new DataManager(this); this.DataManager.Create(128, 128, 20); //Geometry manager this.GeometryManager = new GeometryManager(this, _height, _radius, _alpha, _beta, _numberOfBlocks, _na, _nb, _nc); this.GeometryManager.Create(); using (MaterialPtr mat = (MaterialPtr)MaterialManager.Singleton.GetByName("SkyX_VolClouds")) { mat.GetTechnique(0).GetPass(0).GetVertexProgramParameters().SetNamedConstant("uRadius", _radius); } this.IsCreated = true; // Update MaterialPtr parameters this.SunColor = _sunColor; this.AmbientColor = _ambientColor; this.LightResponse = _lightResponse; this.AmbientFactors = _ambientFactors; // Set current wheater int nforced = (_numberOfForcedUpdates == -1) ? 2 : _numberOfForcedUpdates; SetWeather(_weather.x, _weather.y, nforced); }
/// <summary> /// /// </summary> /// <param name="sm"></param> /// <param name="c"></param> /// <param name="height"></param> /// <param name="radius"></param> public VClouds(SceneManager sm, Camera c, Vector2 height, float radius) { this.SceneManager = sm; this.Camera = c; this.IsCreated = false; this.Height = height; _alpha = new Radian(new Degree((float)12)); _beta = new Radian(new Degree((float)40)); this.Radius = radius; _numberOfBlocks = 12; _na = 10; _nb = 8; _nc = 6; this.WindDirection = new Degree((float)0); this.WindSpeed = 80f; _weather = new Vector2(1.0f, 1.0f); _numberOfForcedUpdates = -1; this.SunDirection = new Vector3(0, -1, 0); this.SunColor = new Vector3(1, 1, 1); this.AmbientColor = new Vector3(0.63f, 0.63f, 0.7f); this.LightResponse = new Vector4(0.25f, 0.2f, 1.0f, 0.1f); this.AmbientFactors = new Vector4(0.4f, 1.0f, 1.0f, 1.0f); this.GlobalOpacity = 1.0f; this.CloudFieldScale = 1.0f; this.NoiseScale = 4.2f; this.DataManager = null; this.GeometryManager = null; }
/// <summary> /// /// </summary> public void Remove() { if (!this.IsCreated) { return; } _dataManager = null; _geometryManager = null; this.IsCreated = false; }