Beispiel #1
0
        public void FromLightShare(RegionLightShareData ls)
        {
            WaterData water = new WaterData();

            water.waterFogColor   = ls.waterColor / 256f;
            water.waterFogDensity = (float)Math.Pow(2.0f, ls.waterFogDensityExponent);
            //water.waterFogDensity = ls.waterFogDensityExponent;
            water.underWaterFogMod = ls.underwaterFogModifier;
            water.normScale        = ls.reflectionWaveletScale;
            water.fresnelScale     = ls.fresnelScale;
            water.fresnelOffset    = ls.fresnelOffset;
            water.scaleAbove       = ls.refractScaleAbove;
            water.scaleBelow       = ls.refractScaleBelow;
            water.blurMultiplier   = ls.blurMultiplier;
            water.wave1Dir         = ls.littleWaveDirection;
            water.wave2Dir         = ls.bigWaveDirection;
            water.normalMap        = ls.normalMapTexture;
            water.Name             = "LightshareWater";

            SkyData sky = new SkyData();

            convertFromAngles(sky, 2.0f * (float)Math.PI * ls.sunMoonPosition, 2.0f * (float)Math.PI * ls.eastAngle);
            sky.sunlight_color      = ls.sunMoonColor * 3.0f;
            sky.ambient             = new Vector3(ls.ambient.X * 3.0f, ls.ambient.Y * 3.0f, ls.ambient.Z * 3.0f);
            sky.blue_horizon        = new Vector3(ls.horizon.X * 2.0f, ls.horizon.Y * 2.0f, ls.horizon.Z * 2.0f);
            sky.blue_density        = new Vector3(ls.blueDensity.X * 2.0f, ls.blueDensity.Y * 2.0f, ls.blueDensity.Z * 2.0f);;
            sky.haze_horizon        = ls.hazeHorizon;
            sky.haze_density        = ls.hazeDensity;
            sky.cloud_shadow        = ls.cloudCoverage;
            sky.density_multiplier  = ls.densityMultiplier / 1000.0f;
            sky.distance_multiplier = ls.distanceMultiplier;
            sky.max_y              = ls.maxAltitude;
            sky.cloud_color        = new Vector3(ls.cloudColor.X, ls.cloudColor.Y, ls.cloudColor.Z);
            sky.cloud_pos_density1 = ls.cloudXYDensity;
            sky.cloud_pos_density2 = ls.cloudDetailXYDensity;
            sky.cloud_scale        = ls.cloudScale;
            sky.gamma              = ls.sceneGamma;
            sky.glow = new Vector3((2f - ls.sunGlowSize) * 20f, 0f, -ls.sunGlowFocus * 5f);
            sky.cloud_scroll_rate = new Vector2(ls.cloudScrollX, ls.cloudScrollY);
            if (ls.cloudScrollXLock)
            {
                sky.cloud_scroll_rate.X = 0;
            }
            if (ls.cloudScrollYLock)
            {
                sky.cloud_scroll_rate.Y = 0;
            }
            sky.star_brightness = ls.starBrightness * 250f;
            sky.Name            = "LightshareSky";

            Cycle      = new DayCycle();
            Cycle.Name = "Lightshare";
            Cycle.waterframes.Add(water.Name, water);
            DayCycle.TrackEntry track = new DayCycle.TrackEntry(-1, water.Name);
            Cycle.waterTrack.Add(track);

            Cycle.skyframes.Add(sky.Name, sky);
            track = new DayCycle.TrackEntry(-1, sky.Name);
            Cycle.skyTrack0.Add(track);
        }
        public void SendProfileToClient(IClientAPI client, RegionLightShareData wl)
        {
            if (client == null)
                return;

            if (m_enableWindlight)
            {
                if (m_scene.RegionInfo.WindlightSettings.valid)
                {
                    List<byte[]> param = compileWindlightSettings(wl);
                    client.SendGenericMessage("Windlight", UUID.Random(), param);
                }
                else
                {
                    List<byte[]> param = new List<byte[]>();
                    client.SendGenericMessage("WindlightReset", UUID.Random(), param);
                }
            }
        }
        private List<byte[]> compileWindlightSettings(RegionLightShareData wl)
        {
            byte[] mBlock = new Byte[249];
            int pos = 0;

            wl.waterColor.ToBytes(mBlock, 0); pos += 12;
            Utils.FloatToBytes(wl.waterFogDensityExponent).CopyTo(mBlock, pos); pos += 4;
            Utils.FloatToBytes(wl.underwaterFogModifier).CopyTo(mBlock, pos); pos += 4;
            wl.reflectionWaveletScale.ToBytes(mBlock, pos); pos += 12;
            Utils.FloatToBytes(wl.fresnelScale).CopyTo(mBlock, pos); pos += 4;
            Utils.FloatToBytes(wl.fresnelOffset).CopyTo(mBlock, pos); pos += 4;
            Utils.FloatToBytes(wl.refractScaleAbove).CopyTo(mBlock, pos); pos += 4;
            Utils.FloatToBytes(wl.refractScaleBelow).CopyTo(mBlock, pos); pos += 4;
            Utils.FloatToBytes(wl.blurMultiplier).CopyTo(mBlock, pos); pos += 4;
            wl.bigWaveDirection.ToBytes(mBlock, pos); pos += 8;
            wl.littleWaveDirection.ToBytes(mBlock, pos); pos += 8;
            wl.normalMapTexture.ToBytes(mBlock, pos); pos += 16;
            wl.horizon.ToBytes(mBlock, pos); pos += 16;
            Utils.FloatToBytes(wl.hazeHorizon).CopyTo(mBlock, pos); pos += 4;
            wl.blueDensity.ToBytes(mBlock, pos); pos += 16;
            Utils.FloatToBytes(wl.hazeDensity).CopyTo(mBlock, pos); pos += 4;
            Utils.FloatToBytes(wl.densityMultiplier).CopyTo(mBlock, pos); pos += 4;
            Utils.FloatToBytes(wl.distanceMultiplier).CopyTo(mBlock, pos); pos += 4;
            wl.sunMoonColor.ToBytes(mBlock, pos); pos += 16;
            Utils.FloatToBytes(wl.sunMoonPosition).CopyTo(mBlock, pos); pos += 4;
            wl.ambient.ToBytes(mBlock, pos); pos += 16;
            Utils.FloatToBytes(wl.eastAngle).CopyTo(mBlock, pos); pos += 4;
            Utils.FloatToBytes(wl.sunGlowFocus).CopyTo(mBlock, pos); pos += 4;
            Utils.FloatToBytes(wl.sunGlowSize).CopyTo(mBlock, pos); pos += 4;
            Utils.FloatToBytes(wl.sceneGamma).CopyTo(mBlock, pos); pos += 4;
            Utils.FloatToBytes(wl.starBrightness).CopyTo(mBlock, pos); pos += 4;
            wl.cloudColor.ToBytes(mBlock, pos); pos += 16;
            wl.cloudXYDensity.ToBytes(mBlock, pos); pos += 12;
            Utils.FloatToBytes(wl.cloudCoverage).CopyTo(mBlock, pos); pos += 4;
            Utils.FloatToBytes(wl.cloudScale).CopyTo(mBlock, pos); pos += 4;
            wl.cloudDetailXYDensity.ToBytes(mBlock, pos); pos += 12;
            Utils.FloatToBytes(wl.cloudScrollX).CopyTo(mBlock, pos); pos += 4;
            Utils.FloatToBytes(wl.cloudScrollY).CopyTo(mBlock, pos); pos += 4;
            Utils.UInt16ToBytes(wl.maxAltitude).CopyTo(mBlock, pos); pos += 2;
            mBlock[pos] = Convert.ToByte(wl.cloudScrollXLock); pos++;
            mBlock[pos] = Convert.ToByte(wl.cloudScrollYLock); pos++;
            mBlock[pos] = Convert.ToByte(wl.drawClassicClouds); pos++;
            List<byte[]> param = new List<byte[]>();
            param.Add(mBlock);
            return param;
        }
 private void EventManager_OnSendNewWindlightProfileTargeted(RegionLightShareData wl, UUID pUUID)
 {
     ScenePresence Sc;
     if (m_scene.TryGetScenePresence(pUUID,out Sc))
     {
         SendProfileToClient(Sc,wl);
     }
 }
 public void SendProfileToClient(IClientAPI client, RegionLightShareData wl)
 {
     if (m_enableWindlight && m_scene.RegionInfo.WindlightSettings.valid)
     {
         List<byte[]> param = compileWindlightSettings(wl);
         client.SendGenericMessage("Windlight", param);
     }
 }
