public static void InitEnvironmentSettings(MyObjectBuilder_EnvironmentSettings environmentBuilder = null) { var environment = MyDefinitionManager.Static.EnvironmentDefinition; var o = environment.BackgroundOrientation; BackgroundTexture = environment.BackgroundTexture; BackgroundOrientation = Quaternion.CreateFromYawPitchRoll(o.Yaw, o.Pitch, o.Roll); DistanceToSun = environment.DistanceToSun; SunProperties = new MySunProperties(environment.SunProperties); FogProperties = environment.FogProperties; if (environmentBuilder != null) { Vector3 sunDirection; Vector3.CreateFromAzimuthAndElevation(environmentBuilder.SunAzimuth, environmentBuilder.SunElevation, out sunDirection); SunProperties.BaseSunDirectionNormalized = sunDirection; SunProperties.SunDirectionNormalized = sunDirection; SunProperties.SunIntensity = environmentBuilder.SunIntensity; FogProperties.FogMultiplier = environmentBuilder.FogMultiplier; FogProperties.FogDensity = environmentBuilder.FogDensity; FogProperties.FogColor = new Color(environmentBuilder.FogColor); FogProperties.FogColor.A = 255; } }
protected override void Init(MyObjectBuilder_DefinitionBase builder) { base.Init(builder); MyObjectBuilder_EnvironmentDefinition objBuilder = (MyObjectBuilder_EnvironmentDefinition)builder; FogProperties = objBuilder.FogProperties; SunProperties = objBuilder.SunProperties; PostProcessSettings = objBuilder.PostProcessSettings; SSAOSettings = objBuilder.SSAOSettings; HBAOSettings = objBuilder.HBAOSettings; ShadowSettings.CopyFrom(objBuilder.ShadowSettings); NewPipelineSettings.CopyFrom(objBuilder.NewPipelineSettings); MaterialsSettings.CopyFrom(objBuilder.MaterialsSettings); SmallShipMaxSpeed = objBuilder.SmallShipMaxSpeed; LargeShipMaxSpeed = objBuilder.LargeShipMaxSpeed; SmallShipMaxAngularSpeed = objBuilder.SmallShipMaxAngularSpeed; LargeShipMaxAngularSpeed = objBuilder.LargeShipMaxAngularSpeed; ContourHighlightColor = new Color(objBuilder.ContourHighlightColor); ContourHighlightThickness = objBuilder.ContourHighlightThickness; HighlightPulseInSeconds = objBuilder.HighlightPulseInSeconds; EnvironmentTexture = objBuilder.EnvironmentTexture; EnvironmentOrientation = objBuilder.EnvironmentOrientation; EnvironmentalParticles = objBuilder.EnvironmentalParticles; }
public static void SetDefaults() { SunProperties = MySunProperties.Default; FogProperties = MyFogProperties.Default; ImpostorProperties = new VRageRender.MyImpostorProperties[1]; ParticleDustProperties = new MyParticleDustProperties(); }
protected override void Init(MyObjectBuilder_DefinitionBase builder) { base.Init(builder); MyObjectBuilder_EnvironmentDefinition definition = (MyObjectBuilder_EnvironmentDefinition)builder; this.FogProperties = definition.FogProperties; this.PlanetProperties = definition.PlanetProperties; this.SunProperties = definition.SunProperties; this.PostProcessSettings = definition.PostProcessSettings; this.SSAOSettings = definition.SSAOSettings; this.HBAOSettings = definition.HBAOSettings; this.ShadowSettings.CopyFrom(definition.ShadowSettings); this.LowLoddingSettings.CopyFrom(definition.LowLoddingSettings); this.MediumLoddingSettings.CopyFrom(definition.MediumLoddingSettings); this.HighLoddingSettings.CopyFrom(definition.HighLoddingSettings); this.ExtremeLoddingSettings.CopyFrom(definition.ExtremeLoddingSettings); this.SmallShipMaxSpeed = definition.SmallShipMaxSpeed; this.LargeShipMaxSpeed = definition.LargeShipMaxSpeed; this.SmallShipMaxAngularSpeed = definition.SmallShipMaxAngularSpeed; this.LargeShipMaxAngularSpeed = definition.LargeShipMaxAngularSpeed; this.ContourHighlightColor = new Color(definition.ContourHighlightColor); this.ContourHighlightThickness = definition.ContourHighlightThickness; this.HighlightPulseInSeconds = definition.HighlightPulseInSeconds; this.EnvironmentTexture = definition.EnvironmentTexture; this.EnvironmentOrientation = definition.EnvironmentOrientation; this.EnvironmentalParticles = definition.EnvironmentalParticles; }
public static void SetDefaults() { SunProperties = new MySunProperties(MySunProperties.Default); FogProperties = MyFogProperties.Default; ImpostorProperties = new VRageRender.MyImpostorProperties[1]; ParticleDustProperties = new MyParticleDustProperties(); GodRaysProperties = new MyGodRaysProperties(); BackgroundTexture = "BackgroundCube"; }
public static void SetDefaults() { MySolarSystemArea defaults = MySolarSystemConstants.GetDefaultArea(); SunProperties = defaults.SectorData.SunProperties; FogProperties = defaults.SectorData.FogProperties; DebrisProperties = defaults.SectorData.DebrisProperties; ImpostorProperties = defaults.SectorData.ImpostorProperties; ParticleDustProperties = defaults.SectorData.ParticleDustProperties; GodRaysProperties = defaults.SectorData.GodRaysProperties; BackgroundTexture = defaults.SectorData.BackgroundTexture; }
public static void InitEnvironmentSettings(MyObjectBuilder_EnvironmentSettings environmentBuilder = null) { if (environmentBuilder != null) { EnvironmentDefinition = MyDefinitionManager.Static.GetDefinition<MyEnvironmentDefinition>(environmentBuilder.EnvironmentDefinition); } else if (EnvironmentDefinition == null) { // Fallback EnvironmentDefinition = MyDefinitionManager.Static.GetDefinition<MyEnvironmentDefinition>(MyStringHash.GetOrCompute("Default")); } var environment = EnvironmentDefinition; SunProperties = environment.SunProperties; FogProperties = environment.FogProperties; SSAOSettings = environment.SSAOSettings; HBAOSettings = environment.HBAOSettings; ShadowSettings.CopyFrom(environment.ShadowSettings); SunRotationAxis = SunProperties.SunRotationAxis; MyRenderProxy.UpdateShadowsSettings(ShadowSettings); // TODO: Delete MyPostprocessSettingsWrapper and move to have bundled // settings in MySector and change all references to point here MyPostprocessSettingsWrapper.Settings = environment.PostProcessSettings; MyPostprocessSettingsWrapper.PlanetSettings = environment.PostProcessSettings; if (environmentBuilder != null) { Vector3 sunDirection; Vector3.CreateFromAzimuthAndElevation(environmentBuilder.SunAzimuth, environmentBuilder.SunElevation, out sunDirection); sunDirection.Normalize(); SunProperties.BaseSunDirectionNormalized = sunDirection; SunProperties.SunDirectionNormalized = sunDirection; //SunProperties.SunIntensity = environmentBuilder.SunIntensity; FogProperties.FogMultiplier = environmentBuilder.FogMultiplier; FogProperties.FogDensity = environmentBuilder.FogDensity; FogProperties.FogColor = new Color(environmentBuilder.FogColor); } }
protected override void Init(MyObjectBuilder_DefinitionBase builder) { base.Init(builder); MyObjectBuilder_EnvironmentDefinition objBuilder = (MyObjectBuilder_EnvironmentDefinition)builder; FogProperties = objBuilder.FogProperties; SunProperties = objBuilder.SunProperties; PostProcessSettings = objBuilder.PostProcessSettings; SSAOSettings = objBuilder.SSAOSettings; HBAOSettings = objBuilder.HBAOSettings; ShadowSettings.CopyFrom(objBuilder.ShadowSettings); SmallShipMaxSpeed = objBuilder.SmallShipMaxSpeed; LargeShipMaxSpeed = objBuilder.LargeShipMaxSpeed; SmallShipMaxAngularSpeed = objBuilder.SmallShipMaxAngularSpeed; LargeShipMaxAngularSpeed = objBuilder.LargeShipMaxAngularSpeed; ContourHighlightColor = new Color(objBuilder.ContourHighlightColor); ContourHighlightThickness = objBuilder.ContourHighlightThickness; HighlightPulseInSeconds = objBuilder.HighlightPulseInSeconds; EnvironmentTexture = objBuilder.EnvironmentTexture; EnvironmentOrientation = objBuilder.EnvironmentOrientation; }
public static void InitEnvironmentSettings(MyObjectBuilder_EnvironmentSettings environmentBuilder = null) { if (environmentBuilder != null) { EnvironmentDefinition = MyDefinitionManager.Static.GetDefinition<MyEnvironmentDefinition>(environmentBuilder.EnvironmentDefinition); } else if (EnvironmentDefinition == null) { // Fallback EnvironmentDefinition = MyDefinitionManager.Static.GetDefinition<MyEnvironmentDefinition>(MyStringHash.GetOrCompute("Default")); } var environment = EnvironmentDefinition; var o = environment.BackgroundOrientation; BackgroundTexture = environment.BackgroundTexture; BackgroundTextureNight = environment.BackgroundTextureNight; BackgroundTextureNightPrefiltered = environment.BackgroundTextureNightPrefiltered; BackgroundOrientation = Quaternion.CreateFromYawPitchRoll(o.Yaw, o.Pitch, o.Roll); DistanceToSun = environment.DistanceToSun; SunProperties = new MySunProperties(environment.SunProperties); FogProperties = environment.FogProperties; if (environmentBuilder != null) { Vector3 sunDirection; Vector3.CreateFromAzimuthAndElevation(environmentBuilder.SunAzimuth, environmentBuilder.SunElevation, out sunDirection); SunProperties.SunDirectionNormalized = sunDirection; SunProperties.SunIntensity = environmentBuilder.SunIntensity; FogProperties.FogMultiplier = environmentBuilder.FogMultiplier; FogProperties.FogDensity = environmentBuilder.FogDensity; FogProperties.FogColor = new Color(environmentBuilder.FogColor); FogProperties.FogColor.A = 255; } }