protected override void Init(MyObjectBuilder_DefinitionBase builder)
        {
            base.Init(builder);

            var materialBuilder = builder as MyObjectBuilder_TransparentMaterialDefinition;
            MyDebug.AssertDebug(materialBuilder != null, "Initializing transparent material definition using wrong object builder.");

            Texture = materialBuilder.Texture;
            TextureType = materialBuilder.TextureType;
            CanBeAffectedByLights = materialBuilder.CanBeAffectedByOtherLights;
            AlphaMistingEnable = materialBuilder.AlphaMistingEnable;
            IgnoreDepth = materialBuilder.IgnoreDepth;
            NeedSort = materialBuilder.NeedSort;
            UseAtlas = materialBuilder.UseAtlas;
            AlphaMistingStart = materialBuilder.AlphaMistingStart;
            AlphaMistingEnd = materialBuilder.AlphaMistingEnd;
            SoftParticleDistanceScale = materialBuilder.SoftParticleDistanceScale;
            Emissivity = materialBuilder.Emissivity;
            AlphaSaturation = materialBuilder.AlphaSaturation;
            Reflection = materialBuilder.Reflection;
            Reflectivity = materialBuilder.Reflectivity;
            Color = materialBuilder.Color;
            AlphaCutout = materialBuilder.AlphaCutout;
            TargetSize = materialBuilder.TargetSize;
        }   
Esempio n. 2
0
        protected override void Init(MyObjectBuilder_DefinitionBase builder)
        {
            base.Init(builder);
            MyObjectBuilder_TransparentMaterialDefinition definition = builder as MyObjectBuilder_TransparentMaterialDefinition;

            this.Texture      = definition.Texture;
            this.GlossTexture = definition.GlossTexture;
            if (this.Texture == null)
            {
                this.Texture = string.Empty;
            }
            this.TextureType           = definition.TextureType;
            this.CanBeAffectedByLights = definition.CanBeAffectedByOtherLights;
            this.AlphaMistingEnable    = definition.AlphaMistingEnable;
            this.UseAtlas                  = definition.UseAtlas;
            this.AlphaMistingStart         = definition.AlphaMistingStart;
            this.AlphaMistingEnd           = definition.AlphaMistingEnd;
            this.SoftParticleDistanceScale = definition.SoftParticleDistanceScale;
            this.AlphaSaturation           = definition.AlphaSaturation;
            this.Reflectivity              = definition.Reflectivity;
            this.Fresnel             = definition.Fresnel;
            this.IsFlareOccluder     = definition.IsFlareOccluder;
            this.Color               = definition.Color;
            this.ColorAdd            = definition.ColorAdd;
            this.ShadowMultiplier    = definition.ShadowMultiplier;
            this.LightMultiplier     = definition.LightMultiplier;
            this.AlphaCutout         = definition.AlphaCutout;
            this.TargetSize          = definition.TargetSize;
            this.ReflectionShadow    = definition.ReflectionShadow;
            this.Gloss               = definition.Gloss;
            this.GlossTextureAdd     = definition.GlossTextureAdd;
            this.SpecularColorFactor = definition.SpecularColorFactor;
        }
Esempio n. 3
0
        protected override void Init(MyObjectBuilder_DefinitionBase builder)
        {
            base.Init(builder);

            var materialBuilder = builder as MyObjectBuilder_TransparentMaterialDefinition;

            MyDebug.AssertDebug(materialBuilder != null, "Initializing transparent material definition using wrong object builder.");

            Texture = materialBuilder.Texture;
            if (Texture == null)
            {
                Texture = string.Empty;
            }
            TextureType           = materialBuilder.TextureType;
            CanBeAffectedByLights = materialBuilder.CanBeAffectedByOtherLights;
            AlphaMistingEnable    = materialBuilder.AlphaMistingEnable;
            IgnoreDepth           = materialBuilder.IgnoreDepth;
            NeedSort                  = materialBuilder.NeedSort;
            UseAtlas                  = materialBuilder.UseAtlas;
            AlphaMistingStart         = materialBuilder.AlphaMistingStart;
            AlphaMistingEnd           = materialBuilder.AlphaMistingEnd;
            SoftParticleDistanceScale = materialBuilder.SoftParticleDistanceScale;
            Emissivity                = materialBuilder.Emissivity;
            AlphaSaturation           = materialBuilder.AlphaSaturation;
            Reflection                = materialBuilder.Reflection;
            Reflectivity              = materialBuilder.Reflectivity;
            Color       = materialBuilder.Color;
            AlphaCutout = materialBuilder.AlphaCutout;
            TargetSize  = materialBuilder.TargetSize;
        }