Beispiel #6
0
 public void StoreWindlightProfile(RegionLightShareData wl)
 {
     RegionInfo.WindlightSettings = wl;
     SimulationDataService.StoreRegionWindlightSettings(wl);
     m_eventManager.TriggerOnSaveNewWindlightProfile();
 }
 public void StoreRegionWindlightSettings(RegionLightShareData wl)
 {
     //This connector doesn't support the windlight module yet
 }
        /// <summary>
        /// Load windlight settings from region storage
        /// </summary>
        /// <param name="regionUUID">RegionID</param>
        public RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID)
        {
            RegionLightShareData wl = null;

            lock (ds)
            {
                DataTable windlightTable = ds.Tables["regionwindlight"];
                DataRow windlightRow = windlightTable.Rows.Find(regionUUID.ToString());
                if (windlightRow == null)
                {
                    wl = new RegionLightShareData();
                    wl.regionID = regionUUID;
                    StoreRegionWindlightSettings(wl);
                    return wl;
                }
                wl = buildRegionWindlight(windlightRow);
                return wl;
            }
        }
 /// <summary>
 ///
 /// </summary>
 /// <param name="row"></param>
 /// <param name="windlight"></param>
 private static void fillRegionWindlightRow(DataRow row, RegionLightShareData windlight)
 {
     row["region_id"] = windlight.regionID.ToString();
     row["water_color_r"] = windlight.waterColor.X;
     row["water_color_g"] = windlight.waterColor.Y;
     row["water_color_b"] = windlight.waterColor.Z;
     row["water_color_i"] = 1; //windlight.waterColor.W;  //not implemented
     row["water_fog_density_exponent"] = windlight.waterFogDensityExponent;
     row["underwater_fog_modifier"] = windlight.underwaterFogModifier;
     row["reflection_wavelet_scale_1"] = windlight.reflectionWaveletScale.X;
     row["reflection_wavelet_scale_2"] = windlight.reflectionWaveletScale.Y;
     row["reflection_wavelet_scale_3"] = windlight.reflectionWaveletScale.Z;
     row["fresnel_scale"] = windlight.fresnelScale;
     row["fresnel_offset"] = windlight.fresnelOffset;
     row["refract_scale_above"] = windlight.refractScaleAbove;
     row["refract_scale_below"] = windlight.refractScaleBelow;
     row["blur_multiplier"] = windlight.blurMultiplier;
     row["big_wave_direction_x"] = windlight.bigWaveDirection.X;
     row["big_wave_direction_y"] = windlight.bigWaveDirection.Y;
     row["little_wave_direction_x"] = windlight.littleWaveDirection.X;
     row["little_wave_direction_y"] = windlight.littleWaveDirection.Y;
     row["normal_map_texture"] = windlight.normalMapTexture.ToString();
     row["horizon_r"] = windlight.horizon.X;
     row["horizon_g"] = windlight.horizon.Y;
     row["horizon_b"] = windlight.horizon.Z;
     row["horizon_i"] = windlight.horizon.W;
     row["haze_horizon"] = windlight.hazeHorizon;
     row["blue_density_r"] = windlight.blueDensity.X;
     row["blue_density_g"] = windlight.blueDensity.Y;
     row["blue_density_b"] = windlight.blueDensity.Z;
     row["blue_density_i"] = windlight.blueDensity.W;
     row["haze_density"] = windlight.hazeDensity;
     row["density_multiplier"] = windlight.densityMultiplier;
     row["distance_multiplier"] = windlight.distanceMultiplier;
     row["max_altitude"] = windlight.maxAltitude;
     row["sun_moon_color_r"] = windlight.sunMoonColor.X;
     row["sun_moon_color_g"] = windlight.sunMoonColor.Y;
     row["sun_moon_color_b"] = windlight.sunMoonColor.Z;
     row["sun_moon_color_i"] = windlight.sunMoonColor.W;
     row["sun_moon_position"] = windlight.sunMoonPosition;
     row["ambient_r"] = windlight.ambient.X;
     row["ambient_g"] = windlight.ambient.Y;
     row["ambient_b"] = windlight.ambient.Z;
     row["ambient_i"] = windlight.ambient.W;
     row["east_angle"] = windlight.eastAngle;
     row["sun_glow_focus"] = windlight.sunGlowFocus;
     row["sun_glow_size"] = windlight.sunGlowSize;
     row["scene_gamma"] = windlight.sceneGamma;
     row["star_brightness"] = windlight.starBrightness;
     row["cloud_color_r"] = windlight.cloudColor.X;
     row["cloud_color_g"] = windlight.cloudColor.Y;
     row["cloud_color_b"] = windlight.cloudColor.Z;
     row["cloud_color_i"] = windlight.cloudColor.W;
     row["cloud_x"] = windlight.cloudXYDensity.X;
     row["cloud_y"] = windlight.cloudXYDensity.Y;
     row["cloud_density"] = windlight.cloudXYDensity.Z;
     row["cloud_coverage"] = windlight.cloudCoverage;
     row["cloud_scale"] = windlight.cloudScale;
     row["cloud_detail_x"] = windlight.cloudDetailXYDensity.X;
     row["cloud_detail_y"] = windlight.cloudDetailXYDensity.Y;
     row["cloud_detail_density"] = windlight.cloudDetailXYDensity.Z;
     row["cloud_scroll_x"] = windlight.cloudScrollX;
     row["cloud_scroll_x_lock"] = windlight.cloudScrollXLock;
     row["cloud_scroll_y"] = windlight.cloudScrollY;
     row["cloud_scroll_y_lock"] = windlight.cloudScrollYLock;
     row["draw_classic_clouds"] = windlight.drawClassicClouds;
 }
        /// <summary>
        /// Build a windlight entry from the persisted data.
        /// </summary>
        /// <param name="row"></param>
        /// <returns>RegionLightShareData</returns>
        private RegionLightShareData buildRegionWindlight(DataRow row)
        {
            RegionLightShareData windlight = new RegionLightShareData();

            windlight.regionID = new UUID((string)row["region_id"]);
            windlight.waterColor.X = Convert.ToSingle(row["water_color_r"]);
            windlight.waterColor.Y = Convert.ToSingle(row["water_color_g"]);
            windlight.waterColor.Z = Convert.ToSingle(row["water_color_b"]);
            //windlight.waterColor.W = Convert.ToSingle(row["water_color_i"]); //not implemented
            windlight.waterFogDensityExponent = Convert.ToSingle(row["water_fog_density_exponent"]);
            windlight.underwaterFogModifier = Convert.ToSingle(row["underwater_fog_modifier"]);
            windlight.reflectionWaveletScale.X = Convert.ToSingle(row["reflection_wavelet_scale_1"]);
            windlight.reflectionWaveletScale.Y = Convert.ToSingle(row["reflection_wavelet_scale_2"]);
            windlight.reflectionWaveletScale.Z = Convert.ToSingle(row["reflection_wavelet_scale_3"]);
            windlight.fresnelScale = Convert.ToSingle(row["fresnel_scale"]);
            windlight.fresnelOffset = Convert.ToSingle(row["fresnel_offset"]);
            windlight.refractScaleAbove = Convert.ToSingle(row["refract_scale_above"]);
            windlight.refractScaleBelow = Convert.ToSingle(row["refract_scale_below"]);
            windlight.blurMultiplier = Convert.ToSingle(row["blur_multiplier"]);
            windlight.bigWaveDirection.X = Convert.ToSingle(row["big_wave_direction_x"]);
            windlight.bigWaveDirection.Y = Convert.ToSingle(row["big_wave_direction_y"]);
            windlight.littleWaveDirection.X = Convert.ToSingle(row["little_wave_direction_x"]);
            windlight.littleWaveDirection.Y = Convert.ToSingle(row["little_wave_direction_y"]);
            windlight.normalMapTexture = new UUID((string)row["normal_map_texture"]);
            windlight.horizon.X = Convert.ToSingle(row["horizon_r"]);
            windlight.horizon.Y = Convert.ToSingle(row["horizon_g"]);
            windlight.horizon.Z = Convert.ToSingle(row["horizon_b"]);
            windlight.horizon.W = Convert.ToSingle(row["horizon_i"]);
            windlight.hazeHorizon = Convert.ToSingle(row["haze_horizon"]);
            windlight.blueDensity.X = Convert.ToSingle(row["blue_density_r"]);
            windlight.blueDensity.Y = Convert.ToSingle(row["blue_density_g"]);
            windlight.blueDensity.Z = Convert.ToSingle(row["blue_density_b"]);
            windlight.blueDensity.W = Convert.ToSingle(row["blue_density_i"]);
            windlight.hazeDensity = Convert.ToSingle(row["haze_density"]);
            windlight.densityMultiplier = Convert.ToSingle(row["density_multiplier"]);
            windlight.distanceMultiplier = Convert.ToSingle(row["distance_multiplier"]);
            windlight.maxAltitude = Convert.ToUInt16(row["max_altitude"]);
            windlight.sunMoonColor.X = Convert.ToSingle(row["sun_moon_color_r"]);
            windlight.sunMoonColor.Y = Convert.ToSingle(row["sun_moon_color_g"]);
            windlight.sunMoonColor.Z = Convert.ToSingle(row["sun_moon_color_b"]);
            windlight.sunMoonColor.W = Convert.ToSingle(row["sun_moon_color_i"]);
            windlight.sunMoonPosition = Convert.ToSingle(row["sun_moon_position"]);
            windlight.ambient.X = Convert.ToSingle(row["ambient_r"]);
            windlight.ambient.Y = Convert.ToSingle(row["ambient_g"]);
            windlight.ambient.Z = Convert.ToSingle(row["ambient_b"]);
            windlight.ambient.W = Convert.ToSingle(row["ambient_i"]);
            windlight.eastAngle = Convert.ToSingle(row["east_angle"]);
            windlight.sunGlowFocus = Convert.ToSingle(row["sun_glow_focus"]);
            windlight.sunGlowSize = Convert.ToSingle(row["sun_glow_size"]);
            windlight.sceneGamma = Convert.ToSingle(row["scene_gamma"]);
            windlight.starBrightness = Convert.ToSingle(row["star_brightness"]);
            windlight.cloudColor.X = Convert.ToSingle(row["cloud_color_r"]);
            windlight.cloudColor.Y = Convert.ToSingle(row["cloud_color_g"]);
            windlight.cloudColor.Z = Convert.ToSingle(row["cloud_color_b"]);
            windlight.cloudColor.W = Convert.ToSingle(row["cloud_color_i"]);
            windlight.cloudXYDensity.X = Convert.ToSingle(row["cloud_x"]);
            windlight.cloudXYDensity.Y = Convert.ToSingle(row["cloud_y"]);
            windlight.cloudXYDensity.Z = Convert.ToSingle(row["cloud_density"]);
            windlight.cloudCoverage = Convert.ToSingle(row["cloud_coverage"]);
            windlight.cloudScale = Convert.ToSingle(row["cloud_scale"]);
            windlight.cloudDetailXYDensity.X = Convert.ToSingle(row["cloud_detail_x"]);
            windlight.cloudDetailXYDensity.Y = Convert.ToSingle(row["cloud_detail_y"]);
            windlight.cloudDetailXYDensity.Z = Convert.ToSingle(row["cloud_detail_density"]);
            windlight.cloudScrollX = Convert.ToSingle(row["cloud_scroll_x"]);
            windlight.cloudScrollXLock = Convert.ToBoolean(row["cloud_scroll_x_lock"]);
            windlight.cloudScrollY = Convert.ToSingle(row["cloud_scroll_y"]);
            windlight.cloudScrollYLock = Convert.ToBoolean(row["cloud_scroll_y_lock"]);
            windlight.drawClassicClouds = Convert.ToBoolean(row["draw_classic_clouds"]);

            return windlight;
        }
 public void RegionLightShareDataSaveFired(RegionLightShareData settings)
 {
     m_RegionLightShareDataOnSaveEventFired = true;
 }
        public void RegionLightShareDataCloneSaveTest01()
        {
            RegionLightShareData rlsd = new RegionLightShareData();
            rlsd.OnSave += RegionLightShareDataSaveFired;
            rlsd.Save();
            rlsd.OnSave -= RegionLightShareDataSaveFired;
            Assert.IsTrue(m_RegionLightShareDataOnSaveEventFired, "OnSave Event Never Fired");

            object o = rlsd.Clone();
            RegionLightShareData dupe = (RegionLightShareData) o;
            Assert.IsTrue(rlsd.sceneGamma == dupe.sceneGamma, "Memberwise Clone of RegionLightShareData failed");
        }
