Ejemplo n.º 1
0
        public override void DoRedo()
        {
            if (Undo.Current.EditMenu.State != Editing.EditStates.LightingStat)
            {
                Undo.Current.EditMenu.ButtonFunction("Lighting");
            }

            LightingInfo LightMenu = Undo.Current.EditMenu.Categorys[3].GetComponent <LightingInfo>();

            LightMenu.IgnoreUpdate = true;

            LightMenu.RA.SetValue(RA);
            LightMenu.DA.SetValue(DA);
            LightMenu.LightMultipiler.SetValue(SunMultipiler);

            LightMenu.LightColor.SetColorField(SunColor.x, SunColor.y, SunColor.z);
            LightMenu.AmbienceColor.SetColorField(AmbientColor.x, AmbientColor.y, AmbientColor.z);
            LightMenu.ShadowColor.SetColorField(ShadowColor.x, ShadowColor.y, ShadowColor.z);
            LightMenu.Specular.SetColorField(Specular.x, Specular.y, Specular.z, Specular.w);

            LightMenu.FogColor.SetColorField(Fog.x, Fog.y, Fog.z, Fog.w);
            LightMenu.FogStart.SetValue(FogStart);
            LightMenu.FogEnd.SetValue(FogEnd);
            LightMenu.Bloom.SetValue(Bloom);

            LightMenu.IgnoreUpdate = false;

            LightMenu.UndoUpdate();
        }
Ejemplo n.º 2
0
        private void InitRenderables()
        {
            {
                ShaderInfo.Material fragMaterial;
                fragMaterial.Emissive  = new Color(0, 0, 0, 255);
                fragMaterial.Diffuse   = new Color(100, 150, 100, 255);
                fragMaterial.Specular  = new Color(255, 255, 255, 255);
                fragMaterial.Shininess = 0.8f;
                LightingInfo fragLighting = new LightingInfo("FragNadeNormal", fragMaterial);
                Renderable   fragNade     = new Renderable(null, "FragNade", "FragNade", new Vector2(7.5f), new Vector2(0), new Vector2(1), 16, 16, 0, 0, 0.1f);
                fragNade.Drawable.AddAnimation(0, 0, 1, 1, Animation.OnEnd.Loop, 0);
                fragNade.Drawable.AddAnimation(32, 0, 1, 1, Animation.OnEnd.Loop, 0);
                fragNade.Drawable.ShaderInfo = fragLighting;

                Renderables.Add("FragNade", fragNade);
            }
            {
                ShaderInfo.Material smallRoundMaterial;
                smallRoundMaterial.Emissive  = new Color(0, 0, 0, 255);
                smallRoundMaterial.Diffuse   = new Color(150, 150, 100, 255);
                smallRoundMaterial.Specular  = new Color(255, 255, 255, 255);
                smallRoundMaterial.Shininess = 0.9f;
                LightingInfo smallRoundLighting = new LightingInfo("SmallRoundNormal", smallRoundMaterial);
                Renderable   smallRound         = new Renderable(null, "SmallRound", "SmallRound", new Vector2(8f), new Vector2(0), new Vector2(1), 16, 16, 0, 0, 0.1f);
                smallRound.Drawable.AddAnimation(0, 0, 1, 1, Animation.OnEnd.Loop, 0);
                smallRound.Drawable.AddAnimation(32, 0, 1, 1, Animation.OnEnd.Loop, 0);
                smallRound.Drawable.ShaderInfo = smallRoundLighting;

                Renderables.Add("SmallRound", smallRound);
            }
            {
                ShaderInfo.Material turretMaterial;
                turretMaterial.Emissive  = new Color(0, 0, 0, 255);
                turretMaterial.Diffuse   = new Color(150, 150, 100, 255);
                turretMaterial.Specular  = new Color(255, 255, 255, 255);
                turretMaterial.Shininess = 0.9f;
                LightingInfo turretLighting = new LightingInfo("TurretNormal", turretMaterial);
                Renderable   turretBase     = new Renderable(null, "TurretBase", "Turret", new Vector2(16f), new Vector2(0), new Vector2(1), 32, 32, 0, 0, 0.9f);
                turretBase.Drawable.AddAnimation(0, 0, 1, 1, Animation.OnEnd.Loop, 0);
                turretBase.Drawable.AddAnimation(32, 0, 1, 1, Animation.OnEnd.Loop, 0);
                turretBase.Drawable.ShaderInfo = turretLighting;

                Renderables.Add("TurretBase", turretBase);
            }
            {
                ShaderInfo.Material tempMaterial;
                tempMaterial.Emissive  = new Color(0, 0, 0, 255);
                tempMaterial.Diffuse   = new Color(150, 150, 100, 255);
                tempMaterial.Specular  = new Color(255, 255, 255, 255);
                tempMaterial.Shininess = 0.9f;
                LightingInfo tempLighting = new LightingInfo("FogSpriteNormal", tempMaterial);
                Renderable   temp         = new Renderable(null, "Fog", "FogSprite", new Vector2(7.5f), new Vector2(0), new Vector2(100), 16, 16, 0, 0, 0.9f);
                temp.Drawable.AddAnimation(0, 0, 1, 1, Animation.OnEnd.Loop, 0);
                temp.Drawable.AddAnimation(32, 0, 1, 1, Animation.OnEnd.Loop, 0);
                temp.Drawable.ShaderInfo = tempLighting;

                Renderables.Add("Temp", temp);
            }
        }
