Example #1
0
 public override void UpdateEffect(Effect effect, Microsoft.Xna.Framework.Matrix world, Microsoft.Xna.Framework.Matrix worldViewProj,
                                   LightAmbient amb, LightDirectional[] dirs, List <LightPoint> points, Texture dSM, TextureCube point0SM, Microsoft.Xna.Framework.Vector3 eyeVector,
                                   BoundingFrustumExtended frustum, Microsoft.Xna.Framework.Matrix[] bones, Microsoft.Xna.Framework.GameTime gameTime)
 {
     if (epCubeMap1 != null)
     {
         epCubeMap1.SetValue(CubeMap1);
     }
     if (epCubeMap2 != null)
     {
         epCubeMap2.SetValue(CubeMap2);
     }
     if (epCubeMap3 != null)
     {
         epCubeMap3.SetValue(CubeMap3);
     }
     if (epProbes != null)
     {
         epProbes.SetValue(Probes);
     }
     base.UpdateEffect(effect, world, worldViewProj, amb, dirs, points, dSM, point0SM, eyeVector, frustum, bones, gameTime);
 }
Example #2
0
        public override void UpdateEffect(Effect effect, Matrix world, Matrix worldViewProj, LightAmbient amb, LightDirectional[] dirs, List <LightPoint> points,
                                          Texture dSM, TextureCube point0SM, Vector3 eyeVector, BoundingFrustumExtended frustum,
                                          Matrix[] bones, GameTime gameTime)
        {
            if (epMirrorMap != null)
            {
                epMirrorMap.SetValue(ResourceManager.Instance.Textures["DefaultDiffuse"]);
            }
            if (!isRendering && TrashSoupGame.Instance.ActualRenderTarget == TrashSoupGame.Instance.DefaultRenderTarget && effect == null)
            {
                isRendering = true;

                TrashSoupGame.Instance.ActualRenderTarget = MirrorRenderTarget;

                SetupCamera(world);
                //tempCamera = ResourceManager.Instance.CurrentScene.Cam;
                //ResourceManager.Instance.CurrentScene.Cam = myCamera;

                bool currentShadows = ResourceManager.Instance.CurrentScene.Params.Shadows;
                ResourceManager.Instance.CurrentScene.Params.Shadows = false;

                ResourceManager.Instance.CurrentScene.DrawAll(myCamera, effect, TrashSoupGame.Instance.TempGameTime, false);

                ResourceManager.Instance.CurrentScene.Params.Shadows = currentShadows;

                //ResourceManager.Instance.CurrentScene.Cam = tempCamera;

                TrashSoupGame.Instance.ActualRenderTarget = TrashSoupGame.Instance.DefaultRenderTarget;
                isRendering    = false;
                this.MirrorMap = MirrorRenderTarget;

                if (epMirrorMap != null)
                {
                    epMirrorMap.SetValue(this.MirrorMap);
                }
            }

            base.UpdateEffect(effect, world, worldViewProj, amb, dirs, points, dSM, point0SM, eyeVector, frustum, bones, gameTime);
        }
        public void ReadXml(System.Xml.XmlReader reader)
        {
            reader.MoveToContent();
            reader.ReadStartElement();

            ResourceManager.Instance.CurrentScene.ObjectsDictionary = new Dictionary <uint, GameObject>();
            ResourceManager.Instance.CurrentScene.PointLights       = new List <LightPoint>();
            DirectionalLights = new LightDirectional[ResourceManager.DIRECTIONAL_MAX_LIGHTS];

            if (reader.Name == "SceneParams")
            {
                Params = new SceneParams(0, "null");
                (Params as IXmlSerializable).ReadXml(reader);
            }

            if (reader.Name == "AmbientLight")
            {
                AmbientLight = new LightAmbient(0, "null");
                (AmbientLight as IXmlSerializable).ReadXml(reader);
            }

            int ctr = 0;

            reader.ReadStartElement("DirectionalLights");
            while (reader.NodeType != System.Xml.XmlNodeType.EndElement)
            {
                if (reader.Name == "DirectionalLight")
                {
                    reader.ReadStartElement();
                    if (reader.Name != "null")
                    {
                        LightDirectional obj = new LightDirectional(0, "");
                        (obj as IXmlSerializable).ReadXml(reader);
                        DirectionalLights[ctr] = obj;
                        ++ctr;
                    }
                    else
                    {
                        reader.ReadElementString("null", "");
                        reader.ReadEndElement();
                        ++ctr;
                    }
                }
            }
            reader.ReadEndElement();

            reader.ReadStartElement("PointLights");
            while (reader.NodeType != System.Xml.XmlNodeType.EndElement)
            {
                if (reader.Name == "PointLight")
                {
                    reader.ReadStartElement();
                    LightPoint pl = new LightPoint(0, "");
                    ResourceManager.Instance.CurrentScene.PointLights.Add(pl);
                    (pl as IXmlSerializable).ReadXml(reader);

                    if (pl.CastShadows)
                    {
                        pl.SetupShadowRender();
                    }
                    reader.ReadEndElement();
                }
                else
                {
                    reader.ReadElementString("null", "");
                }
            }
            reader.ReadEndElement();

            reader.ReadStartElement("ObjectsDictionary");
            while (reader.NodeType != System.Xml.XmlNodeType.EndElement)
            {
                if (reader.Name == "GameObject")
                {
                    reader.ReadStartElement();
                    GameObject obj = null;
                    uint       key = (uint)reader.ReadElementContentAsInt("GameObjectKey", "");
                    if (ResourceManager.Instance.CurrentScene.ObjectsDictionary.TryGetValue(key, out obj))
                    {
                        Debug.Log("GameObject successfully loaded - " + obj.Name);
                        GameObject tmp = null;
                        (tmp as IXmlSerializable).ReadXml(reader);
                    }
                    else
                    {
                        obj = new GameObject(0, "");
                        ResourceManager.Instance.CurrentScene.ObjectsDictionary.Add(key, obj);
                        (obj as IXmlSerializable).ReadXml(reader);
                        Debug.Log("New Gameobject successfully loaded - " + obj.Name);
                    }
                }
                reader.ReadEndElement();
            }
            reader.ReadEndElement();

            if (reader.Name == "Camera")
            {
                Cam = new Camera(0, "null", Vector3.Zero, Vector3.Zero, Vector3.Zero, Vector3.Zero, MathHelper.Pi / 3.0f, 1.0f, 0.1f, 2000.0f);
                reader.ReadStartElement();
                (Cam as IXmlSerializable).ReadXml(reader);
            }

            ObjectsDictionary = ResourceManager.Instance.CurrentScene.ObjectsDictionary;
            PointLights       = ResourceManager.Instance.CurrentScene.PointLights;

            reader.ReadEndElement();
        }