Beispiel #13
0
 public void StoreWindlightProfile(RegionLightShareData wl)
 {
     m_regInfo.WindlightSettings = wl;
     m_storageManager.DataStore.StoreRegionWindlightSettings(wl);
     m_eventManager.TriggerOnSaveNewWindlightProfile();
 }
Beispiel #14
0
 private void EventManager_OnSendNewWindlightProfileTargeted(RegionLightShareData wl, UUID pUUID)
 {
     IClientAPI client;
     m_scene.TryGetClient(pUUID, out client);
     SendProfileToClient(client, wl);
 }
        public void StoreRegionWindlightSettings(RegionLightShareData wl)
        {
            string sql = @"select region_id from regionwindlight where ""region_id"" = :region_id limit 1;";
            bool exists = false;
            using (NpgsqlConnection conn = new NpgsqlConnection(m_connectionString))
            {
                conn.Open();
                using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn))
                {
                    cmd.Parameters.Add(_Database.CreateParameter("region_id", wl.regionID.ToString() ));
                    NpgsqlDataReader dr = cmd.ExecuteReader();
                    exists = dr.Read();
                }
            }
            if (exists)
            {
                RemoveRegionWindlightSettings(wl.regionID);
            }

            // sql insert
            sql = @"INSERT INTO regionwindlight
                       (region_id
                       ,water_color_r
                       ,water_color_g
                       ,water_color_b
                       ,water_fog_density_exponent
                       ,underwater_fog_modifier
                       ,reflection_wavelet_scale_1
                       ,reflection_wavelet_scale_2
                       ,reflection_wavelet_scale_3
                       ,fresnel_scale
                       ,fresnel_offset
                       ,refract_scale_above
                       ,refract_scale_below
                       ,blur_multiplier
                       ,big_wave_direction_x
                       ,big_wave_direction_y
                       ,little_wave_direction_x
                       ,little_wave_direction_y
                       ,normal_map_texture
                       ,horizon_r
                       ,horizon_g
                       ,horizon_b
                       ,horizon_i
                       ,haze_horizon
                       ,blue_density_r
                       ,blue_density_g
                       ,blue_density_b
                       ,blue_density_i
                       ,haze_density
                       ,density_multiplier
                       ,distance_multiplier
                       ,max_altitude
                       ,sun_moon_color_r
                       ,sun_moon_color_g
                       ,sun_moon_color_b
                       ,sun_moon_color_i
                       ,sun_moon_position
                       ,ambient_r
                       ,ambient_g
                       ,ambient_b
                       ,ambient_i
                       ,east_angle
                       ,sun_glow_focus
                       ,sun_glow_size
                       ,scene_gamma
                       ,star_brightness
                       ,cloud_color_r
                       ,cloud_color_g
                       ,cloud_color_b
                       ,cloud_color_i
                       ,cloud_x
                       ,cloud_y
                       ,cloud_density
                       ,cloud_coverage
                       ,cloud_scale
                       ,cloud_detail_x
                       ,cloud_detail_y
                       ,cloud_detail_density
                       ,cloud_scroll_x
                       ,cloud_scroll_x_lock
                       ,cloud_scroll_y
                       ,cloud_scroll_y_lock
                       ,draw_classic_clouds)
                 VALUES
                       (:region_id
                       ,:water_color_r
                       ,:water_color_g
                       ,:water_color_b
                       ,:water_fog_density_exponent
                       ,:underwater_fog_modifier
                       ,:reflection_wavelet_scale_1
                       ,:reflection_wavelet_scale_2
                       ,:reflection_wavelet_scale_3
                       ,:fresnel_scale
                       ,:fresnel_offset
                       ,:refract_scale_above
                       ,:refract_scale_below
                       ,:blur_multiplier
                       ,:big_wave_direction_x
                       ,:big_wave_direction_y
                       ,:little_wave_direction_x
                       ,:little_wave_direction_y
                       ,:normal_map_texture
                       ,:horizon_r
                       ,:horizon_g
                       ,:horizon_b
                       ,:horizon_i
                       ,:haze_horizon
                       ,:blue_density_r
                       ,:blue_density_g
                       ,:blue_density_b
                       ,:blue_density_i
                       ,:haze_density
                       ,:density_multiplier
                       ,:distance_multiplier
                       ,:max_altitude
                       ,:sun_moon_color_r
                       ,:sun_moon_color_g
                       ,:sun_moon_color_b
                       ,:sun_moon_color_i
                       ,:sun_moon_position
                       ,:ambient_r
                       ,:ambient_g
                       ,:ambient_b
                       ,:ambient_i
                       ,:east_angle
                       ,:sun_glow_focus
                       ,:sun_glow_size
                       ,:scene_gamma
                       ,:star_brightness
                       ,:cloud_color_r
                       ,:cloud_color_g
                       ,:cloud_color_b
                       ,:cloud_color_i
                       ,:cloud_x
                       ,:cloud_y
                       ,:cloud_density
                       ,:cloud_coverage
                       ,:cloud_scale
                       ,:cloud_detail_x
                       ,:cloud_detail_y
                       ,:cloud_detail_density
                       ,:cloud_scroll_x
                       ,:cloud_scroll_x_lock
                       ,:cloud_scroll_y
                       ,:cloud_scroll_y_lock
                       ,:draw_classic_clouds);";

            using (NpgsqlConnection conn = new NpgsqlConnection(m_connectionString))
            {
                conn.Open();
                using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn))
                {
                    cmd.Parameters.Add(_Database.CreateParameter("region_id", wl.regionID.ToString()));
                    cmd.Parameters.Add(_Database.CreateParameter("water_color_r", wl.waterColor.X));
                    cmd.Parameters.Add(_Database.CreateParameter("water_color_g", wl.waterColor.Y));
                    cmd.Parameters.Add(_Database.CreateParameter("water_color_b", wl.waterColor.Z));
                    cmd.Parameters.Add(_Database.CreateParameter("water_fog_density_exponent", wl.waterFogDensityExponent));
                    cmd.Parameters.Add(_Database.CreateParameter("underwater_fog_modifier", wl.underwaterFogModifier));
                    cmd.Parameters.Add(_Database.CreateParameter("reflection_wavelet_scale_1", wl.reflectionWaveletScale.X));
                    cmd.Parameters.Add(_Database.CreateParameter("reflection_wavelet_scale_2", wl.reflectionWaveletScale.Y));
                    cmd.Parameters.Add(_Database.CreateParameter("reflection_wavelet_scale_3", wl.reflectionWaveletScale.Z));
                    cmd.Parameters.Add(_Database.CreateParameter("fresnel_scale", wl.fresnelScale));
                    cmd.Parameters.Add(_Database.CreateParameter("fresnel_offset", wl.fresnelOffset));
                    cmd.Parameters.Add(_Database.CreateParameter("refract_scale_above", wl.refractScaleAbove));
                    cmd.Parameters.Add(_Database.CreateParameter("refract_scale_below", wl.refractScaleBelow));
                    cmd.Parameters.Add(_Database.CreateParameter("blur_multiplier", wl.blurMultiplier));
                    cmd.Parameters.Add(_Database.CreateParameter("big_wave_direction_x", wl.bigWaveDirection.X));
                    cmd.Parameters.Add(_Database.CreateParameter("big_wave_direction_y", wl.bigWaveDirection.Y));
                    cmd.Parameters.Add(_Database.CreateParameter("little_wave_direction_x", wl.littleWaveDirection.X));
                    cmd.Parameters.Add(_Database.CreateParameter("little_wave_direction_y", wl.littleWaveDirection.Y));
                    cmd.Parameters.Add(_Database.CreateParameter("normal_map_texture", wl.normalMapTexture.ToString()));
                    cmd.Parameters.Add(_Database.CreateParameter("horizon_r", wl.horizon.X));
                    cmd.Parameters.Add(_Database.CreateParameter("horizon_g", wl.horizon.Y));
                    cmd.Parameters.Add(_Database.CreateParameter("horizon_b", wl.horizon.Z));
                    cmd.Parameters.Add(_Database.CreateParameter("horizon_i", wl.horizon.W));
                    cmd.Parameters.Add(_Database.CreateParameter("haze_horizon", wl.hazeHorizon));
                    cmd.Parameters.Add(_Database.CreateParameter("blue_density_r", wl.blueDensity.X));
                    cmd.Parameters.Add(_Database.CreateParameter("blue_density_g", wl.blueDensity.Y));
                    cmd.Parameters.Add(_Database.CreateParameter("blue_density_b", wl.blueDensity.Z));
                    cmd.Parameters.Add(_Database.CreateParameter("blue_density_i", wl.blueDensity.W));
                    cmd.Parameters.Add(_Database.CreateParameter("haze_density", wl.hazeDensity));
                    cmd.Parameters.Add(_Database.CreateParameter("density_multiplier", wl.densityMultiplier));
                    cmd.Parameters.Add(_Database.CreateParameter("distance_multiplier", wl.distanceMultiplier));
                    cmd.Parameters.Add(_Database.CreateParameter("max_altitude", wl.maxAltitude));
                    cmd.Parameters.Add(_Database.CreateParameter("sun_moon_color_r", wl.sunMoonColor.X));
                    cmd.Parameters.Add(_Database.CreateParameter("sun_moon_color_g", wl.sunMoonColor.Y));
                    cmd.Parameters.Add(_Database.CreateParameter("sun_moon_color_b", wl.sunMoonColor.Z));
                    cmd.Parameters.Add(_Database.CreateParameter("sun_moon_color_i", wl.sunMoonColor.W));
                    cmd.Parameters.Add(_Database.CreateParameter("sun_moon_position", wl.sunMoonPosition));
                    cmd.Parameters.Add(_Database.CreateParameter("ambient_r", wl.ambient.X));
                    cmd.Parameters.Add(_Database.CreateParameter("ambient_g", wl.ambient.Y));
                    cmd.Parameters.Add(_Database.CreateParameter("ambient_b", wl.ambient.Z));
                    cmd.Parameters.Add(_Database.CreateParameter("ambient_i", wl.ambient.W));
                    cmd.Parameters.Add(_Database.CreateParameter("east_angle", wl.eastAngle));
                    cmd.Parameters.Add(_Database.CreateParameter("sun_glow_focus", wl.sunGlowFocus));
                    cmd.Parameters.Add(_Database.CreateParameter("sun_glow_size", wl.sunGlowSize));
                    cmd.Parameters.Add(_Database.CreateParameter("scene_gamma", wl.sceneGamma));
                    cmd.Parameters.Add(_Database.CreateParameter("star_brightness", wl.starBrightness));
                    cmd.Parameters.Add(_Database.CreateParameter("cloud_color_r", wl.cloudColor.X));
                    cmd.Parameters.Add(_Database.CreateParameter("cloud_color_g", wl.cloudColor.Y));
                    cmd.Parameters.Add(_Database.CreateParameter("cloud_color_b", wl.cloudColor.Z));
                    cmd.Parameters.Add(_Database.CreateParameter("cloud_color_i", wl.cloudColor.W));
                    cmd.Parameters.Add(_Database.CreateParameter("cloud_x", wl.cloudXYDensity.X));
                    cmd.Parameters.Add(_Database.CreateParameter("cloud_y", wl.cloudXYDensity.Y));
                    cmd.Parameters.Add(_Database.CreateParameter("cloud_density", wl.cloudXYDensity.Z));
                    cmd.Parameters.Add(_Database.CreateParameter("cloud_coverage", wl.cloudCoverage));
                    cmd.Parameters.Add(_Database.CreateParameter("cloud_scale", wl.cloudScale));
                    cmd.Parameters.Add(_Database.CreateParameter("cloud_detail_x", wl.cloudDetailXYDensity.X));
                    cmd.Parameters.Add(_Database.CreateParameter("cloud_detail_y", wl.cloudDetailXYDensity.Y));
                    cmd.Parameters.Add(_Database.CreateParameter("cloud_detail_density", wl.cloudDetailXYDensity.Z));
                    cmd.Parameters.Add(_Database.CreateParameter("cloud_scroll_x", wl.cloudScrollX));
                    cmd.Parameters.Add(_Database.CreateParameter("cloud_scroll_x_lock", wl.cloudScrollXLock));
                    cmd.Parameters.Add(_Database.CreateParameter("cloud_scroll_y", wl.cloudScrollY));
                    cmd.Parameters.Add(_Database.CreateParameter("cloud_scroll_y_lock", wl.cloudScrollYLock));
                    cmd.Parameters.Add(_Database.CreateParameter("draw_classic_clouds", wl.drawClassicClouds));

                    cmd.ExecuteNonQuery();
                }
            }
            #region update
            //            }
            //            else
            //            {
            //                // sql update
            //                sql = @"UPDATE [OpenSim].[dbo].[regionwindlight]
            //   SET [region_id] =                   @region_id
            //      ,[water_color_r] =               @water_color_r
            //      ,[water_color_g] =               @water_color_g
            //      ,[water_color_b] =               @water_color_b
            //      ,[water_fog_density_exponent] =  @water_fog_density_exponent
            //      ,[underwater_fog_modifier] =     @underwater_fog_modifier
            //      ,[reflection_wavelet_scale_1] =  @reflection_wavelet_scale_1
            //      ,[reflection_wavelet_scale_2] =  @reflection_wavelet_scale_2
            //      ,[reflection_wavelet_scale_3] =  @reflection_wavelet_scale_3
            //      ,[fresnel_scale] =               @fresnel_scale
            //      ,[fresnel_offset] =              @fresnel_offset
            //      ,[refract_scale_above] =         @refract_scale_above
            //      ,[refract_scale_below] =         @refract_scale_below
            //      ,[blur_multiplier] =             @blur_multiplier
            //      ,[big_wave_direction_x] =        @big_wave_direction_x
            //      ,[big_wave_direction_y] =        @big_wave_direction_y
            //      ,[little_wave_direction_x] =     @little_wave_direction_x
            //      ,[little_wave_direction_y] =     @little_wave_direction_y
            //      ,[normal_map_texture] =          @normal_map_texture
            //      ,[horizon_r] =                   @horizon_r
            //      ,[horizon_g] =                   @horizon_g
            //      ,[horizon_b] =                   @horizon_b
            //      ,[horizon_i] =                   @horizon_i
            //      ,[haze_horizon] =                @haze_horizon
            //      ,[blue_density_r] =              @blue_density_r
            //      ,[blue_density_g] =              @blue_density_g
            //      ,[blue_density_b] =              @blue_density_b
            //      ,[blue_density_i] =              @blue_density_i
            //      ,[haze_density] =                @haze_density
            //      ,[density_multiplier] =          @density_multiplier
            //      ,[distance_multiplier] =         @distance_multiplier
            //      ,[max_altitude] =                @max_altitude
            //      ,[sun_moon_color_r] =            @sun_moon_color_r
            //      ,[sun_moon_color_g] =            @sun_moon_color_g
            //      ,[sun_moon_color_b] =            @sun_moon_color_b
            //      ,[sun_moon_color_i] =            @sun_moon_color_i
            //      ,[sun_moon_position] =           @sun_moon_position
            //      ,[ambient_r] =                   @ambient_r
            //      ,[ambient_g] =                   @ambient_g
            //      ,[ambient_b] =                   @ambient_b
            //      ,[ambient_i] =                   @ambient_i
            //      ,[east_angle] =                  @east_angle
            //      ,[sun_glow_focus] =              @sun_glow_focus
            //      ,[sun_glow_size] =               @sun_glow_size
            //      ,[scene_gamma] =                 @scene_gamma
            //      ,[star_brightness] =             @star_brightness
            //      ,[cloud_color_r] =               @cloud_color_r
            //      ,[cloud_color_g] =               @cloud_color_g
            //      ,[cloud_color_b] =               @cloud_color_b
            //      ,[cloud_color_i] =               @cloud_color_i
            //      ,[cloud_x] =                     @cloud_x
            //      ,[cloud_y] =                     @cloud_y
            //      ,[cloud_density] =               @cloud_density
            //      ,[cloud_coverage] =              @cloud_coverage
            //      ,[cloud_scale] =                 @cloud_scale
            //      ,[cloud_detail_x] =              @cloud_detail_x
            //      ,[cloud_detail_y] =              @cloud_detail_y
            //      ,[cloud_detail_density] =        @cloud_detail_density
            //      ,[cloud_scroll_x] =              @cloud_scroll_x
            //      ,[cloud_scroll_x_lock] =         @cloud_scroll_x_lock
            //      ,[cloud_scroll_y] =              @cloud_scroll_y
            //      ,[cloud_scroll_y_lock] =         @cloud_scroll_y_lock
            //      ,[draw_classic_clouds] =         @draw_classic_clouds
            // WHERE region_id = @region_id";
            //                using (SqlConnection conn = new SqlConnection(m_connectionString))
            //                {
            //                    conn.Open();
            //                    using (SqlCommand cmd = new SqlCommand(sql, conn))
            //                    {
            //                        cmd.Parameters.AddWithValue("region_id", wl.regionID);
            //                        cmd.Parameters.AddWithValue("water_color_r", wl.waterColor.X);
            //                        cmd.Parameters.AddWithValue("water_color_g", wl.waterColor.Y);
            //                        cmd.Parameters.AddWithValue("water_color_b", wl.waterColor.Z);
            //                        cmd.Parameters.AddWithValue("water_fog_density_exponent", wl.waterFogDensityExponent);
            //                        cmd.Parameters.AddWithValue("underwater_fog_modifier", wl.underwaterFogModifier);
            //                        cmd.Parameters.AddWithValue("reflection_wavelet_scale_1", wl.reflectionWaveletScale.X);
            //                        cmd.Parameters.AddWithValue("reflection_wavelet_scale_2", wl.reflectionWaveletScale.Y);
            //                        cmd.Parameters.AddWithValue("reflection_wavelet_scale_3", wl.reflectionWaveletScale.Z);
            //                        cmd.Parameters.AddWithValue("fresnel_scale", wl.fresnelScale);
            //                        cmd.Parameters.AddWithValue("fresnel_offset", wl.fresnelOffset);
            //                        cmd.Parameters.AddWithValue("refract_scale_above", wl.refractScaleAbove);
            //                        cmd.Parameters.AddWithValue("refract_scale_below", wl.refractScaleBelow);
            //                        cmd.Parameters.AddWithValue("blur_multiplier", wl.blurMultiplier);
            //                        cmd.Parameters.AddWithValue("big_wave_direction_x", wl.bigWaveDirection.X);
            //                        cmd.Parameters.AddWithValue("big_wave_direction_y", wl.bigWaveDirection.Y);
            //                        cmd.Parameters.AddWithValue("little_wave_direction_x", wl.littleWaveDirection.X);
            //                        cmd.Parameters.AddWithValue("little_wave_direction_y", wl.littleWaveDirection.Y);
            //                        cmd.Parameters.AddWithValue("normal_map_texture", wl.normalMapTexture);
            //                        cmd.Parameters.AddWithValue("horizon_r", wl.horizon.X);
            //                        cmd.Parameters.AddWithValue("horizon_g", wl.horizon.Y);
            //                        cmd.Parameters.AddWithValue("horizon_b", wl.horizon.Z);
            //                        cmd.Parameters.AddWithValue("horizon_i", wl.horizon.W);
            //                        cmd.Parameters.AddWithValue("haze_horizon", wl.hazeHorizon);
            //                        cmd.Parameters.AddWithValue("blue_density_r", wl.blueDensity.X);
            //                        cmd.Parameters.AddWithValue("blue_density_g", wl.blueDensity.Y);
            //                        cmd.Parameters.AddWithValue("blue_density_b", wl.blueDensity.Z);
            //                        cmd.Parameters.AddWithValue("blue_density_i", wl.blueDensity.W);
            //                        cmd.Parameters.AddWithValue("haze_density", wl.hazeDensity);
            //                        cmd.Parameters.AddWithValue("density_multiplier", wl.densityMultiplier);
            //                        cmd.Parameters.AddWithValue("distance_multiplier", wl.distanceMultiplier);
            //                        cmd.Parameters.AddWithValue("max_altitude", wl.maxAltitude);
            //                        cmd.Parameters.AddWithValue("sun_moon_color_r", wl.sunMoonColor.X);
            //                        cmd.Parameters.AddWithValue("sun_moon_color_g", wl.sunMoonColor.Y);
            //                        cmd.Parameters.AddWithValue("sun_moon_color_b", wl.sunMoonColor.Z);
            //                        cmd.Parameters.AddWithValue("sun_moon_color_i", wl.sunMoonColor.W);
            //                        cmd.Parameters.AddWithValue("sun_moon_position", wl.sunMoonPosition);
            //                        cmd.Parameters.AddWithValue("ambient_r", wl.ambient.X);
            //                        cmd.Parameters.AddWithValue("ambient_g", wl.ambient.Y);
            //                        cmd.Parameters.AddWithValue("ambient_b", wl.ambient.Z);
            //                        cmd.Parameters.AddWithValue("ambient_i", wl.ambient.W);
            //                        cmd.Parameters.AddWithValue("east_angle", wl.eastAngle);
            //                        cmd.Parameters.AddWithValue("sun_glow_focus", wl.sunGlowFocus);
            //                        cmd.Parameters.AddWithValue("sun_glow_size", wl.sunGlowSize);
            //                        cmd.Parameters.AddWithValue("scene_gamma", wl.sceneGamma);
            //                        cmd.Parameters.AddWithValue("star_brightness", wl.starBrightness);
            //                        cmd.Parameters.AddWithValue("cloud_color_r", wl.cloudColor.X);
            //                        cmd.Parameters.AddWithValue("cloud_color_g", wl.cloudColor.Y);
            //                        cmd.Parameters.AddWithValue("cloud_color_b", wl.cloudColor.Z);
            //                        cmd.Parameters.AddWithValue("cloud_color_i", wl.cloudColor.W);
            //                        cmd.Parameters.AddWithValue("cloud_x", wl.cloudXYDensity.X);
            //                        cmd.Parameters.AddWithValue("cloud_y", wl.cloudXYDensity.Y);
            //                        cmd.Parameters.AddWithValue("cloud_density", wl.cloudXYDensity.Z);
            //                        cmd.Parameters.AddWithValue("cloud_coverage", wl.cloudCoverage);
            //                        cmd.Parameters.AddWithValue("cloud_scale", wl.cloudScale);
            //                        cmd.Parameters.AddWithValue("cloud_detail_x", wl.cloudDetailXYDensity.X);
            //                        cmd.Parameters.AddWithValue("cloud_detail_y", wl.cloudDetailXYDensity.Y);
            //                        cmd.Parameters.AddWithValue("cloud_detail_density", wl.cloudDetailXYDensity.Z);
            //                        cmd.Parameters.AddWithValue("cloud_scroll_x", wl.cloudScrollX);
            //                        cmd.Parameters.AddWithValue("cloud_scroll_x_lock", wl.cloudScrollXLock);
            //                        cmd.Parameters.AddWithValue("cloud_scroll_y", wl.cloudScrollY);
            //                        cmd.Parameters.AddWithValue("cloud_scroll_y_lock", wl.cloudScrollYLock);
            //                        cmd.Parameters.AddWithValue("draw_classic_clouds", wl.drawClassicClouds);

            //                        cmd.ExecuteNonQuery();
            //                    }
            //                }
            //            }
            #endregion
        }
        /// <summary>
        /// Adds an windlight into region storage
        /// </summary>
        /// <param name="wl">RegionLightShareData</param>
        public void StoreRegionWindlightSettings(RegionLightShareData wl)
        {
            lock (ds)
            {
                DataTable windlightTable = ds.Tables["regionwindlight"];
                DataRow windlightRow = windlightTable.Rows.Find(wl.regionID.ToString());

                if (windlightRow == null)
                {
                    windlightRow = windlightTable.NewRow();
                    fillRegionWindlightRow(windlightRow, wl);
                    windlightTable.Rows.Add(windlightRow);
                }
                else
                {
                    fillRegionWindlightRow(windlightRow, wl);
                }

                Commit();
            }
        }
