Beispiel #1
0
 public void CopyFrom(MyMaterialsSettings settings)
 {
     ChangeableMaterials = settings.ChangeableMaterials;
 }
Beispiel #2
0
        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);

            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;
            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);
            }
        }
 public void CopyFrom(MyMaterialsSettings settings)
 {
     Data = settings.Data;
     ChangeableMaterials = settings.ChangeableMaterials;
 }
 public void SetMaterialsSettings(MyMaterialsSettings settings)
 {
     m_ignoredMaterials.Clear();
     foreach (var mat in settings.ChangeableMaterials)
         m_ignoredMaterials.Add(mat.MaterialName);
 }
 public MyEnvironmentDefinition()
 {
     ShadowSettings = new MyShadowsSettings();
     MaterialsSettings = new MyMaterialsSettings();
 }
Beispiel #6
0
        public static void UpdateMaterialsSettings(MyMaterialsSettings settings)
        {
            var message = MessagePool.Get<MyRenderMessageUpdateMaterialsSettings>(MyRenderMessageEnum.UpdateMaterialsSettings);

            message.Settings.CopyFrom(settings);
            EnqueueMessage(message);
        }