Example #4
0
        public void LoadContent(Game game)
        {
            LoadTextures();
            LoadEffects();
            AudioManager.Instance.LoadContent();
            TrashSoupGame.Instance.ReloadSpriteBatch();
            //LoadCues();

            // because it pisses me off - Mav
            //AudioManager.Instance.PlayCue(GetCueFromCueList("Track1")); //default music from tutorial, just to check that everything works xD

            // FOR TETIN
            AddModel("Models/Test/TestBox");
            AddModel("Models/Test/TestCube");
            AddModel("Models/Test/TestTerrain");
            AddModel("Models/Test/TestGuy");
            AddModel("Models/Test/TestSphere");
            AddModel("Models/Test/TestSphere_LOD1");
            AddModel("Models/Test/TestSphere_LOD2");
            AddModel("Models/Test/TestMirror");
            AddModel("Models/Weapons/Signs/StopSign");
            AddModel("Models/Weapons/Stones/brick");
            AddModel("Models/Enviro/Ground/street_cross");
            AddModel("Models/Weapons/Stones/brick_destructible/4");
            AddModel("Models/Test/TestSquarePlane");
            AddModel("Models/Test/TestSquarePlane");
            AddModel("Models/MainCharacter/MainCharacter");

            AddAnimation("Animations/MainCharacter/attack_Hweapon_1");
            AddAnimation("Animations/MainCharacter/attack_Hweapon_2");
            AddAnimation("Animations/MainCharacter/attack_Hweapon_3");
            AddAnimation("Animations/MainCharacter/attack_Hweapon_4");
            AddAnimation("Animations/MainCharacter/attack_Mweapon_1");
            AddAnimation("Animations/MainCharacter/attack_Mweapon_2");
            AddAnimation("Animations/MainCharacter/attack_Mweapon_3");
            AddAnimation("Animations/MainCharacter/attack_Mweapon_4");
            AddAnimation("Animations/MainCharacter/attack_Mweapon_5");
            AddAnimation("Animations/MainCharacter/block_1");
            AddAnimation("Animations/MainCharacter/bow_1");
            AddAnimation("Animations/MainCharacter/boxing_1");
            AddAnimation("Animations/MainCharacter/boxing_2");
            AddAnimation("Animations/MainCharacter/boxing_3");
            AddAnimation("Animations/MainCharacter/boxing_4");
            AddAnimation("Animations/MainCharacter/charge_Hweapon");
            // AddAnimation("Animations/MainCharacter/charge_SMweapon");
            //  AddAnimation("Animations/MainCharacter/custom_kick");
            // AddAnimation("Animations/MainCharacter/custom_slash");
            //  AddAnimation("Animations/MainCharacter/custom_whirl");
            AddAnimation("Animations/MainCharacter/dodge_1");
            AddAnimation("Animations/MainCharacter/dying_1");
            AddAnimation("Animations/MainCharacter/idle_1");
            AddAnimation("Animations/MainCharacter/idle_2");
            AddAnimation("Animations/MainCharacter/idle_Fists");
            AddAnimation("Animations/MainCharacter/idle_Hweapon");
            AddAnimation("Animations/MainCharacter/idle_SMweapon");
            AddAnimation("Animations/MainCharacter/injuries_1");
            AddAnimation("Animations/MainCharacter/injuries_2");
            AddAnimation("Animations/MainCharacter/jump");
            AddAnimation("Animations/MainCharacter/run_2");
            AddAnimation("Animations/MainCharacter/dying_1");
            AddAnimation("Animations/MainCharacter/run_Hweapon");
            // AddAnimation("Animations/MainCharacter/run_SMweapon");
            AddAnimation("Animations/MainCharacter/walk_1");
            AddAnimation("Animations/MainCharacter/walk_Hweapon");
            AddAnimation("Animations/MainCharacter/walki_SMweapon");
            AddAnimation("Animations/Enemies/Rat_attack");
            AddAnimation("Animations/Enemies/Rat_dying");
            AddAnimation("Animations/Enemies/Rat_idle");
            AddAnimation("Animations/Enemies/Rat_run");
            AddAnimation("Animations/Enemies/Rat_walk");
            AddAnimation("Animations/Test/walking_1");
            AddAnimation("Animations/Test/idle_1");
            AddAnimation("Animations/Test/jump_1");
            AddModel("Models/Enviro/Railing/Railing_1");    //Wika i Kasia

            // loading materials
            List <Material> testPlayerMats = new List <Material>();
            Material        testPlayerMat  = new Material("testPlayerMat", LoadEffect(@"Effects\NormalEffect"), LoadTexture(@"Textures\Test\cargo"));

            testPlayerMats.Add(testPlayerMat);
            testPlayerMat.NormalMap      = LoadTexture(@"Textures\Test\cargo_NRM");
            testPlayerMat.Glossiness     = 40.0f;
            testPlayerMat.Transparency   = 1.0f;
            testPlayerMat.RecieveShadows = true;
            if (!this.Materials.ContainsKey(testPlayerMat.Name))
            {
                this.Materials.Add(testPlayerMat.Name, testPlayerMat);
            }

            List <Material> testPlayerMats2 = new List <Material>();
            Material        testPlayerMat2  = new Material("testPlayerMat2", this.Effects[@"Effects\CubeNormalEffect"], LoadTexture(@"Textures\Test\cargo"));

            testPlayerMats2.Add(testPlayerMat2);
            testPlayerMat2.NormalMap         = LoadTexture(@"Textures\Test\cargo_NRM");
            testPlayerMat2.CubeMap           = LoadTextureCube(@"Textures\Skyboxes\Dusk");
            testPlayerMat2.Glossiness        = 40.0f;
            testPlayerMat2.ReflectivityColor = new Vector3(1.0f, 0.0f, 1.0f);
            testPlayerMat2.ReflectivityBias  = 0.7f;
            testPlayerMat2.Transparency      = 0.25f;
            testPlayerMat2.RecieveShadows    = true;
            if (!this.Materials.ContainsKey(testPlayerMat2.Name))
            {
                this.Materials.Add(testPlayerMat2.Name, testPlayerMat2);
            }

            List <Material> testMirrorMats = new List <Material>();
            Material        testMirrorMat2 = new MirrorMaterial("testMirrorMat2", this.Effects[@"Effects\NormalEffect"]);

            testMirrorMats.Add(testMirrorMat2);
            testMirrorMat2.DiffuseMap       = LoadTexture(@"Textures\Home\Furnitures\mirror_D");
            testMirrorMat2.NormalMap        = LoadTexture(@"Textures\Home\Furnitures\mirror_N");
            testMirrorMat2.Glossiness       = 100.0f;
            testMirrorMat2.ReflectivityBias = 0.0f;
            if (!this.Materials.ContainsKey(testMirrorMat2.Name))
            {
                this.Materials.Add(testMirrorMat2.Name, testMirrorMat2);
            }
            Material testMirrorMat = new MirrorMaterial("testMirrorMat", this.Effects[@"Effects\MirrorEffect"]);

            testMirrorMats.Add(testMirrorMat);
            testMirrorMat.DiffuseMap       = LoadTexture(@"Textures\Home\Furnitures\mirror_glass");
            testMirrorMat.Glossiness       = 100.0f;
            testMirrorMat.ReflectivityBias = 0.0f;
            if (!this.Materials.ContainsKey(testMirrorMat.Name))
            {
                this.Materials.Add(testMirrorMat.Name, testMirrorMat);
            }

            List <Material> testWaterMats = new List <Material>();
            Material        testWaterMat  = new WaterMaterial("testWaterMat", this.Effects[@"Effects\WaterEffect"]);

            testWaterMats.Add(testWaterMat);
            testWaterMat.DiffuseMap       = LoadTexture(@"Textures\Test\dirtywater");
            testWaterMat.NormalMap        = LoadTexture(@"Textures\Test\water");
            testWaterMat.Glossiness       = 200.0f;
            testWaterMat.ReflectivityBias = 0.6f;
            if (!this.Materials.ContainsKey(testWaterMat.Name))
            {
                this.Materials.Add(testWaterMat.Name, testWaterMat);
            }

            //List<Material> playerMats = LoadBasicMaterialsFromModel(Models["Models/MainCharacter/MainCharacter"], this.Effects[@"Effects\NormalEffect"]);
            //foreach(Material mat in playerMats)
            //{
            //    mat.RecieveShadows = true;
            //}

            //List<Material> ratMats = LoadBasicMaterialsFromModel(Models["Models/MainCharacter/MainCharacter"], this.Effects[@"Effects\NormalEffect"]);
            List <Material> ratMats  = new List <Material>();
            Material        ratMat01 = new Material("PlayerMat", this.Effects[@"Effects\NormalEffect"]);

            ratMat01.DiffuseMap = LoadTexture(@"Models\Enemies\Mutant_body_D");
            ratMat01.NormalMap  = LoadTexture(@"Models\Enemies\Mutant_body_N");
            ratMats.Add(ratMat01);
            Material ratMat02 = new Material("PlayerMatHair", this.Effects[@"Effects\NormalEffect"]);

            ratMat02.DiffuseMap = LoadTexture(@"Models\Enemies\Mutant_head_D");
            ratMat02.NormalMap  = LoadTexture(@"Models\Enemies\Mutant_head_N");
            ratMats.Add(ratMat02);

            List <Material> deSign = LoadBasicMaterialsFromModel(Models["Models/Enviro/Ground/street_cross"], this.Effects[@"Effects\NormalEffect"]);

            List <Material> bb = LoadBasicMaterialsFromModel(Models["Models/Weapons/Stones/brick"], Effects[@"Effects\NormalEffect"]);

            List <Material> testTerMats = new List <Material>();
            Material        testTerMat  = new Material("testTerMat", this.Effects[@"Effects\NormalEffect"], LoadTexture(@"Textures\Test\metal01_d"));

            testTerMat.NormalMap      = LoadTexture(@"Textures\Test\water");
            testTerMat.SpecularColor  = new Vector3(0.1f, 0.1f, 0.0f);
            testTerMat.Glossiness     = 10.0f;
            testTerMat.RecieveShadows = true;
            testTerMat.Unlit          = true;
            if (!this.Materials.ContainsKey(testTerMat.Name))
            {
                this.Materials.Add(testTerMat.Name, testTerMat);
            }
            if (!testTerMats.Contains(testTerMat))
            {
                testTerMats.Add(testTerMat);
            }

            List <Material> testSBMats = new List <Material>();
            SkyboxMaterial  testSBMat  = new SkyboxMaterial("testSBMat", this.Effects[@"Effects\SkyboxEffect"]);

            testSBMat.CubeMap       = LoadTextureCube(@"Textures\Skyboxes\Dawn");
            testSBMat.CubeMap1      = LoadTextureCube(@"Textures\Skyboxes\Daylight");
            testSBMat.CubeMap2      = LoadTextureCube(@"Textures\Skyboxes\Dusk");
            testSBMat.CubeMap3      = LoadTextureCube(@"Textures\Skyboxes\Night");
            testSBMat.Probes        = new Vector4(0.0f, 0.0f, 0.0f, 1.0f);
            testSBMat.SpecularColor = new Vector3(0.0f, 0.0f, 0.0f);
            testSBMat.Glossiness    = 100.0f;
            if (!this.Materials.ContainsKey(testSBMat.Name))
            {
                this.Materials.Add(testSBMat.Name, testSBMat);
            }
            if (!testSBMats.Contains(testSBMat))
            {
                testSBMats.Add(testSBMat);
            }


            //WIKA I KASIA Testowanie modeli
            List <Material> awsomeTestMats = new List <Material>();
            Material        awsomeTestMat  = new Material("awsomeTestMat", this.Effects[@"Effects\NormalEffect"], LoadTexture(@"Textures\Enviro\Railing\Railing_D"));

            awsomeTestMats.Add(awsomeTestMat);
            awsomeTestMats.Add(awsomeTestMat);
            awsomeTestMat.NormalMap         = LoadTexture(@"Textures\Enviro\Railing\Railing_N");
            awsomeTestMat.Glossiness        = 40.0f;
            awsomeTestMat.ReflectivityColor = new Vector3(1.0f, 0.0f, 1.0f);
            awsomeTestMat.ReflectivityBias  = 0.0f;
            awsomeTestMat.Transparency      = 1.0f;
            awsomeTestMat.RecieveShadows    = true;
            if (!this.Materials.ContainsKey(awsomeTestMat.Name))
            {
                this.Materials.Add(awsomeTestMat.Name, awsomeTestMat);
            }


            // loading gameobjects
            GameObject testBox = new GameObject(1, "Player");

            testBox.MyTransform = new Transform(testBox, new Vector3(2.0f, 3.0f, -5.0f), new Vector3(0.0f, 0.0f, 1.0f), new Vector3(0.0f, 0.0f, 0.0f), 0.0075f);
            CustomModel skModel        = new CustomModel(testBox, new Model[] { Models["Models/MainCharacter/MainCharacter"], null, null }, ratMats);
            Animator    playerAnimator = new Animator(testBox, skModel.LODs[0]);

            playerAnimator.AddAnimationClip(LoadAnimationFromModel(skModel.LODs[0], LoadAnimation("Animations/MainCharacter/run_2"), "Animations/MainCharacter/run_2"));
            playerAnimator.AddAnimationClip(LoadAnimationFromModel(skModel.LODs[0], LoadAnimation("Animations/MainCharacter/idle_Hweapon"), "Animations/MainCharacter/idle_Hweapon"));
            playerAnimator.AddAnimationClip(LoadAnimationFromModel(skModel.LODs[0], LoadAnimation("Animations/MainCharacter/idle_Fists"), "Animations/MainCharacter/idle_Fists"));
            playerAnimator.AddAnimationClip(LoadAnimationFromModel(skModel.LODs[0], LoadAnimation("Animations/MainCharacter/idle_SMweapon"), "Animations/MainCharacter/idle_SMweapon"));
            playerAnimator.AddAnimationClip(LoadAnimationFromModel(skModel.LODs[0], LoadAnimation("Animations/MainCharacter/dodge_1"), "Animations/MainCharacter/dodge_1"));
            playerAnimator.AddAnimationClip(LoadAnimationFromModel(skModel.LODs[0], LoadAnimation("Animations/MainCharacter/boxing_4"), "Animations/MainCharacter/boxing_4"));
            playerAnimator.AddAnimationClip(LoadAnimationFromModel(skModel.LODs[0], LoadAnimation("Animations/MainCharacter/boxing_1"), "Animations/MainCharacter/boxing_1"));
            playerAnimator.AddAnimationClip(LoadAnimationFromModel(skModel.LODs[0], LoadAnimation("Animations/MainCharacter/boxing_2"), "Animations/MainCharacter/boxing_2"));
            playerAnimator.AddAnimationClip(LoadAnimationFromModel(skModel.LODs[0], LoadAnimation("Animations/MainCharacter/boxing_3"), "Animations/MainCharacter/boxing_3"));
            playerAnimator.AddAnimationClip(LoadAnimationFromModel(skModel.LODs[0], LoadAnimation("Animations/MainCharacter/attack_Hweapon_1"), "Animations/MainCharacter/attack_Hweapon_1"));
            playerAnimator.AddAnimationClip(LoadAnimationFromModel(skModel.LODs[0], LoadAnimation("Animations/MainCharacter/attack_Hweapon_2"), "Animations/MainCharacter/attack_Hweapon_2"));
            playerAnimator.AddAnimationClip(LoadAnimationFromModel(skModel.LODs[0], LoadAnimation("Animations/MainCharacter/attack_Hweapon_3"), "Animations/MainCharacter/attack_Hweapon_3"));
            playerAnimator.AddAnimationClip(LoadAnimationFromModel(skModel.LODs[0], LoadAnimation("Animations/MainCharacter/attack_Hweapon_4"), "Animations/MainCharacter/attack_Hweapon_4"));
            playerAnimator.AddAnimationClip(LoadAnimationFromModel(skModel.LODs[0], LoadAnimation("Animations/MainCharacter/attack_Mweapon_1"), "Animations/MainCharacter/attack_Mweapon_1"));
            playerAnimator.AddAnimationClip(LoadAnimationFromModel(skModel.LODs[0], LoadAnimation("Animations/MainCharacter/attack_Mweapon_2"), "Animations/MainCharacter/attack_Mweapon_2"));
            playerAnimator.AddAnimationClip(LoadAnimationFromModel(skModel.LODs[0], LoadAnimation("Animations/MainCharacter/attack_Mweapon_3"), "Animations/MainCharacter/attack_Mweapon_3"));
            playerAnimator.AddAnimationClip(LoadAnimationFromModel(skModel.LODs[0], LoadAnimation("Animations/MainCharacter/attack_Mweapon_4"), "Animations/MainCharacter/attack_Mweapon_4"));
            playerAnimator.AddAnimationClip(LoadAnimationFromModel(skModel.LODs[0], LoadAnimation("Animations/MainCharacter/attack_Mweapon_5"), "Animations/MainCharacter/attack_Mweapon_5"));
            playerAnimator.AddAnimationClip(LoadAnimationFromModel(skModel.LODs[0], LoadAnimation("Animations/MainCharacter/building"), "Animations/MainCharacter/building"));
            playerAnimator.AddAnimationClip(LoadAnimationFromModel(skModel.LODs[0], LoadAnimation("Animations/MainCharacter/dying_1"), "Animations/MainCharacter/dying_1"));
            playerAnimator.AddAnimationClip(LoadAnimationFromModel(skModel.LODs[0], LoadAnimation("Animations/MainCharacter/block_1"), "Animations/MainCharacter/block_1"));
            playerAnimator.AddAnimationClip(LoadAnimationFromModel(skModel.LODs[0], LoadAnimation("Animations/MainCharacter/grzebanie"), "Animations/MainCharacter/grzebanie"));
            testBox.Components.Add(skModel);
            testBox.MyAnimator = playerAnimator;
            PlayerController pc = new PlayerController(testBox);

            testBox.Components.Add(pc);
            testBox.Dynamic = true;

            HideoutStash testStash = new HideoutStash(testBox);

            testStash.CurrentTrash = 1000;
            testBox.Components.Add(testStash);

            Equipment eq = new Equipment(testBox);

            eq.JunkCount = 10;
            testBox.Components.Add(eq);

            testBox.MyPhysicalObject = new PhysicalObject(testBox, 1.0f, 0.05f, false);
            testBox.MyCollider       = new BoxCollider(testBox); //Add a box collider to test collisions

            // loading gameobjects
            GameObject rat = new GameObject(50, "Rat");

            rat.MyTransform = new Transform(rat, new Vector3(0.0f, 0.0f, 10.0f), new Vector3(0.0f, 0.0f, 1.0f), new Vector3(0.0f, 0.0f, 0.0f), 0.01f);
            CustomModel ratModel = new CustomModel(rat, new Model[] { LoadModel("Models/Enemies/Mutant01"), null, null }, ratMats);

            rat.Components.Add(ratModel);
            Animator ratAnimator = new Animator(rat, ratModel.LODs[0]);

            ratAnimator.AddAnimationClip(LoadAnimationFromModel(ratModel.LODs[0], LoadAnimation("Animations/Enemies/Mutant_attack"), "Rat_TAnim"));
            ratAnimator.AvailableStates.Add("Walk", new AnimatorState("Walk", ratAnimator.GetAnimationPlayer("Rat_TAnim"), AnimatorState.StateType.SINGLE));
            ratAnimator.CurrentState = ratAnimator.AvailableStates["Walk"];
            rat.MyAnimator           = ratAnimator;
            rat.Components.Add(new Enemy(rat));
            rat.MyCollider       = new SphereCollider(rat);
            rat.MyPhysicalObject = new PhysicalObject(rat);

            rat.Components.Add(new Food(rat));

            GameObject testTer = new GameObject(2, "Terrain");

            testTer.MyTransform = new Transform(testTer, new Vector3(0.0f, 0.0f, 0.0f), new Vector3(0.0f, 0.0f, 1.0f), new Vector3(0.0f, 0.0f, 0.0f), 1.0f);
            CustomModel terModel = new CustomModel(testTer, new Model[] { Models["Models/Test/TestTerrain"], null, null }, testTerMats);

            terModel.LodControlled = false;
            testTer.Components.Add(terModel);

            GameObject testBox2 = new GameObject(3, "StreettestBox2");

            testBox2.MyTransform = new Transform(testBox2, new Vector3(0.0f, -0.1f, 112.0f), new Vector3(0.0f, 0.0f, 1.0f), new Vector3(0.0f, 0.0f, 0.0f), 10.0f);
            testBox2.Components.Add(new CustomModel(testBox2, new Model[] { LoadModel("Models/Enviro/Ground/street_straight"), null, null }, testPlayerMats));
            //Billboard billboard = new Billboard(testBox2);
            //Material bbmat = new Material("billboard", Effects[@"Effects\BillboardEffect"], LoadTexture(@"Textures\Enviro\Nature\Sun"));
            //billboard.Mat = bbmat;
            //billboard.Size = new Vector2(1.0f, 1.0f);
            //testBox2.Components.Add(billboard);
            testBox2.MyCollider       = new BoxCollider(testBox2, false);
            testBox2.MyPhysicalObject = new PhysicalObject(testBox2, 1.0f, 1.0f, false);
            //testBox2.Dynamic = true;
            //testBox2.MyCarrierSocket = new Socket(testBox, testBox2, null, "mixamorig:RightHand");

            GameObject testBox3 = new GameObject(5, "testBox3");

            testBox3.MyTransform = new Transform(testBox3, new Vector3(0.0f, 0.0f, 0.0f), new Vector3(0.0f, 0.0f, 1.0f), new Vector3(0.0f, 0.0f, 0.0f), 0.7f);
            testBox3.Components.Add(new CustomModel(testBox3, new Model[] { LoadModel("Models/Weapons/Maczuga/Mace"), null, null }, testPlayerMats));
            testBox3.MyCollider = new BoxCollider(testBox3, true);
            testBox3.Dynamic    = true;
            testBox3.Components.Add(new Gameplay.Weapons.Hammer(testBox3));

            GameObject fuckYou = new GameObject(1144, "Fists");

            fuckYou.MyTransform = new Transform(fuckYou, Vector3.Zero, Vector3.Up, new Vector3(0.0f, 0.0f, 11.017704f), 1.0f);
            fuckYou.MyCollider  = new BoxCollider(fuckYou, true);
            fuckYou.Components.Add(new Gameplay.Weapons.Fists(fuckYou));

            pc.Equipment.PickUpWeapon(testBox3);

            //ParticleSystem ps = new ParticleSystem(testBox3);
            //ps.Textures.Add(ResourceManager.Instance.LoadTexture("Textures/Particles/Particle_metal01"));
            //ps.Textures.Add(ResourceManager.Instance.LoadTexture("Textures/Particles/Particle_metal02"));
            //ps.Textures.Add(ResourceManager.Instance.LoadTexture("Textures/Particles/Particle_wood01"));
            //ps.Textures.Add(ResourceManager.Instance.LoadTexture("Textures/Particles/Particle_wood02"));
            //ps.Textures.Add(ResourceManager.Instance.LoadTexture("Textures/Particles/Particle_wood03"));
            //ps.ParticleCount = 170;
            //ps.ParticleSize = new Vector2(0.5f, 0.5f);
            //ps.LifespanSec = 5.0f;
            //ps.Wind = new Vector3(0.0f, 0.1f, 0.0f);
            //ps.FadeInTime = 0.0f;
            //ps.Offset = new Vector3(MathHelper.PiOver2);
            //ps.Speed = 10.0f;
            ////ps.DelayMs = 5000.0f;
            //ps.LoopMode = ParticleSystem.ParticleLoopMode.CONTINUOUS;
            //ps.PositionOffset = new Vector3(0.0f, 0.0f, 0.0f) * testBox3.MyTransform.Scale;
            //testBox3.Components.Add(ps);

            GameObject testMirror = new GameObject(6, "testMirror");

            testMirror.MyTransform = new Transform(testMirror, new Vector3(-10.0f, 2.0f, -10.0f), new Vector3(0.0f, 0.0f, 1.0f), new Vector3(0.0f, -MathHelper.PiOver2, 0.0f), 0.5f);
            testMirror.Components.Add(new CustomModel(testMirror, new Model[] { LoadModel("Models/Home/Furnitures/mirror"), null, null }, testMirrorMats));
            testMirror.MyCollider = new BoxCollider(testMirror, false);

            GameObject testWater = new GameObject(7, "tesWtater");

            testWater.MyTransform = new Transform(testWater, new Vector3(0.0f, -1.5f, 0.0f), new Vector3(0.0f, 1.0f, 0.0f), new Vector3(0.0f, 0.0f, 0.0f), 10.0f);
            testWater.Components.Add(new CustomModel(testWater, new Model[] { Models["Models/Test/TestSquarePlane"], null, null }, testWaterMats));

            GameObject skyBox = new GameObject(4, "skyBox");

            skyBox.MyTransform = new Transform(skyBox, new Vector3(0.0f, 0.0f, 0.0f), new Vector3(0.0f, 1.0f, 0.0f), new Vector3(0.0f, 0.0f, 0.0f), 2000.0f);
            CustomModel sbModel = new CustomModel(skyBox, new Model[] { Models["Models/Test/TestCube"], null, null }, testSBMats);

            sbModel.LodControlled = false;
            skyBox.Components.Add(sbModel);
            //DaytimeChange dc = new DaytimeChange(skyBox);
            //dc.LightDayID = 0;
            //dc.LightNightID = 1;
            //dc.SunID = 3;
            //dc.SunriseMinutes = 60 * 6;
            //dc.SunsetMinutes = 60 * 20;
            //dc.StateChangeMinutes = 120;
            //dc.HorizonOffset = 500.0f;
            //dc.TextureNames = new string[] { @"Textures\Skyboxes\Dawn", @"Textures\Skyboxes\Daylight", @"Textures\Skyboxes\Dusk", @"Textures\Skyboxes\Night" };
            //skyBox.Components.Add(dc);

            // moje na pagi
            GameObject cegla = new GameObject(14, "cegla");

            cegla.MyTransform = new Transform(cegla, new Vector3(5.0f, 0.0f, 0.0f), new Vector3(0.0f, 0.0f, 1.0f), new Vector3(0.0f, 0.0f, 0.0f), 1.0f);
            //cegla.Components.Add(new CustomModel(cegla, new Model[] { Models["Models/Weapons/Stones/brick"], null, null }, bb));
            //cegla.MyCollider = new BoxCollider(cegla);
            Fortification fort = new Fortification(cegla);

            fort.CurrentID = 0;
            fort.MyType    = Fortification.FortificationType.WOOD1_WIRE_SNARES;
            cegla.Components.Add(fort);
            //GameObject pt = new GameObject(355, "PlayerTime");
            //PlayerTime ptc = new PlayerTime(pt);
            //ptc.Multiplier = 3600;
            //pt.Components.Add(ptc);

            //Wika i Kasia testowanie modeli
            GameObject awsomeTest = new GameObject(8, "testground");

            awsomeTest.MyTransform = new Transform(awsomeTest, new Vector3(-12.0f, 1.0f, -5.0f), new Vector3(0.0f, 0.0f, 1.0f), new Vector3(MathHelper.PiOver2, 0.0f, 0.0f), 1.0f);
            awsomeTest.Components.Add(new CustomModel(awsomeTest, new Model[] { Models["Models/Enviro/Railing/Railing_1"], null, null }, awsomeTestMats));
            awsomeTest.MyCollider = new BoxCollider(awsomeTest, false);

            GameObject playerTime = new GameObject(1000, "PlayerTime");
            PlayerTime pt         = new PlayerTime(playerTime);

            pt.InitHours = 20;
            playerTime.Components.Add(pt);

            GameObject     testTransition = new GameObject(501, "Transition");
            AreaTransition at             = new AreaTransition(testTransition);

            at.NextScenePath = "../../../../TrashSoupContent/Scenes/save2.xml";
            testTransition.Components.Add(at);
            testTransition.MyTransform = new Transform(testTransition, new Vector3(-10.0f, 0.0f, 10.0f), Vector3.Up, Vector3.Zero, 5.0f);
            testTransition.MyCollider  = new SphereCollider(testTransition, true);

            // adding lights
            LightAmbient     amb  = new LightAmbient(100, "LightAmbient", new Vector3(0.1f, 0.1f, 0.1f));
            LightDirectional ldr  = new LightDirectional(101, "LightDirectional1", new Vector3(1.0f, 0.9f, 0.8f), new Vector3(1.0f, 0.8f, 0.8f), new Vector3(-1.0f, -1.0f, -1.0f), true);
            LightDirectional ldrn = new LightDirectional(102, "LightDirectional2", new Vector3(0.1f, 0.1f, 0.15f), new Vector3(0.0f, 0.1f, 0.2f), new Vector3(1.0f, 1.0f, 1.0f), true);

            //LightPoint lp1 = new LightPoint(110, "LightPoint1", new Vector3(0.0f, 1.0f, 1.0f), new Vector3(1.0f, 1.0f, 1.0f), 1.0f, false);
            //lp1.MyTransform = new Transform(lp1, new Vector3(0.0f, 1.0f, 0.0f), new Vector3(0.0f, 1.0f, 0.0f), new Vector3(0.0f, 0.0f, 0.0f), 10.0f);
            //lp1.MyCollider = new SphereCollider(lp1, true);
            //lp1.MyPhysicalObject = new PhysicalObject(lp1, 0.0f, 0.0f, false);
            //lp1.SetupShadowRender();


            // loading scene
            CurrentScene = new Scene(new SceneParams(0, "test", new Vector2(0.0f, 0.1f), new DateTime(2015, 5, 28, 12, 0, 0, 0, new System.Globalization.GregorianCalendar(), DateTimeKind.Unspecified),
                                                     60.0f, 3000.0f, 35.0f, 50.0f, true, false, true, false, true));

            Camera cam = null;

            if (TrashSoupGame.Instance.EditorMode)
            {
                //Editor camera
                CurrentScene.EditorCam = new EditorCamera(1, "editorCam", Vector3.Transform(new Vector3(0.0f, 10.0f, -50.0f), Matrix.CreateRotationX(MathHelper.PiOver4 * 1.5f)),
                                                          new Vector3(0.0f, 5.0f, 5.0f), new Vector3(0.0f, 10.0f, 0.0f), new Vector3(0.0f, 1.0f, 0.0f), MathHelper.Pi / 3.0f, 0.1f, 2000.0f);
            }
            //Game camera
            cam = new Camera(1, "playerCam", Vector3.Transform(new Vector3(0.0f, 1.0f, -0.1f), Matrix.CreateRotationX(MathHelper.PiOver4 * 1.5f)) + new Vector3(0.0f, 0.4f, 0.0f),
                             new Vector3(0.0f, 0.0f, 0.0f), new Vector3(0.0f, 1.5f, 0.0f), new Vector3(0.0f, 1.0f, 0.0f), MathHelper.Pi / 3.0f,
                             (float)TrashSoupGame.Instance.Window.ClientBounds.Width / (float)TrashSoupGame.Instance.Window.ClientBounds.Height, 0.1f, 4000.0f);
            cam.Components.Add(new CameraBehaviourComponent(cam, testBox));

            CurrentScene.Cam = cam;

            //testTer.LightsAffecting.Add(lp1);

            // adding items to scene
            //testBox.AddChild(testBox3);
            CurrentScene.AddObject(skyBox);
            CurrentScene.AddObject(testTer);
            CurrentScene.AddObject(testBox);
            CurrentScene.AddObject(testBox2);

            CurrentScene.AddObject(testMirror);
            CurrentScene.AddObject(testWater);
            CurrentScene.AddObject(testBox3);
            CurrentScene.AddObject(awsomeTest);//Wika i kasia
            CurrentScene.AddObject(rat);
            CurrentScene.AddObject(cegla);
            CurrentScene.AddObject(playerTime);
            CurrentScene.AddObject(testTransition);
            //CurrentScene.AddObject(pt);
            CurrentScene.AddObject(fuckYou);
            CurrentScene.AmbientLight         = amb;
            CurrentScene.DirectionalLights[0] = ldr;
            CurrentScene.DirectionalLights[1] = ldrn;
            //CurrentScene.PointLights.Add(lp1);

            foreach (GameObject go in this.CurrentScene.ObjectsDictionary.Values)
            {
                go.Initialize();
            }
        }
        public virtual void UpdateEffect(Effect effect, Matrix world, Matrix worldViewProj, LightAmbient amb, LightDirectional[] dirs, List <LightPoint> points, Texture dSM, TextureCube point0SM,
                                         Vector3 eyeVector, BoundingFrustumExtended frustum, Matrix[] bones, GameTime gameTime)
        {
            if (effect != null && tempEffect == null)
            {
                tempEffect = MyEffect;
                MyEffect   = effect;
                AssignParamsInitialize();
            }

            if (epWorld != null)
            {
                epWorld.SetValue(world);
            }
            if (epWorldInverseTranspose != null)
            {
                epWorldInverseTranspose.SetValue(Matrix.Transpose(Matrix.Invert(world)));
            }
            if (epWorldViewProj != null)
            {
                epWorldViewProj.SetValue(worldViewProj);
            }
            if (epDiffuseMap != null)
            {
                epDiffuseMap.SetValue(DiffuseMap);
            }
            if (epNormalMap != null)
            {
                epNormalMap.SetValue(NormalMap);
            }
            if (epCubeMap != null)
            {
                epCubeMap.SetValue(CubeMap);
            }
            if (epDiffuseColor != null)
            {
                epDiffuseColor.SetValue(diffuseColor);
            }
            if (epSpecularColor != null)
            {
                epSpecularColor.SetValue(specularColor);
            }
            if (epGlossiness != null)
            {
                epGlossiness.SetValue(glossiness);
            }
            if (epReflectivityColor != null)
            {
                epReflectivityColor.SetValue(reflectivityColor);
            }
            if (epReflectivityBias != null)
            {
                epReflectivityBias.SetValue(reflectivityBias);
            }
            if (epTransparency != null)
            {
                epTransparency.SetValue(transparency);
            }
            if (epPerPixelLighting != null)
            {
                epPerPixelLighting.SetValue(perPixelLighting);
            }

            if (epAmbientLightColor != null && amb != null)
            {
                epAmbientLightColor.SetValue(amb.LightColor);
            }

            if (dirs != null)
            {
                if (dirs[0] != null)
                {
                    if (epDirLight0Direction != null)
                    {
                        epDirLight0Direction.SetValue(dirs[0].LightDirection);
                    }
                    if (epDirLight0DiffuseColor != null)
                    {
                        epDirLight0DiffuseColor.SetValue(dirs[0].LightColor);
                    }
                    if (epDirLight0SpecularColor != null)
                    {
                        epDirLight0SpecularColor.SetValue(dirs[0].LightSpecularColor);
                    }
                    if (dirs[0].CastShadows)
                    {
                        if (epDirLight0ShadowMap0 != null && dSM != null)
                        {
                            epDirLight0ShadowMap0.SetValue(dSM);
                        }
                        if (epDirLight0WorldViewProj != null && dirs[0].ShadowDrawCameras[0] != null)
                        {
                            epDirLight0WorldViewProj.SetValue(world * dirs[0].ShadowDrawCameras[0].ViewProjMatrix);
                        }
                        if (epDirLight0WorldViewProj1 != null && dirs[0].ShadowDrawCameras[1] != null)
                        {
                            epDirLight0WorldViewProj1.SetValue(world * dirs[0].ShadowDrawCameras[1].ViewProjMatrix);
                        }
                        if (epDirLight0WorldViewProj2 != null && dirs[0].ShadowDrawCameras[2] != null)
                        {
                            epDirLight0WorldViewProj2.SetValue(world * dirs[0].ShadowDrawCameras[2].ViewProjMatrix);
                        }
                    }
                }

                if (dirs[1] != null)
                {
                    if (epDirLight1Direction != null)
                    {
                        epDirLight1Direction.SetValue(dirs[1].LightDirection);
                    }
                    if (epDirLight1DiffuseColor != null)
                    {
                        epDirLight1DiffuseColor.SetValue(dirs[1].LightColor);
                    }
                    if (epDirLight1SpecularColor != null)
                    {
                        epDirLight1SpecularColor.SetValue(dirs[1].LightSpecularColor);
                    }
                }

                if (dirs[2] != null)
                {
                    if (epDirLight2Direction != null)
                    {
                        epDirLight2Direction.SetValue(dirs[2].LightDirection);
                    }
                    if (epDirLight2DiffuseColor != null)
                    {
                        epDirLight2DiffuseColor.SetValue(dirs[2].LightColor);
                    }
                    if (epDirLight2SpecularColor != null)
                    {
                        epDirLight2SpecularColor.SetValue(dirs[2].LightSpecularColor);
                    }
                }
            }

            if (points != null)
            {
                for (int i = 0; i < ResourceManager.POINT_MAX_LIGHTS_PER_OBJECT; ++i)
                {
                    tempPLColors[i]       = new Vector3(0.0f, 0.0f, 0.0f);
                    tempPLSpeculars[i]    = new Vector3(0.0f, 0.0f, 0.0f);
                    tempPLPositions[i]    = new Vector3(0.0f, 0.0f, 0.0f);
                    tempPLAttenuations[i] = 0.00000001f;
                }

                int pCount = points.Count;
                if (epSSA != null)
                {
                    epSSA.SetValue(1.0f);
                }

                for (int i = 0; i < pCount && i < ResourceManager.POINT_MAX_LIGHTS_PER_OBJECT; ++i)
                {
                    if (points[i].CastShadows && epSSA != null)
                    {
                        epSSA.SetValue(0.0f);
                    }

                    tempPLColors[i]       = points[i].LightColor;
                    tempPLSpeculars[i]    = points[i].LightSpecularColor;
                    tempPLPositions[i]    = points[i].MyTransform.PositionGlobal;
                    tempPLAttenuations[i] = points[i].Attenuation;
                }

                if (epPointLightDiffuseColors != null)
                {
                    epPointLightDiffuseColors.SetValue(tempPLColors);
                }
                if (epPointLightSpecularColors != null)
                {
                    epPointLightSpecularColors.SetValue(tempPLSpeculars);
                }
                if (epPointLightPositions != null)
                {
                    epPointLightPositions.SetValue(tempPLPositions);
                }
                if (epPointLightAttenuations != null)
                {
                    epPointLightAttenuations.SetValue(tempPLAttenuations);
                }
                if (epPointLightCount != null)
                {
                    epPointLightCount.SetValue(points.Count);
                }
                if (epPoint0ShadowMap != null && point0SM != null)
                {
                    epPoint0ShadowMap.SetValue(point0SM);
                }
            }

            if (epEyePosition != null)
            {
                epEyePosition.SetValue(eyeVector);
            }

            // bounding frustum
            tempFrustumArray[0].W = -frustum.Top.D + BoundingFrustumExtended.CLIP_MARGIN;
            tempFrustumArray[0].X = -frustum.Top.Normal.X;
            tempFrustumArray[0].Y = -frustum.Top.Normal.Y;
            tempFrustumArray[0].Z = -frustum.Top.Normal.Z;

            tempFrustumArray[1].W = -frustum.Bottom.D + BoundingFrustumExtended.CLIP_MARGIN;
            tempFrustumArray[1].X = -frustum.Bottom.Normal.X;
            tempFrustumArray[1].Y = -frustum.Bottom.Normal.Y;
            tempFrustumArray[1].Z = -frustum.Bottom.Normal.Z;

            tempFrustumArray[2].W = -frustum.Left.D + BoundingFrustumExtended.CLIP_MARGIN;
            tempFrustumArray[2].X = -frustum.Left.Normal.X;
            tempFrustumArray[2].Y = -frustum.Left.Normal.Y;
            tempFrustumArray[2].Z = -frustum.Left.Normal.Z;

            tempFrustumArray[3].W = -frustum.Right.D + BoundingFrustumExtended.CLIP_MARGIN;
            tempFrustumArray[3].X = -frustum.Right.Normal.X;
            tempFrustumArray[3].Y = -frustum.Right.Normal.Y;
            tempFrustumArray[3].Z = -frustum.Right.Normal.Z;

            if (epBoundingFrustum != null)
            {
                epBoundingFrustum.SetValue(tempFrustumArray);
            }

            additionalClipPlane.W = -frustum.AdditionalClip.D;
            additionalClipPlane.X = -frustum.AdditionalClip.Normal.X;
            additionalClipPlane.Y = -frustum.AdditionalClip.Normal.Y;
            additionalClipPlane.Z = -frustum.AdditionalClip.Normal.Z;

            if (epCustomClippingPlane != null)
            {
                epCustomClippingPlane.SetValue(additionalClipPlane);
            }

            if (epBones != null && bones != null)
            {
                epBones.SetValue(bones);
                this.MyEffect.CurrentTechnique = etSkinned;
            }

            // setting up techniques

            bool shadows     = ResourceManager.Instance.CurrentScene.Params.Shadows;
            bool softShadows = ResourceManager.Instance.CurrentScene.Params.SoftShadows;

            if (tempBEref == null && tempSEref == null)
            {
                bool forShadows = ((dirs != null && dirs[0] != null && dirs[0].CastShadows) || (point0SM != null)) && RecieveShadows && shadows;

                if ((Unlit || TrashSoupGame.Instance.EditorMode) && etUnlit != null)
                {
                    MyEffect.CurrentTechnique = etUnlit;
                }
                else if (bones != null && forShadows && etSkinnedBlurredShadows != null && softShadows)
                {
                    MyEffect.CurrentTechnique = etSkinnedBlurredShadows;
                }
                else if (bones == null && forShadows && etMainBlurredShadows != null && softShadows)
                {
                    MyEffect.CurrentTechnique = etMainBlurredShadows;
                }
                else if (bones != null && forShadows && etSkinnedShadows != null)
                {
                    MyEffect.CurrentTechnique = etSkinnedShadows;
                }
                else if (bones == null && forShadows && etMainShadows != null)
                {
                    MyEffect.CurrentTechnique = etMainShadows;
                }
                else if (bones != null && etSkinned != null)
                {
                    MyEffect.CurrentTechnique = etSkinned;
                }
                else
                {
                    MyEffect.CurrentTechnique = etMain;
                }
            }

            //////////////////////

            //////////////////////

            if (tempBEref != null)
            {
                // do shit for basicEffect
                tempBEref.PreferPerPixelLighting = perPixelLighting;
            }
            if (tempSEref != null)
            {
                // do shit for skinnedEffect
                tempSEref.PreferPerPixelLighting = perPixelLighting;
            }
        }