Beispiel #17
0
        public RegionLightShareData ToLightShare()
        {
            RegionLightShareData ls = new RegionLightShareData();

            DayCycle.TrackEntry te;
            if (Cycle.waterTrack.Count > 0)
            {
                te = Cycle.waterTrack[0];
                if (Cycle.waterframes.TryGetValue(te.frameName, out WaterData water))
                {
                    ls.waterColor = water.waterFogColor * 256f;
                    ls.waterFogDensityExponent = (float)Math.Sqrt(water.waterFogDensity);
                    //ls.waterFogDensityExponent = water.waterFogDensity;
                    ls.underwaterFogModifier  = water.underWaterFogMod;
                    ls.reflectionWaveletScale = water.normScale;
                    ls.fresnelScale           = water.fresnelScale;
                    ls.fresnelOffset          = water.fresnelOffset;
                    ls.refractScaleAbove      = water.scaleAbove;
                    ls.refractScaleBelow      = water.scaleBelow;
                    ls.blurMultiplier         = water.blurMultiplier;
                    ls.littleWaveDirection    = water.wave1Dir;
                    ls.bigWaveDirection       = water.wave2Dir;
                    ls.normalMapTexture       = water.normalMap;
                }
            }

            if (Cycle.skyTrack0.Count > 0)
            {
                te = Cycle.skyTrack0[0];
                if (Cycle.skyframes.TryGetValue(te.frameName, out SkyData sky))
                {
                    Vector4 lightnorm;
                    convertToAngles(sky, out ls.sunMoonPosition, out ls.eastAngle, out lightnorm);
                    ls.sunMoonPosition     *= 0.5f / (float)Math.PI;
                    ls.eastAngle           *= 0.5f / (float)Math.PI;
                    ls.sunMoonColor         = sky.sunlight_color / 3f;
                    ls.ambient              = new Vector4(sky.ambient.X / 3.0f, sky.ambient.Y / 3.0f, sky.ambient.Z / 3.0f, 1);
                    ls.horizon              = new Vector4(sky.blue_horizon.X / 2.0f, sky.blue_horizon.Y / 2.0f, sky.blue_horizon.Z / 2.0f, 1);
                    ls.blueDensity          = new Vector4(sky.blue_density.X / 2.0f, sky.blue_density.Y / 2.0f, sky.blue_density.Z / 2.0f, 1);
                    ls.hazeHorizon          = sky.haze_horizon;
                    ls.hazeDensity          = sky.haze_density;
                    ls.cloudCoverage        = sky.cloud_shadow;
                    ls.densityMultiplier    = 1000f * sky.density_multiplier;
                    ls.distanceMultiplier   = sky.distance_multiplier;
                    ls.maxAltitude          = (ushort)sky.max_y;
                    ls.cloudColor           = new Vector4(sky.cloud_color.X, sky.cloud_color.Y, sky.cloud_color.Z, 1);
                    ls.cloudXYDensity       = sky.cloud_pos_density1;
                    ls.cloudDetailXYDensity = sky.cloud_pos_density2;
                    ls.cloudScale           = sky.cloud_scale;
                    ls.sceneGamma           = sky.gamma;
                    ls.sunGlowSize          = (2f - sky.glow.X) / 20f;
                    ls.sunGlowFocus         = -sky.glow.Z / 5f;
                    ls.cloudScrollX         = sky.cloud_scroll_rate.X;
                    ls.cloudScrollY         = sky.cloud_scroll_rate.Y;
                    ls.cloudScrollXLock     = ls.cloudScrollX == 0f;
                    ls.cloudScrollYLock     = ls.cloudScrollY == 0f;
                    ls.starBrightness       = sky.star_brightness / 250f;
                }
            }
            return(ls);
        }
 public void StoreRegionWindlightSettings(RegionLightShareData wl)
 {
     m_database.StoreRegionWindlightSettings(wl);
 }
 public void SendProfileToClient(ScenePresence presence, RegionLightShareData wl)
 {
     IClientAPI client = presence.ControllingClient;
     if (m_enableWindlight)
     {
         if (presence.IsChildAgent == false)
         {
             List<byte[]> param = compileWindlightSettings(wl);
             client.SendGenericMessage("Windlight", param);
         }
     }
     else
     {
         //We probably don't want to spam chat with this.. probably
         //m_log.Debug("[WINDLIGHT]: Module disabled");
     }
 }
Beispiel #20
0
 public void TriggerOnSendNewWindlightProfileTargeted(RegionLightShareData wl, UUID user)
 {
     OnSendNewWindlightProfileTargetedDelegate handlerSendNewWindlightProfileTargeted = OnSendNewWindlightProfileTargeted;
     if (handlerSendNewWindlightProfileTargeted != null)
     {
         handlerSendNewWindlightProfileTargeted(wl, user);
     }
 }
Beispiel #21
0
        private void HandleReset(Object[] args) {
            if (!m_enableWindlight) {
                m_log.InfoFormat("[WINDLIGHT]: Cannot reset windlight profile, module disabled. Use 'windlight enable' first.");
            } else {
                m_log.InfoFormat("[WINDLIGHT]: Resetting Windlight profile in database");
				RegionLightShareData rlsd = new RegionLightShareData();
				rlsd.valid = true;
				rlsd.regionID = m_scene.RegionInfo.RegionID;
                m_scene.StoreWindlightProfile(rlsd);
                m_log.InfoFormat("[WINDLIGHT]: Reset complete");
            }
        }