Ejemplo n.º 3
0
        private void RecordGlobalLighting(int i)
        {
            DirLight light = ActiveDirLight;

            if (light != null)
            {
                m_globalLightInfos[i] = new LightingInfo(light);
            }
        }
Ejemplo n.º 4
0
 public DrawingKit(Matrix viewMatrix, Matrix projectionMatrix,
                   Vector3 viewerPosition, GraphicsDevice graphicsDevice, LightingInfo lightingInfo)
 {
     this.ViewMatrix       = viewMatrix;
     this.ProjectionMatrix = projectionMatrix;
     this.ViewerPosition   = viewerPosition;
     this.GraphicsDevice   = graphicsDevice;
     this.LightingInfo     = lightingInfo;
 }
Ejemplo n.º 5
0
        public override void Register(HistoryParameter Param)
        {
            LightingInfo LightMenu = Undo.Current.EditMenu.Categorys[3].GetComponent <LightingInfo>();

            RA            = LightMenu.RA.value;
            DA            = LightMenu.DA.value;
            SunMultipiler = LightMenu.LightMultipiler.value;

            SunColor     = LightMenu.LightColor.GetVectorValue();
            AmbientColor = LightMenu.AmbienceColor.GetVectorValue();
            ShadowColor  = LightMenu.ShadowColor.GetVectorValue();
            Specular     = LightMenu.Specular.GetVector4Value();
        }
Ejemplo n.º 6
0
        private void RecordSelectedLight(int i)
        {
            object lastSelected = SelectionContext.LastSelected;
            var    domNode      = lastSelected.As <DomNode>();

            if (domNode == null)
            {
                var path = lastSelected as AdaptablePath <object>;
                if (path != null)
                {
                    domNode = path.Last.As <DomNode>();
                }
            }
            if (domNode != null)
            {
                m_selectedLightInfos[i] = LightingInfo.TryCreate(domNode);
            }
        }
Ejemplo n.º 7
0
 public void SetLightingInfo(LightingInfo lightingInfo)
 {
     _drawingKit.LightingInfo = lightingInfo;
 }
Ejemplo n.º 8
0
 private void RecordGlobalLighting(int i)
 {
     DirLight light = ActiveDirLight;
     if (light != null)
         m_globalLightInfos[i] = new LightingInfo(light);
 }
Ejemplo n.º 9
0
 public Scene()
 {
     _drawableObjects = new List <IDrawable>();
     _cameraManager   = new CameraManager();
     _lightingInfo    = new LightingInfo();
 }
