/// <summary> /// Reload /// </summary> protected override void GetParameters() { // Can't get parameters if loading failed! if (effect == null) return; windowSize = effect.Parameters["windowSize"]; sceneMap = effect.Parameters["sceneMap"]; // We need both windowSize and sceneMap. if (windowSize == null || sceneMap == null) throw new NotSupportedException("windowSize and sceneMap must be " + "valid in PostScreenShader=" + Filename); // Init additional stuff downsampleMap = effect.Parameters["downsampleMap"]; blurMap1 = effect.Parameters["blurMap1"]; blurMap2 = effect.Parameters["blurMap2"]; radialSceneMap = effect.Parameters["radialSceneMap"]; // Load screen border texture screenBorderFadeoutMap = effect.Parameters["screenBorderFadeoutMap"]; screenBorderFadeoutMapTexture = new Texture("ScreenBorderFadeout.dds"); // Set texture screenBorderFadeoutMap.SetValue( screenBorderFadeoutMapTexture.XnaTexture); radialBlurScaleFactor = effect.Parameters["radialBlurScaleFactor"]; }
/// <summary> /// Test post screen glow on screenshot /// </summary> //[Test] public static void TestPostScreenGlowOnScreenshot() { Texture screenTexture = null; TestGame.Start("TestPostScreenGlow", 1024*2, 768*2, delegate { screenTexture = new Texture("screen03.jpg"); }, delegate { if (Input.Keyboard[Keys.Space] == KeyState.Up) BaseGame.UI.PostScreenGlowShader.Start(); screenTexture.RenderOnScreen(BaseGame.ResolutionRect); SpriteHelper.DrawAllSprites(); if (Input.Keyboard[Keys.Space] == KeyState.Up) BaseGame.UI.PostScreenGlowShader.Show(); }); }
/// <summary> /// Reload /// </summary> protected override void GetParameters() { // Can't get parameters if loading failed! if (effect == null) return; windowSize = effect.Parameters["windowSize"]; sceneMap = effect.Parameters["sceneMap"]; // We need both windowSize and sceneMap. if (windowSize == null || sceneMap == null) throw new NotSupportedException("windowSize and sceneMap must be " + "valid in PostScreenShader=" + Filename); // Init additional stuff downsampleMap = effect.Parameters["downsampleMap"]; blurMap1 = effect.Parameters["blurMap1"]; blurMap2 = effect.Parameters["blurMap2"]; timer = effect.Parameters["Timer"]; // Load noise texture for stripes effect noiseMap = effect.Parameters["noiseMap"]; noiseMapTexture = new Texture("Noise128x128.dds"); // Set texture noiseMap.SetValue(noiseMapTexture.XnaTexture); }