public PostProcessor(GraphicsDevice graphicsDevice) { if (spriteBatch == null) spriteBatch = new SpriteBatch(graphicsDevice); this.graphicsDevice = graphicsDevice; Input = new RenderCapture(graphicsDevice); }
/// <summary> /// Load and calculate all the necessary content of the game. /// </summary> public override void Load() { base.Load(); // Set the camera CameraManager.AddCamera(CameraManager.DefaultCamera, new TargetCamera(new Vector3(0, 0, 70), new Vector3(0, 0, 0))); CameraManager.SetActiveCamera(CameraManager.DefaultCamera); // Create the post processing elements renderCapture = new RenderCapture(); postProcessor = new GaussianBlur(10);//2f); // Load all needed textures TextureManager.AddTexture(backgroundTexture, new GameTexture("Content/Textures/MenuBackground", true)); TextureManager.AddTexture("DeadBackground", new GameTexture("Content/Textures/DeadBackground", true)); TextureManager.AddTexture("SeparationBar", new GameTexture("Content/Textures/SeparationBar", true)); TextureManager.AddTexture("SelectedMenuEntry", new GameTexture("Content/Textures/SelectedMenuEntry", true)); TextureManager.AddTexture("DummyTexture15T", new GameTexture("Content/Textures/DummyTexture15T", true)); TextureManager.AddTexture("DummyTexture", new GameTexture("Content/Textures/DummyTexture", true)); TextureManager.AddTexture("BarTexture", new GameTexture("Content/Textures/BarTexture", true)); TextureManager.AddTexture("DialogBackground", new GameTexture("Content/Textures/DialogBackground", true)); TextureManager.AddTexture("EasyDifficult", new GameTexture("Content/Textures/EasyDifficult", true)); TextureManager.AddTexture("NormalDifficult", new GameTexture("Content/Textures/NormalDifficult", true)); TextureManager.AddTexture("HardDifficult", new GameTexture("Content/Textures/HardDifficult", true)); TextureManager.AddTexture("LoadingBackground", new GameTexture("Content/Textures/LoadingBackground", true)); // Load all needed sounds SoundManager.AddSound("Menu", new GameSound("Content/Sounds/Menu", true)); SoundManager.GetSound("Menu").Volume = GameSettings.DefaultInstance.MusicVolume; SoundManager.GetSound("Menu").Play(true, true); SoundManager.AddSound("MenuSelect", new GameSound("Content/Sounds/MenuSelect", true)); SoundManager.GetSound("MenuSelect").Volume = GameSettings.DefaultInstance.SoundVolume; SoundManager.AddSound("MenuAccept", new GameSound("Content/Sounds/MenuAccept", true)); SoundManager.GetSound("MenuAccept").Volume = GameSettings.DefaultInstance.SoundVolume; // Load all needed models ModelManager.AddModel(spacecraftModel, new GameModel("Content/Models/Spacecraft", true)); ModelManager.AddModel("AnimatedMonster", new GameModel("Content/Models/AnimatedMonster", true)); _model = new DrawableModel((GameModel)ModelManager.GetModel(spacecraftModel), new Vector3(-10, 20, 0), new Vector3(-45, 120, 0), new Vector3(1.25f, 1.25f, 1.25f), 0); // Fix the animation elements _animationRing1 = new ObjectAnimation(Vector3.Zero, Vector3.Zero, _model.Rotation, _model.Rotation + new Vector3(0, MathHelper.TwoPi, 0), TimeSpan.FromSeconds(1f), true); _animationRing2 = new ObjectAnimation(Vector3.Zero, Vector3.Zero, _model.Rotation + new Vector3(0, MathHelper.Pi, 0), _model.Rotation + new Vector3(0, MathHelper.TwoPi + MathHelper.Pi, 0), TimeSpan.FromSeconds(1f), true); _individualTransformations.Add("polySurface26", Matrix.CreateScale(_animationRing1.Scale) * Matrix.CreateRotationX(_animationRing1.Rotation.X) * Matrix.CreateRotationY(_animationRing1.Rotation.Y) * Matrix.CreateRotationZ(_animationRing1.Rotation.Z) * Matrix.CreateTranslation(_animationRing1.Position)); _individualTransformations.Add("polySurface27", Matrix.CreateScale(_animationRing2.Scale) * Matrix.CreateRotationX(_animationRing2.Rotation.X) * Matrix.CreateRotationY(_animationRing2.Rotation.Y) * Matrix.CreateRotationZ(_animationRing2.Rotation.Z) * Matrix.CreateTranslation(_animationRing2.Position)); }