Ejemplo n.º 10
0
        private void InitWeapons()
        {
            {
                ShaderInfo.Material fragMaterial;
                fragMaterial.Emissive  = new Color(0, 0, 0, 255);
                fragMaterial.Diffuse   = new Color(74, 74, 74, 255);
                fragMaterial.Specular  = new Color(255, 255, 255, 255);
                fragMaterial.Shininess = 0.9f;

                LightingInfo lightingInfo = new LightingInfo("fragNadeNormal", fragMaterial);
                Weapon       fragGrenade  = new Weapon(null, "FragGrenade", "FragNade", new Vector2(0.5f, 0), new Vector2(0.5f, 0), new Vector2(0), true);
                fragGrenade.Position                  = new Vector2(0, 0.5f);
                fragGrenade.WeaponDrawable            = new Drawable("fragNade", new Vector2(4), 8, 8, 0, 0, 0.2f);
                fragGrenade.WeaponDrawable.ShaderInfo = lightingInfo;
                fragGrenade.Tags.Add("MotionFlip");
                Attack fragImpactAttack = new Attack(Attack.DamageType.Kinetic, new List <StatusEffect>(), 10.0f);
                Attack fragAreaAttack   = new Attack(Attack.DamageType.Kinetic, new List <StatusEffect>(), 40.0f);
                fragGrenade.InitialiseAttack(fragImpactAttack, fragAreaAttack, 0.5f, 0.3f, 5.0f, 0.0f, 0.05f, 0.6f, 2.0, false, true);
                Weapons.Add("FragGrenade", fragGrenade);
            }
            {
                Sound firingSound = new Sound();
                firingSound.AddSoundEffect("PistolShot");
                //firingSound.AddSoundEffect("PistolShot2");
                //firingSound.AddSoundEffect("PistolShot3");
                //firingSound.AddSoundEffect("PistolShot4");
                //firingSound.AddSoundEffect("PistolShot5");

                ShaderInfo.Material pistolMaterial;
                pistolMaterial.Emissive  = new Color(0, 0, 0, 255);
                pistolMaterial.Diffuse   = new Color(74, 74, 74, 255);
                pistolMaterial.Specular  = new Color(255, 255, 255, 255);
                pistolMaterial.Shininess = 0.9f;

                LightingInfo lightingInfo = new LightingInfo("PistolNormal", pistolMaterial);
                Weapon       pistol       = new Weapon(null, "Pistol", "SmallRound", new Vector2(36 / 32f, 1.5f / 32f), new Vector2(1.0f, 0f), new Vector2(-9.5f / 32f, -4.5f / 32f), true);
                pistol.Position                  = new Vector2(0f, 0.8f);
                pistol.WeaponDrawable            = new Drawable("Pistol", new Vector2(16, 16), 32, 32, 0, 0, 0.1f);
                pistol.WeaponDrawable.ShaderInfo = lightingInfo;
                pistol.FireEmitters.Add(new Emitter(null, Emitters["PistolFlash"]));
                pistol.Tags.Add("MotionFlip");
                Attack pistolImpactAttack = new Attack(Attack.DamageType.Kinetic, new List <StatusEffect>(), 10.0f);
                Attack pistolAreaAttack   = new Attack(Attack.DamageType.Kinetic, new List <StatusEffect>(), 40.0f);
                pistol.InitialiseAttack(pistolImpactAttack, pistolAreaAttack, 0.2f, 20.0f, 5.0f, 0.0f, 0.05f, 0.0f, 2.0, true, true);
                pistol.AddSound(firingSound);
                Weapons.Add("Pistol", pistol);
            }
            {
                Sound firingSound = new Sound();
                firingSound.AddSoundEffect("PistolShot");
                firingSound.AddSoundEffect("PistolShot2");
                firingSound.AddSoundEffect("PistolShot3");
                firingSound.AddSoundEffect("PistolShot4");
                firingSound.AddSoundEffect("PistolShot5");

                ShaderInfo.Material turretMaterial;
                turretMaterial.Emissive  = new Color(0, 0, 0, 255);
                turretMaterial.Diffuse   = new Color(74, 74, 74, 255);
                turretMaterial.Specular  = new Color(255, 255, 255, 255);
                turretMaterial.Shininess = 0.9f;

                LightingInfo lightingInfo = new LightingInfo("TurretNormal", turretMaterial);
                Weapon       turretBase   = new Weapon(null, "TurretBase", "SmallRound", new Vector2(12 / 32f, 0.5f / 32f), new Vector2(6.5f / 32f, 0 / 32f), new Vector2(0f / 32f, -8.5f / 32f), true);
                turretBase.Position                  = new Vector2(0f / 32f, 8.5f / 32f);
                turretBase.WeaponDrawable            = new Drawable("Turret", new Vector2(16, 16), 32, 32, 0, 32, 0.1f);
                turretBase.WeaponDrawable.ShaderInfo = lightingInfo;
                turretBase.FireEmitters.Add(new Emitter(null, Emitters["PistolFlash"]));
                turretBase.Tags.Add("MotionFlip");
                Attack pistolImpactAttack = new Attack(Attack.DamageType.Kinetic, new List <StatusEffect>(), 10.0f);
                Attack pistolAreaAttack   = new Attack(Attack.DamageType.Kinetic, new List <StatusEffect>(), 40.0f);
                turretBase.InitialiseAttack(pistolImpactAttack, pistolAreaAttack, 0.5f, 20.0f, 5.0f, 0.0f, 0.05f, 0.0f, 2.0, true, true);
                turretBase.AddSound(firingSound);
                Weapons.Add("TurretBase", turretBase);
            }
        }