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 = 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; } }
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; } }
public static void SetDefaults() { SunProperties = MySunProperties.Default; FogProperties = MyFogProperties.Default; ImpostorProperties = new VRageRender.MyImpostorProperties[1]; ParticleDustProperties = new MyParticleDustProperties(); }
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() { SunProperties = MySunProperties.Default; FogProperties = MyFogProperties.Default; ImpostorProperties = new VRageRender.MyImpostorProperties[1]; ParticleDustProperties = new MyParticleDustProperties(); GodRaysProperties = new MyGodRaysProperties(); BackgroundTexture = "BackgroundCube"; }
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); NewPipelineSettings.CopyFrom(environment.NewPipelineSettings); SunRotationAxis = SunProperties.SunRotationAxis; MyRenderProxy.UpdateShadowsSettings(ShadowSettings); MyRenderProxy.UpdateNewPipelineSettings(NewPipelineSettings); MySector.Lodding.UpdatePreset(environment.UserLoddingSettings, environment.LowLoddingSettings, environment.MediumLoddingSettings, environment.HighLoddingSettings); MyMaterialsSettings materialsSettings = new MyMaterialsSettings(); materialsSettings.CopyFrom(environment.MaterialsSettings); MyRenderProxy.UpdateMaterialsSettings(materialsSettings); // TODO: Delete MyPostprocessSettingsWrapper and move to have bundled // settings in MySector and change all references to point here MyPostprocessSettingsWrapper.Settings = 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); } }
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; } }