Example #6
0
        public override void UpdateEffect(Effect effect, Matrix world, Matrix worldViewProj, LightAmbient amb, LightDirectional[] dirs, List <LightPoint> points,
                                          Texture dSM, TextureCube point0SM, Vector3 eyeVector, BoundingFrustumExtended frustum,
                                          Matrix[] bones, GameTime gameTime)
        {
            if (effect != null)
            {
                base.UpdateEffect(null, new Matrix(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f),
                                  new Matrix(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f),
                                  null, null, null, null, null, Vector3.Zero, new BoundingFrustumExtended(Matrix.Identity), null, null);

                return;
            }

            if (!isRendering && TrashSoupGame.Instance.ActualRenderTarget == TrashSoupGame.Instance.DefaultRenderTarget && effect == null)
            {
                isRendering = true;

                DrawRefractionMap(effect, world);

                DrawReflectionMap(effect, world);

                if (!TrashSoupGame.Instance.EditorMode)
                {
                    tempWind += ResourceManager.Instance.CurrentScene.Params.Wind * (float)gameTime.ElapsedGameTime.TotalMilliseconds / 1000.0f;
                }

                if (epWindVector != null)
                {
                    epWindVector.SetValue(tempWind);
                }

                isRendering = false;
            }

            base.UpdateEffect(effect, world, worldViewProj, amb, dirs, points, dSM, point0SM, eyeVector, frustum, bones, gameTime);
        }