Browse Source

Add Samples.FXAA

Nikos Kastellanos 8 years ago
parent
commit
3e4629911e

+ 7 - 0
Samples.WINDOWS.MG.sln

@@ -25,6 +25,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{584E
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Samples.Animation.WINDOWS.MG", "Samples\Animation\Samples.Animation.WINDOWS.MG.csproj", "{53EA1090-FEE4-4F16-96C2-57DD6B75FA75}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Samples.FXAA.WINDOWS.MG", "Samples\FXAA\Samples.FXAA.WINDOWS.MG.csproj", "{4F224B03-7499-4EE0-A072-7CD7FC266E2A}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -63,6 +65,10 @@ Global
 		{53EA1090-FEE4-4F16-96C2-57DD6B75FA75}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{53EA1090-FEE4-4F16-96C2-57DD6B75FA75}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{53EA1090-FEE4-4F16-96C2-57DD6B75FA75}.Release|Any CPU.Build.0 = Release|Any CPU
+		{4F224B03-7499-4EE0-A072-7CD7FC266E2A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{4F224B03-7499-4EE0-A072-7CD7FC266E2A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{4F224B03-7499-4EE0-A072-7CD7FC266E2A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{4F224B03-7499-4EE0-A072-7CD7FC266E2A}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
@@ -74,5 +80,6 @@ Global
 		{D9A47306-DEE0-4410-BC2C-BA8FFCE682A3} = {A921886B-C6F7-4FF8-8668-EC20004C464A}
 		{FBBDE2BA-F9F3-4041-8584-2C912C235E26} = {13D47E11-4A7C-49C8-942E-2543E9C0098A}
 		{53EA1090-FEE4-4F16-96C2-57DD6B75FA75} = {584E505E-859A-4DA8-9235-EE6C61C03479}
+		{4F224B03-7499-4EE0-A072-7CD7FC266E2A} = {584E505E-859A-4DA8-9235-EE6C61C03479}
 	EndGlobalSection
 EndGlobal

+ 12 - 0
Samples.WINDOWS.XNA.sln

@@ -21,6 +21,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Samples.Animation.WINDOWS.X
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Samples.AnimationContent", "Samples\AnimationContent\Samples.AnimationContent.contentproj", "{B02966BF-88BC-41B2-80EF-8F8C5F98FA98}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Samples.FXAA.WINDOWS.XNA", "Samples\FXAA\Samples.FXAA.WINDOWS.XNA.csproj", "{E48F0BAF-BA9B-418B-9B35-8EF212E56C62}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Samples.FXAAContent", "Samples\FXAAContent\Samples.FXAAContent.contentproj", "{578BBDBD-874B-4738-B956-93AAADD67D60}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|x86 = Debug|x86
@@ -53,6 +57,12 @@ Global
 		{8C971E86-ACD6-45E6-A4C2-7E0C556152FE}.Release|x86.Build.0 = Release|x86
 		{B02966BF-88BC-41B2-80EF-8F8C5F98FA98}.Debug|x86.ActiveCfg = Debug|x86
 		{B02966BF-88BC-41B2-80EF-8F8C5F98FA98}.Release|x86.ActiveCfg = Release|x86
+		{578BBDBD-874B-4738-B956-93AAADD67D60}.Debug|x86.ActiveCfg = Debug|x86
+		{578BBDBD-874B-4738-B956-93AAADD67D60}.Release|x86.ActiveCfg = Release|x86
+		{E48F0BAF-BA9B-418B-9B35-8EF212E56C62}.Debug|x86.ActiveCfg = Debug|x86
+		{E48F0BAF-BA9B-418B-9B35-8EF212E56C62}.Debug|x86.Build.0 = Debug|x86
+		{E48F0BAF-BA9B-418B-9B35-8EF212E56C62}.Release|x86.ActiveCfg = Release|x86
+		{E48F0BAF-BA9B-418B-9B35-8EF212E56C62}.Release|x86.Build.0 = Release|x86
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
@@ -63,5 +73,7 @@ Global
 		{89E0198E-7298-411A-B5C1-61F2754A3F80} = {EFC7A27C-C20B-4BE7-8B3A-2B109991D704}
 		{8C971E86-ACD6-45E6-A4C2-7E0C556152FE} = {45FFB286-52CE-4EB7-8ACE-8B6FBD18D616}
 		{B02966BF-88BC-41B2-80EF-8F8C5F98FA98} = {45FFB286-52CE-4EB7-8ACE-8B6FBD18D616}
+		{578BBDBD-874B-4738-B956-93AAADD67D60} = {45FFB286-52CE-4EB7-8ACE-8B6FBD18D616}
+		{E48F0BAF-BA9B-418B-9B35-8EF212E56C62} = {45FFB286-52CE-4EB7-8ACE-8B6FBD18D616}
 	EndGlobalSection
 EndGlobal

+ 139 - 0
Samples/FXAA/AntiAliasing.cs

@@ -0,0 +1,139 @@
+using System;
+using tainicom.Aether.Shaders;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
+
+namespace Samples.FXAA
+{
+    public class AntiAliasing
+    {
+        GraphicsDevice _graphicsDevice;
+        SpriteBatch _spriteBatch;
+        RenderTarget2D _renderTarget;
+
+        internal FXAAEffect fxaaGreenLumaLowEffect;
+        #if(WINDOWS || W8_1 || W10)
+        internal FXAAEffect fxaaGreenLumaMediumEffect;
+        internal FXAAEffect fxaaGreenLumaHighEffect;
+        #endif
+
+        public AntiAliasing(GraphicsDevice graphicsDevice)
+        {
+            _graphicsDevice = graphicsDevice;
+            _spriteBatch = new SpriteBatch(_graphicsDevice);
+
+            CreateEffect();
+
+            ResizeRenderTarget(_graphicsDevice.Viewport);
+        }
+
+        private void CreateEffect()
+        {
+            Viewport viewport = _graphicsDevice.Viewport;
+            
+            try // try to create a 9_3 shader.
+            {
+                fxaaGreenLumaLowEffect = new FXAAGreenLumaLowEffect(_graphicsDevice);
+                SetEffectParameters(fxaaGreenLumaLowEffect, 0.5f, viewport);
+            }
+            catch (Exception ex1) { }
+
+			#if(WINDOWS || W8_1 || W10)
+            try
+            {
+                if (_graphicsDevice.GraphicsProfile >= GraphicsProfile.HiDef)          
+                {
+                    fxaaGreenLumaMediumEffect = new FXAAGreenLumaMediumEffect(_graphicsDevice);
+                    fxaaGreenLumaHighEffect = new FXAAGreenLumaHighEffect(_graphicsDevice);
+                    SetEffectParameters(fxaaGreenLumaMediumEffect, 0.5f, viewport);
+                    SetEffectParameters(fxaaGreenLumaHighEffect, 0.5f, viewport);
+                }
+            }
+            catch(Exception ex2) {}
+			#endif
+
+            return;
+        }
+
+        private void SetEffectParameters(FXAAEffect effect, float N, Viewport viewport)
+        {
+            effect.SetDefaultParameters(viewport.Width, viewport.Height);
+            effect.AntialiasingEnabled = true;
+        }
+
+        private void ResizeRenderTarget(Viewport viewport)
+        {
+            int maxWidth = viewport.Width;
+            int maxHeight = viewport.Height;
+            int maxTexDim = (_graphicsDevice.GraphicsProfile>=GraphicsProfile.HiDef) ? 4096 : 2048;
+            maxWidth = Math.Min(maxTexDim, maxWidth);
+            maxHeight = Math.Min(maxTexDim, maxHeight);
+
+            if (_renderTarget != null)
+            {
+                if (_renderTarget.Width == maxWidth && _renderTarget.Height == maxHeight) return;
+                if (!_renderTarget.IsDisposed) _renderTarget.Dispose();
+                _renderTarget = null;
+            }
+            if (_renderTarget == null)
+            {
+                _renderTarget = new RenderTarget2D(_graphicsDevice, maxWidth, maxHeight,
+                    false, SurfaceFormat.Color, DepthFormat.Depth24Stencil8);
+
+                if (fxaaGreenLumaLowEffect!= null)
+                {
+                    fxaaGreenLumaLowEffect.SetDefaultParameters(maxWidth, maxHeight);
+                }
+                if (_graphicsDevice.GraphicsProfile >= GraphicsProfile.HiDef)
+                {
+                    fxaaGreenLumaMediumEffect.SetDefaultParameters(maxWidth, maxHeight);
+                    fxaaGreenLumaHighEffect.SetDefaultParameters(maxWidth, maxHeight);
+                }
+            }
+            return;
+        }
+
+        public void SetRenderTarget(Viewport viewport, Color color)
+        {
+            ResizeRenderTarget(viewport);
+            _graphicsDevice.SetRenderTarget(_renderTarget);
+            _graphicsDevice.Clear(color);
+
+            int width = viewport.Width;
+            int height = viewport.Height;
+            int maxTexDim = (_graphicsDevice.GraphicsProfile >= GraphicsProfile.HiDef) ? 4096 : 2048;
+            int maxWidth = Math.Min(maxTexDim, width);
+            int maxHeight = Math.Min(maxTexDim, height);
+            _graphicsDevice.Viewport = new Viewport(0, 0, width, height);
+        }
+
+        public void DrawRenderTarget(int antiAliasingLevel, Viewport viewport, bool clearRenderTarget)
+        {
+            FXAAEffect fxaaEffect = fxaaGreenLumaLowEffect;
+            #if(WINDOWS || W8_1 || W10)
+            if (antiAliasingLevel == 1) fxaaEffect = fxaaGreenLumaLowEffect;
+            if (antiAliasingLevel == 2) fxaaEffect = fxaaGreenLumaMediumEffect;
+            if (antiAliasingLevel == 3) fxaaEffect = fxaaGreenLumaHighEffect;
+            #endif
+            fxaaEffect.AntialiasingEnabled = (antiAliasingLevel != 0);
+
+            if(clearRenderTarget)
+                _graphicsDevice.SetRenderTarget(null);
+
+            Rectangle srcRect;
+            srcRect = new Rectangle(0, 0, (int)(_renderTarget.Width), (int)(_renderTarget.Height));
+            
+            Viewport oldViewport = _graphicsDevice.Viewport;
+            _graphicsDevice.Viewport = viewport;
+
+            Rectangle destRect = new Rectangle(0, 0, viewport.Width, viewport.Height);
+            fxaaEffect.CurrentTechnique.Passes[0].Apply();
+            _spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Opaque, SamplerState.LinearClamp, null, null, fxaaEffect);
+            _spriteBatch.Draw(_renderTarget, destRect, srcRect, Color.White);
+            _spriteBatch.End();
+
+            _graphicsDevice.Viewport = oldViewport;
+        }
+
+    }
+}

BIN
Samples/FXAA/Game.ico


+ 119 - 0
Samples/FXAA/Game1.cs

@@ -0,0 +1,119 @@
+#region File Description
+//-----------------------------------------------------------------------------
+// SplitScreenGame.cs
+//
+// Microsoft XNA Community Game Platform
+// Copyright (C) Microsoft Corporation. All rights reserved.
+//-----------------------------------------------------------------------------
+#endregion
+
+#region Using Statements
+using System;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
+using Microsoft.Xna.Framework.Input;
+#endregion
+
+namespace Samples.FXAA
+{
+    public class Game1 : Microsoft.Xna.Framework.Game
+    {
+        GraphicsDeviceManager graphics;
+        SpriteBatch spriteBatch;
+        SpriteFont font;
+
+        KeyboardState previousKeyboardState;
+
+        bool useFXAA = true;
+        bool rotate = true;
+        
+        Vector3 cameraPosition;
+
+        Matrix world;
+        Matrix projection;
+        Matrix view;
+
+        Spaceship spaceship;
+        Vector3 spaceshipPos = Vector3.Zero;
+        float time = 0;
+        
+        AntiAliasing _antiAliasing;
+
+        public Game1()
+        {
+            graphics = new GraphicsDeviceManager(this);
+            Content.RootDirectory = "Content";
+
+            graphics.GraphicsProfile = GraphicsProfile.HiDef;
+
+#if WINDOWS_PHONE
+            graphics.IsFullScreen = true;
+            TargetElapsedTime = TimeSpan.FromTicks(333333);
+#endif
+        }
+
+        protected override void LoadContent()
+        {
+            // Create and load our tank
+            spaceship = new Spaceship();
+            spaceship.Load(Content);
+            
+            spriteBatch = new SpriteBatch(GraphicsDevice);
+            font = Content.Load<SpriteFont>("font");
+            
+            projection = Matrix.CreatePerspectiveFieldOfView(
+                MathHelper.PiOver4, GraphicsDevice.Viewport.AspectRatio, 10f, 10000f);
+            
+            _antiAliasing = new AntiAliasing(GraphicsDevice);
+        }
+        
+        /// <param name="gameTime">Provides a snapshot of timing values.</param>
+        protected override void Update(GameTime gameTime)
+        {
+            KeyboardState keyState = Keyboard.GetState();
+            GamePadState gamePadState = GamePad.GetState(PlayerIndex.One);
+
+            if (keyState.IsKeyDown(Keys.Escape) || gamePadState.Buttons.Back == ButtonState.Pressed)
+                Exit();
+
+            if (keyState.IsKeyDown(Keys.F1) && !previousKeyboardState.IsKeyDown(Keys.F1))
+                useFXAA = !useFXAA;
+            if (keyState.IsKeyDown(Keys.F2) && !previousKeyboardState.IsKeyDown(Keys.F2))
+                rotate = !rotate;
+
+            if (rotate)
+                time += (float)gameTime.ElapsedGameTime.TotalSeconds;
+
+            world = Matrix.CreateFromAxisAngle(Vector3.Up, time);
+            cameraPosition = new Vector3(0, 2800f, 2800f);
+            
+            view = Matrix.CreateLookAt(
+                   cameraPosition,
+                   Vector3.Zero,
+                   Vector3.Up);
+
+            previousKeyboardState = keyState;
+            base.Update(gameTime);
+        }
+        
+        protected override void Draw(GameTime gameTime)
+        {
+            GraphicsDevice.BlendState = BlendState.Opaque;
+            GraphicsDevice.DepthStencilState = DepthStencilState.Default;
+
+            _antiAliasing.SetRenderTarget(GraphicsDevice.Viewport, Color.Black);
+            spaceship.Draw(world, view, projection);
+            GraphicsDevice.SetRenderTarget(null);
+
+            _antiAliasing.DrawRenderTarget( (useFXAA ? 3 : 0), GraphicsDevice.Viewport, false);
+
+            spriteBatch.Begin();
+            spriteBatch.DrawString(font, String.Format("[F1] FXAA - ({0})", useFXAA ? "ON" : "OFF"), new Vector2(20, 20), Color.White);
+            spriteBatch.DrawString(font, String.Format("[F2] Rotate - ({0})", rotate ? "ON" : "OFF"), new Vector2(20, 40), Color.White);
+            spriteBatch.End();
+
+            base.Draw(gameTime);
+        }
+        
+    }
+}

BIN
Samples/FXAA/GameThumbnail.png


BIN
Samples/FXAA/Icon.ico


+ 19 - 0
Samples/FXAA/Program.cs

@@ -0,0 +1,19 @@
+using System;
+
+namespace Samples.FXAA
+{
+#if WINDOWS || XBOX || LINUX
+    public static class Program
+    {
+        [STAThread]
+        static void Main(string[] args)
+        {
+            using (Game1 game = new Game1())
+            {
+                game.Run();
+            }
+        }
+    }
+#endif
+}
+

+ 34 - 0
Samples/FXAA/Properties/AssemblyInfo.cs

@@ -0,0 +1,34 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Samples.FXAA")]
+[assembly: AssemblyProduct("Samples.FXAA")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyCopyright("Copyright © Kastellanos Nikolaos 2016")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type. Only Windows
+// assemblies support COM.
+[assembly: ComVisible(false)]
+
+// On Windows, the following GUID is for the ID of the typelib if this
+// project is exposed to COM. On other platforms, it unique identifies the
+// title storage container when deploying this assembly to the device.
+[assembly: Guid("c6cd9013-14d8-476f-95ba-60cc07d3639f")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+[assembly: AssemblyVersion("1.0.0.0")]

+ 83 - 0
Samples/FXAA/Samples.FXAA.WINDOWS.MG.csproj

@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\MonoGame\v3.0\MonoGame.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\MonoGame\v3.0\MonoGame.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
+    <ProductVersion>8.0.30703</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{4F224B03-7499-4EE0-A072-7CD7FC266E2A}</ProjectGuid>
+    <OutputType>WinExe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>Samples.FXAA</RootNamespace>
+    <AssemblyName>Samples.FXAA</AssemblyName>
+    <FileAlignment>512</FileAlignment>
+    <MonoGamePlatform>Windows</MonoGamePlatform>
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+    <TargetFrameworkProfile />
+  </PropertyGroup>
+  <PropertyGroup>
+    <ApplicationIcon>Icon.ico</ApplicationIcon>
+  </PropertyGroup>
+  <PropertyGroup>
+    <ApplicationManifest>app.manifest</ApplicationManifest>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>TRACE;DEBUG;WINDOWS MG</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>true</Prefer32Bit>
+    <UseVSHostingProcess>false</UseVSHostingProcess>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE;WINDOWS MG</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="AntiAliasing.cs" />
+    <Compile Include="Game1.cs" />
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="Spaceship.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <Reference Include="MonoGame.Framework">
+      <HintPath>$(MonoGameInstallDirectory)\MonoGame\v3.0\Assemblies\Windows\MonoGame.Framework.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+  </ItemGroup>
+  <ItemGroup>
+    <Content Include="Icon.ico" />
+  </ItemGroup>
+  <ItemGroup>
+    <MonoGameContentReference Include="..\FXAAContent\Samples.FXAAContent.mgcb">
+      <Link>Content\Content.mgcb</Link>
+    </MonoGameContentReference>
+    <None Include="app.config" />
+    <None Include="app.manifest" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\Shaders\FXAA\Aether.Shaders.FXAA.WINDOWS.MG.csproj">
+      <Project>{fbbde2ba-f9f3-4041-8584-2c912c235e26}</Project>
+      <Name>Aether.Shaders.FXAA.WINDOWS.MG</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <Import Project="$(MSBuildExtensionsPath)\MonoGame\v3.0\MonoGame.Content.Builder.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>

+ 131 - 0
Samples/FXAA/Samples.FXAA.WINDOWS.XNA.csproj

@@ -0,0 +1,131 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <ProjectGuid>{E48F0BAF-BA9B-418B-9B35-8EF212E56C62}</ProjectGuid>
+    <ProjectTypeGuids>{6D335F3A-9D43-41b4-9D22-F6F17C4BE596};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
+    <OutputType>WinExe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>Samples.FXAA</RootNamespace>
+    <AssemblyName>Samples.FXAA</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <TargetFrameworkProfile>Client</TargetFrameworkProfile>
+    <XnaFrameworkVersion>v4.0</XnaFrameworkVersion>
+    <XnaPlatform>Windows</XnaPlatform>
+    <XnaProfile>Reach</XnaProfile>
+    <XnaCrossPlatformGroupID>8DDD2806-88A6-4B7E-8A2D-B6957BC81F2E</XnaCrossPlatformGroupID>
+    <XnaOutputType>Game</XnaOutputType>
+    <ApplicationIcon>Game.ico</ApplicationIcon>
+    <Thumbnail>GameThumbnail.png</Thumbnail>
+    <PublishUrl>publish\</PublishUrl>
+    <Install>true</Install>
+    <InstallFrom>Disk</InstallFrom>
+    <UpdateEnabled>false</UpdateEnabled>
+    <UpdateMode>Foreground</UpdateMode>
+    <UpdateInterval>7</UpdateInterval>
+    <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+    <UpdatePeriodically>false</UpdatePeriodically>
+    <UpdateRequired>false</UpdateRequired>
+    <MapFileExtensions>true</MapFileExtensions>
+    <ApplicationRevision>0</ApplicationRevision>
+    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+    <IsWebBootstrapper>false</IsWebBootstrapper>
+    <UseApplicationTrust>false</UseApplicationTrust>
+    <BootstrapperEnabled>true</BootstrapperEnabled>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\Windows\XNA\</OutputPath>
+    <DefineConstants>TRACE;DEBUG;WINDOWS XNA</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <NoStdLib>true</NoStdLib>
+    <UseVSHostingProcess>false</UseVSHostingProcess>
+    <PlatformTarget>x86</PlatformTarget>
+    <XnaCompressContent>false</XnaCompressContent>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\Windows\XNA\</OutputPath>
+    <DefineConstants>TRACE;WINDOWS XNA</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <NoStdLib>true</NoStdLib>
+    <UseVSHostingProcess>false</UseVSHostingProcess>
+    <PlatformTarget>x86</PlatformTarget>
+    <XnaCompressContent>true</XnaCompressContent>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="Microsoft.Xna.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" />
+    <Reference Include="Microsoft.Xna.Framework.Game, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" />
+    <Reference Include="Microsoft.Xna.Framework.Graphics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" />
+    <Reference Include="mscorlib" />
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="AntiAliasing.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="Program.cs" />
+    <Compile Include="Game1.cs" />
+    <Compile Include="Spaceship.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <Content Include="Game.ico" />
+    <Content Include="GameThumbnail.png">
+      <XnaPlatformSpecific>true</XnaPlatformSpecific>
+    </Content>
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\Shaders\FXAA\Aether.Shaders.FXAA.WINDOWS.XNA.csproj">
+      <Project>{89E0198E-7298-411A-B5C1-61F2754A3F80}</Project>
+      <Name>Aether.Shaders.FXAA.WINDOWS.XNA</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\FXAAContent\Samples.FXAAContent.contentproj">
+      <Project>{578BBDBD-874B-4738-B956-93AAADD67D60}</Project>
+      <Name>Samples.FXAAContent %28Content%29</Name>
+      <XnaReferenceType>Content</XnaReferenceType>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <BootstrapperPackage Include=".NETFramework,Version=v4.0,Profile=Client">
+      <Visible>False</Visible>
+      <ProductName>Microsoft .NET Framework 4 Client Profile %28x86 and x64%29</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
+      <Install>false</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1</ProductName>
+      <Install>false</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
+      <Visible>False</Visible>
+      <ProductName>Windows Installer 3.1</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Xna.Framework.4.0">
+      <Visible>False</Visible>
+      <ProductName>Microsoft XNA Framework Redistributable 4.0</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+  </ItemGroup>
+  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\Microsoft.Xna.GameStudio.targets" />
+  <!--
+      To modify your build process, add your task inside one of the targets below and uncomment it. 
+      Other similar extension points exist, see Microsoft.Common.targets.
+      <Target Name="BeforeBuild">
+      </Target>
+      <Target Name="AfterBuild">
+      </Target>
+    -->
+</Project>

+ 34 - 0
Samples/FXAA/Spaceship.cs

@@ -0,0 +1,34 @@
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Content;
+using Microsoft.Xna.Framework.Graphics;
+
+namespace Samples.FXAA
+{
+    public class Spaceship
+    {
+        Model model;
+            
+        public void Load(ContentManager content)
+        {
+            model = content.Load<Model>("spaceship");
+        }
+        
+        public void Draw(Matrix world, Matrix view, Matrix projection)
+        {
+            foreach (ModelMesh mesh in model.Meshes)
+            {
+                foreach (BasicEffect effect in mesh.Effects)
+                {
+                    effect.World = world;
+                    effect.View = view;
+                    effect.Projection = projection;
+                    effect.EnableDefaultLighting();
+
+                    effect.DiffuseColor = new Vector3(0.6f);
+                    effect.EmissiveColor = new Vector3(0.6f);
+                }
+                mesh.Draw();
+            }
+        }
+    }
+}

+ 3 - 0
Samples/FXAA/app.config

@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup></configuration>

+ 42 - 0
Samples/FXAA/app.manifest

@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
+  <assemblyIdentity version="1.0.0.0" name="Graphics"/>
+  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
+    <security>
+      <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
+        <requestedExecutionLevel  level="asInvoker" uiAccess="false" />
+      </requestedPrivileges>
+    </security>
+  </trustInfo>
+
+  <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
+    <application>
+      <!-- A list of the Windows versions that this application has been tested on and is
+           is designed to work with. Uncomment the appropriate elements and Windows will 
+           automatically selected the most compatible environment. -->
+
+      <!-- Windows Vista -->
+      <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />
+
+      <!-- Windows 7 -->
+      <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />
+
+      <!-- Windows 8 -->
+      <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />
+
+      <!-- Windows 8.1 -->
+      <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />
+
+      <!-- Windows 10 -->
+      <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
+
+    </application>
+  </compatibility>
+
+  <application xmlns="urn:schemas-microsoft-com:asm.v3">
+    <windowsSettings>
+      <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/pm</dpiAware>
+    </windowsSettings>
+  </application>
+
+</assembly>

+ 66 - 0
Samples/FXAAContent/Samples.FXAAContent.contentproj

@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <ProjectGuid>{578BBDBD-874B-4738-B956-93AAADD67D60}</ProjectGuid>
+    <ProjectTypeGuids>{96E2B04D-8817-42c6-938A-82C39BA4D311};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <XnaFrameworkVersion>v4.0</XnaFrameworkVersion>
+    <OutputPath>bin\$(Platform)\$(Configuration)</OutputPath>
+    <ContentRootDirectory>Content</ContentRootDirectory>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
+    <PlatformTarget>x86</PlatformTarget>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
+    <PlatformTarget>x86</PlatformTarget>
+  </PropertyGroup>
+  <PropertyGroup>
+    <RootNamespace>Samples.FXAAContent</RootNamespace>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="Microsoft.Xna.Framework.Content.Pipeline.EffectImporter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=MSIL">
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="Microsoft.Xna.Framework.Content.Pipeline.FBXImporter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=MSIL">
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="Microsoft.Xna.Framework.Content.Pipeline.TextureImporter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=MSIL">
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="Microsoft.Xna.Framework.Content.Pipeline.XImporter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=MSIL">
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="Microsoft.Xna.Framework.Content.Pipeline.AudioImporters, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=MSIL">
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="Microsoft.Xna.Framework.Content.Pipeline.VideoImporters, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=MSIL">
+      <Private>False</Private>
+    </Reference>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="font.spritefont">
+      <Name>font</Name>
+      <Importer>FontDescriptionImporter</Importer>
+      <Processor>FontDescriptionProcessor</Processor>
+    </Compile>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="spaceship.fbx">
+      <Name>spaceship</Name>
+      <Importer>FbxImporter</Importer>
+      <Processor>ModelProcessor</Processor>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" />
+  <!--  To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>

+ 41 - 0
Samples/FXAAContent/Samples.FXAAContent.mgcb

@@ -0,0 +1,41 @@
+
+#----------------------------- Global Properties ----------------------------#
+
+/outputDir:bin/$(Platform)
+/intermediateDir:obj/$(Platform)
+/platform:Windows
+/config:
+/profile:Reach
+/compress:False
+
+#-------------------------------- References --------------------------------#
+
+
+#---------------------------------- Content ---------------------------------#
+
+#begin font.spritefont
+/importer:FontDescriptionImporter
+/processor:FontDescriptionProcessor
+/processorParam:PremultiplyAlpha=True
+/processorParam:TextureFormat=Compressed
+/build:font.spritefont
+
+#begin spaceship.fbx
+/importer:FbxImporter
+/processor:ModelProcessor
+/processorParam:ColorKeyColor=0,0,0,0
+/processorParam:ColorKeyEnabled=True
+/processorParam:DefaultEffect=BasicEffect
+/processorParam:GenerateMipmaps=True
+/processorParam:GenerateTangentFrames=False
+/processorParam:PremultiplyTextureAlpha=True
+/processorParam:PremultiplyVertexColors=True
+/processorParam:ResizeTexturesToPowerOfTwo=False
+/processorParam:RotationX=0
+/processorParam:RotationY=0
+/processorParam:RotationZ=0
+/processorParam:Scale=1
+/processorParam:SwapWindingOrder=False
+/processorParam:TextureFormat=Compressed
+/build:spaceship.fbx
+

BIN
Samples/FXAAContent/enemy.tga


+ 60 - 0
Samples/FXAAContent/font.spritefont

@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+This file contains an xml description of a font, and will be read by the XNA
+Framework Content Pipeline. Follow the comments to customize the appearance
+of the font in your game, and to change the characters which are available to draw
+with.
+-->
+<XnaContent xmlns:Graphics="Microsoft.Xna.Framework.Content.Pipeline.Graphics">
+  <Asset Type="Graphics:FontDescription">
+
+    <!--
+    Modify this string to change the font that will be imported.
+    -->
+    <FontName>Segoe UI Mono</FontName>
+
+    <!--
+    Size is a float value, measured in points. Modify this value to change
+    the size of the font.
+    -->
+    <Size>14</Size>
+
+    <!--
+    Spacing is a float value, measured in pixels. Modify this value to change
+    the amount of spacing in between characters.
+    -->
+    <Spacing>0</Spacing>
+
+    <!--
+    UseKerning controls the layout of the font. If this value is true, kerning information
+    will be used when placing characters.
+    -->
+    <UseKerning>true</UseKerning>
+
+    <!--
+    Style controls the style of the font. Valid entries are "Regular", "Bold", "Italic",
+    and "Bold, Italic", and are case sensitive.
+    -->
+    <Style>Regular</Style>
+
+    <!--
+    If you uncomment this line, the default character will be substituted if you draw
+    or measure text that contains characters which were not included in the font.
+    -->
+    <!-- <DefaultCharacter>*</DefaultCharacter> -->
+
+    <!--
+    CharacterRegions control what letters are available in the font. Every
+    character from Start to End will be built and made available for drawing. The
+    default range is from 32, (ASCII space), to 126, ('~'), covering the basic Latin
+    character set. The characters are ordered according to the Unicode standard.
+    See the documentation for more information.
+    -->
+    <CharacterRegions>
+      <CharacterRegion>
+        <Start>&#32;</Start>
+        <End>&#126;</End>
+      </CharacterRegion>
+    </CharacterRegions>
+  </Asset>
+</XnaContent>

File diff suppressed because it is too large
+ 285 - 0
Samples/FXAAContent/spaceship.fbx


Some files were not shown because too many files changed in this diff