Esempio n. 4
0
        public MyTransparentMaterial(
            string Name,
            MyTransparentMaterialTextureType TextureType,
            string Texture,
            float SoftParticleDistanceScale,
            bool CanBeAffectedByOtherLights,
            bool AlphaMistingEnable,
            Vector4 Color,
            bool IgnoreDepth        = false,
            bool NeedSort           = true,
            bool UseAtlas           = false,
            float Emissivity        = 0,
            float AlphaMistingStart = 1,
            float AlphaMistingEnd   = 4,
            float AlphaSaturation   = 1,
            float Reflectivity      = 0,
            bool AlphaCutout        = false,
            Vector2I?TargetSize     = null)
        {
            this.Name        = Name;
            this.TextureType = TextureType;
            this.Texture     = Texture;
            this.SoftParticleDistanceScale  = SoftParticleDistanceScale;
            this.CanBeAffectedByOtherLights = CanBeAffectedByOtherLights;
            this.AlphaMistingEnable         = AlphaMistingEnable;
            this.IgnoreDepth       = IgnoreDepth;
            this.NeedSort          = NeedSort;
            this.UseAtlas          = UseAtlas;
            this.Emissivity        = Emissivity;
            this.AlphaMistingStart = AlphaMistingStart;
            this.AlphaMistingEnd   = AlphaMistingEnd;
            this.AlphaSaturation   = AlphaSaturation;
            this.AlphaCutout       = AlphaCutout;
            this.Color             = Color;
            this.Reflectivity      = Reflectivity;

            if (TargetSize == null)
            {
                this.TargetSize = new Vector2I(-1, -1);
            }
            else
            {
                this.TargetSize = TargetSize.Value;
            }

            UVOffset = new Vector2(0, 0);
            UVSize   = new Vector2(1, 1);
        }
        public MyTransparentMaterial(
            string Name,
            MyTransparentMaterialTextureType TextureType,
            string Texture,
            float SoftParticleDistanceScale,
            bool CanBeAffectedByOtherLights,
            bool AlphaMistingEnable,
            Vector4 Color,
            bool IgnoreDepth = false,
            bool NeedSort = true,
            bool UseAtlas = false,
            float Emissivity = 0,
            float AlphaMistingStart = 1,
            float AlphaMistingEnd = 4,
            float AlphaSaturation = 1,
            float Reflectivity = 0,
            bool AlphaCutout = false,
            Vector2I? TargetSize = null)
        {
            this.Name = Name;
            this.TextureType = TextureType;
            this.Texture = Texture;
            this.SoftParticleDistanceScale = SoftParticleDistanceScale;
            this.CanBeAffectedByOtherLights = CanBeAffectedByOtherLights;
            this.AlphaMistingEnable = AlphaMistingEnable;
            this.IgnoreDepth = IgnoreDepth;
            this.NeedSort = NeedSort;
            this.UseAtlas = UseAtlas;
            this.Emissivity = Emissivity;
            this.AlphaMistingStart = AlphaMistingStart;
            this.AlphaMistingEnd = AlphaMistingEnd;
            this.AlphaSaturation = AlphaSaturation;
            this.AlphaCutout = AlphaCutout;
            this.Color = Color;
            this.Reflectivity = Reflectivity;

            if (TargetSize == null)
                this.TargetSize = new Vector2I(-1, -1);
            else
                this.TargetSize = TargetSize.Value;

            UVOffset = new Vector2(0, 0);
            UVSize = new Vector2(1, 1);
        }