Browse Source

Add Samples.Deferred

Nikos Kastellanos 8 years ago
parent
commit
e1be31c697

+ 14 - 0
Samples.WINDOWS.MG.sln

@@ -21,12 +21,16 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Aether.Shaders", "Aether.Sh
 EndProject
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aether.Shaders.FXAA.WINDOWS.MG", "Shaders\FXAA\Aether.Shaders.FXAA.WINDOWS.MG.csproj", "{FBBDE2BA-F9F3-4041-8584-2C912C235E26}"
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aether.Shaders.FXAA.WINDOWS.MG", "Shaders\FXAA\Aether.Shaders.FXAA.WINDOWS.MG.csproj", "{FBBDE2BA-F9F3-4041-8584-2C912C235E26}"
 EndProject
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aether.Shaders.Deferred.WINDOWS.MG", "Shaders\Deferred\Aether.Shaders.Deferred.WINDOWS.MG.csproj", "{96105100-20DB-4187-9BCA-0A20AC9F1298}"
+EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{584E505E-859A-4DA8-9235-EE6C61C03479}"
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{584E505E-859A-4DA8-9235-EE6C61C03479}"
 EndProject
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Samples.Animation.WINDOWS.MG", "Samples\Animation\Samples.Animation.WINDOWS.MG.csproj", "{53EA1090-FEE4-4F16-96C2-57DD6B75FA75}"
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Samples.Animation.WINDOWS.MG", "Samples\Animation\Samples.Animation.WINDOWS.MG.csproj", "{53EA1090-FEE4-4F16-96C2-57DD6B75FA75}"
 EndProject
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Samples.FXAA.WINDOWS.MG", "Samples\FXAA\Samples.FXAA.WINDOWS.MG.csproj", "{4F224B03-7499-4EE0-A072-7CD7FC266E2A}"
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Samples.FXAA.WINDOWS.MG", "Samples\FXAA\Samples.FXAA.WINDOWS.MG.csproj", "{4F224B03-7499-4EE0-A072-7CD7FC266E2A}"
 EndProject
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Samples.Deferred.WINDOWS.MG", "Samples\Deferred\Samples.Deferred.WINDOWS.MG.csproj", "{594B1001-B485-499A-A22B-42125763C2CF}"
+EndProject
 Global
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
 		Debug|Any CPU = Debug|Any CPU
@@ -61,6 +65,10 @@ Global
 		{FBBDE2BA-F9F3-4041-8584-2C912C235E26}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{FBBDE2BA-F9F3-4041-8584-2C912C235E26}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{FBBDE2BA-F9F3-4041-8584-2C912C235E26}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{FBBDE2BA-F9F3-4041-8584-2C912C235E26}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{FBBDE2BA-F9F3-4041-8584-2C912C235E26}.Release|Any CPU.Build.0 = Release|Any CPU
 		{FBBDE2BA-F9F3-4041-8584-2C912C235E26}.Release|Any CPU.Build.0 = Release|Any CPU
+		{96105100-20DB-4187-9BCA-0A20AC9F1298}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{96105100-20DB-4187-9BCA-0A20AC9F1298}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{96105100-20DB-4187-9BCA-0A20AC9F1298}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{96105100-20DB-4187-9BCA-0A20AC9F1298}.Release|Any CPU.Build.0 = Release|Any CPU
 		{53EA1090-FEE4-4F16-96C2-57DD6B75FA75}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{53EA1090-FEE4-4F16-96C2-57DD6B75FA75}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{53EA1090-FEE4-4F16-96C2-57DD6B75FA75}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{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.ActiveCfg = Release|Any CPU
@@ -69,6 +77,10 @@ Global
 		{4F224B03-7499-4EE0-A072-7CD7FC266E2A}.Debug|Any CPU.Build.0 = 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.ActiveCfg = Release|Any CPU
 		{4F224B03-7499-4EE0-A072-7CD7FC266E2A}.Release|Any CPU.Build.0 = Release|Any CPU
 		{4F224B03-7499-4EE0-A072-7CD7FC266E2A}.Release|Any CPU.Build.0 = Release|Any CPU
+		{594B1001-B485-499A-A22B-42125763C2CF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{594B1001-B485-499A-A22B-42125763C2CF}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{594B1001-B485-499A-A22B-42125763C2CF}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{594B1001-B485-499A-A22B-42125763C2CF}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
 		HideSolutionNode = FALSE
@@ -79,7 +91,9 @@ Global
 		{400DC7B2-739D-4156-916D-2F2E1920310D} = {A921886B-C6F7-4FF8-8668-EC20004C464A}
 		{400DC7B2-739D-4156-916D-2F2E1920310D} = {A921886B-C6F7-4FF8-8668-EC20004C464A}
 		{D9A47306-DEE0-4410-BC2C-BA8FFCE682A3} = {A921886B-C6F7-4FF8-8668-EC20004C464A}
 		{D9A47306-DEE0-4410-BC2C-BA8FFCE682A3} = {A921886B-C6F7-4FF8-8668-EC20004C464A}
 		{FBBDE2BA-F9F3-4041-8584-2C912C235E26} = {13D47E11-4A7C-49C8-942E-2543E9C0098A}
 		{FBBDE2BA-F9F3-4041-8584-2C912C235E26} = {13D47E11-4A7C-49C8-942E-2543E9C0098A}
+		{96105100-20DB-4187-9BCA-0A20AC9F1298} = {13D47E11-4A7C-49C8-942E-2543E9C0098A}
 		{53EA1090-FEE4-4F16-96C2-57DD6B75FA75} = {584E505E-859A-4DA8-9235-EE6C61C03479}
 		{53EA1090-FEE4-4F16-96C2-57DD6B75FA75} = {584E505E-859A-4DA8-9235-EE6C61C03479}
 		{4F224B03-7499-4EE0-A072-7CD7FC266E2A} = {584E505E-859A-4DA8-9235-EE6C61C03479}
 		{4F224B03-7499-4EE0-A072-7CD7FC266E2A} = {584E505E-859A-4DA8-9235-EE6C61C03479}
+		{594B1001-B485-499A-A22B-42125763C2CF} = {584E505E-859A-4DA8-9235-EE6C61C03479}
 	EndGlobalSection
 	EndGlobalSection
 EndGlobal
 EndGlobal

+ 22 - 3
Samples.WINDOWS.XNA.sln

@@ -15,6 +15,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Aether.Shaders", "Aether.Sh
 EndProject
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aether.Shaders.FXAA.WINDOWS.XNA", "Shaders\FXAA\Aether.Shaders.FXAA.WINDOWS.XNA.csproj", "{89E0198E-7298-411A-B5C1-61F2754A3F80}"
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aether.Shaders.FXAA.WINDOWS.XNA", "Shaders\FXAA\Aether.Shaders.FXAA.WINDOWS.XNA.csproj", "{89E0198E-7298-411A-B5C1-61F2754A3F80}"
 EndProject
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aether.Shaders.Deferred.WINDOWS.XNA", "Shaders\Deferred\Aether.Shaders.Deferred.WINDOWS.XNA.csproj", "{B82B862D-C728-4A10-8A56-65D688E022C8}"
+EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{45FFB286-52CE-4EB7-8ACE-8B6FBD18D616}"
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{45FFB286-52CE-4EB7-8ACE-8B6FBD18D616}"
 EndProject
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Samples.Animation.WINDOWS.XNA", "Samples\Animation\Samples.Animation.WINDOWS.XNA.csproj", "{8C971E86-ACD6-45E6-A4C2-7E0C556152FE}"
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Samples.Animation.WINDOWS.XNA", "Samples\Animation\Samples.Animation.WINDOWS.XNA.csproj", "{8C971E86-ACD6-45E6-A4C2-7E0C556152FE}"
@@ -25,6 +27,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Samples.FXAA.WINDOWS.XNA",
 EndProject
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Samples.FXAAContent", "Samples\FXAAContent\Samples.FXAAContent.contentproj", "{578BBDBD-874B-4738-B956-93AAADD67D60}"
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Samples.FXAAContent", "Samples\FXAAContent\Samples.FXAAContent.contentproj", "{578BBDBD-874B-4738-B956-93AAADD67D60}"
 EndProject
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Samples.Deferred.WINDOWS.XNA", "Samples\Deferred\Samples.Deferred.WINDOWS.XNA.csproj", "{6AD3101D-258F-4B90-ADEF-BCA6E89D8128}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Samples.DeferredContent", "Samples\DeferredContent\Samples.DeferredContent.contentproj", "{FEFA33C9-E197-458C-845E-5FA513C38DF4}"
+EndProject
 Global
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|x86 = Debug|x86
 		Debug|x86 = Debug|x86
@@ -51,18 +57,28 @@ Global
 		{89E0198E-7298-411A-B5C1-61F2754A3F80}.Debug|x86.Build.0 = Debug|x86
 		{89E0198E-7298-411A-B5C1-61F2754A3F80}.Debug|x86.Build.0 = Debug|x86
 		{89E0198E-7298-411A-B5C1-61F2754A3F80}.Release|x86.ActiveCfg = Release|x86
 		{89E0198E-7298-411A-B5C1-61F2754A3F80}.Release|x86.ActiveCfg = Release|x86
 		{89E0198E-7298-411A-B5C1-61F2754A3F80}.Release|x86.Build.0 = Release|x86
 		{89E0198E-7298-411A-B5C1-61F2754A3F80}.Release|x86.Build.0 = Release|x86
+		{B82B862D-C728-4A10-8A56-65D688E022C8}.Debug|x86.ActiveCfg = Debug|x86
+		{B82B862D-C728-4A10-8A56-65D688E022C8}.Debug|x86.Build.0 = Debug|x86
+		{B82B862D-C728-4A10-8A56-65D688E022C8}.Release|x86.ActiveCfg = Release|x86
+		{B82B862D-C728-4A10-8A56-65D688E022C8}.Release|x86.Build.0 = Release|x86
 		{8C971E86-ACD6-45E6-A4C2-7E0C556152FE}.Debug|x86.ActiveCfg = Debug|x86
 		{8C971E86-ACD6-45E6-A4C2-7E0C556152FE}.Debug|x86.ActiveCfg = Debug|x86
 		{8C971E86-ACD6-45E6-A4C2-7E0C556152FE}.Debug|x86.Build.0 = Debug|x86
 		{8C971E86-ACD6-45E6-A4C2-7E0C556152FE}.Debug|x86.Build.0 = Debug|x86
 		{8C971E86-ACD6-45E6-A4C2-7E0C556152FE}.Release|x86.ActiveCfg = Release|x86
 		{8C971E86-ACD6-45E6-A4C2-7E0C556152FE}.Release|x86.ActiveCfg = Release|x86
 		{8C971E86-ACD6-45E6-A4C2-7E0C556152FE}.Release|x86.Build.0 = Release|x86
 		{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}.Debug|x86.ActiveCfg = Debug|x86
 		{B02966BF-88BC-41B2-80EF-8F8C5F98FA98}.Release|x86.ActiveCfg = Release|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.ActiveCfg = Debug|x86
 		{E48F0BAF-BA9B-418B-9B35-8EF212E56C62}.Debug|x86.Build.0 = 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.ActiveCfg = Release|x86
 		{E48F0BAF-BA9B-418B-9B35-8EF212E56C62}.Release|x86.Build.0 = Release|x86
 		{E48F0BAF-BA9B-418B-9B35-8EF212E56C62}.Release|x86.Build.0 = Release|x86
+		{578BBDBD-874B-4738-B956-93AAADD67D60}.Debug|x86.ActiveCfg = Debug|x86
+		{578BBDBD-874B-4738-B956-93AAADD67D60}.Release|x86.ActiveCfg = Release|x86
+		{6AD3101D-258F-4B90-ADEF-BCA6E89D8128}.Debug|x86.ActiveCfg = Debug|x86
+		{6AD3101D-258F-4B90-ADEF-BCA6E89D8128}.Debug|x86.Build.0 = Debug|x86
+		{6AD3101D-258F-4B90-ADEF-BCA6E89D8128}.Release|x86.ActiveCfg = Release|x86
+		{6AD3101D-258F-4B90-ADEF-BCA6E89D8128}.Release|x86.Build.0 = Release|x86
+		{FEFA33C9-E197-458C-845E-5FA513C38DF4}.Debug|x86.ActiveCfg = Debug|x86
+		{FEFA33C9-E197-458C-845E-5FA513C38DF4}.Release|x86.ActiveCfg = Release|x86
 	EndGlobalSection
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
 		HideSolutionNode = FALSE
@@ -71,9 +87,12 @@ Global
 		{565ACF47-7E36-435E-8727-2AFB39E61134} = {F6B6E505-6037-49E4-9060-8B29A7B99BC1}
 		{565ACF47-7E36-435E-8727-2AFB39E61134} = {F6B6E505-6037-49E4-9060-8B29A7B99BC1}
 		{E22F02E7-6799-4C14-B9B3-B461D6E9AB6E} = {F6B6E505-6037-49E4-9060-8B29A7B99BC1}
 		{E22F02E7-6799-4C14-B9B3-B461D6E9AB6E} = {F6B6E505-6037-49E4-9060-8B29A7B99BC1}
 		{89E0198E-7298-411A-B5C1-61F2754A3F80} = {EFC7A27C-C20B-4BE7-8B3A-2B109991D704}
 		{89E0198E-7298-411A-B5C1-61F2754A3F80} = {EFC7A27C-C20B-4BE7-8B3A-2B109991D704}
+		{B82B862D-C728-4A10-8A56-65D688E022C8} = {EFC7A27C-C20B-4BE7-8B3A-2B109991D704}
 		{8C971E86-ACD6-45E6-A4C2-7E0C556152FE} = {45FFB286-52CE-4EB7-8ACE-8B6FBD18D616}
 		{8C971E86-ACD6-45E6-A4C2-7E0C556152FE} = {45FFB286-52CE-4EB7-8ACE-8B6FBD18D616}
 		{B02966BF-88BC-41B2-80EF-8F8C5F98FA98} = {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}
 		{E48F0BAF-BA9B-418B-9B35-8EF212E56C62} = {45FFB286-52CE-4EB7-8ACE-8B6FBD18D616}
+		{578BBDBD-874B-4738-B956-93AAADD67D60} = {45FFB286-52CE-4EB7-8ACE-8B6FBD18D616}
+		{6AD3101D-258F-4B90-ADEF-BCA6E89D8128} = {45FFB286-52CE-4EB7-8ACE-8B6FBD18D616}
+		{FEFA33C9-E197-458C-845E-5FA513C38DF4} = {45FFB286-52CE-4EB7-8ACE-8B6FBD18D616}
 	EndGlobalSection
 	EndGlobalSection
 EndGlobal
 EndGlobal

+ 207 - 0
Samples/Deferred/DeferredRendering.cs

@@ -0,0 +1,207 @@
+using System;
+using tainicom.Aether.Shaders;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
+using Microsoft.Xna.Framework.Content;
+
+namespace Samples.Deferred
+{
+    public class DeferredRendering
+    {
+        GraphicsDevice _graphicsDevice;
+
+        private QuadRenderComponent quadRenderer;
+
+        public RenderTarget2D colorRT;  // color and specular intensity
+        public RenderTarget2D normalRT; // normals + specular power
+        public RenderTarget2D depthRT;  // depth
+        public RenderTarget2D lightRT;  // lighting
+
+        public DeferredBasicEffect basicEffect;
+        private DeferredClearGBufferEffect clearBufferEffect;
+        private DeferredPointLightEffect pointLightEffect;
+        private DeferredSpotLightEffect spotLightEffect;
+        private DeferredCombineEffect combineEffect;
+        private Model sphereModel; //point ligt volume
+        private Vector2 halfPixel;
+        
+        public DeferredRendering(GraphicsDevice graphicsDevice, ContentManager content)
+        {
+            _graphicsDevice = graphicsDevice;
+
+            quadRenderer = new QuadRenderComponent(graphicsDevice);
+
+            halfPixel = new Vector2()
+            {
+                X = 0.5f / (float)graphicsDevice.PresentationParameters.BackBufferWidth,
+                Y = 0.5f / (float)graphicsDevice.PresentationParameters.BackBufferHeight
+            };
+
+            int backbufferWidth = graphicsDevice.PresentationParameters.BackBufferWidth;
+            int backbufferHeight = graphicsDevice.PresentationParameters.BackBufferHeight;
+            colorRT = new RenderTarget2D(graphicsDevice, backbufferWidth, backbufferHeight, false, SurfaceFormat.Color, DepthFormat.Depth24);
+            normalRT = new RenderTarget2D(graphicsDevice, backbufferWidth, backbufferHeight, false, SurfaceFormat.Color, DepthFormat.None);
+            depthRT = new RenderTarget2D(graphicsDevice, backbufferWidth, backbufferHeight, false, SurfaceFormat.Single, DepthFormat.None);
+            lightRT = new RenderTarget2D(graphicsDevice, backbufferWidth, backbufferHeight, false, SurfaceFormat.Color, DepthFormat.None);
+
+            basicEffect = new DeferredBasicEffect(graphicsDevice);
+            clearBufferEffect = new DeferredClearGBufferEffect(graphicsDevice);
+            combineEffect = new DeferredCombineEffect(graphicsDevice);
+            pointLightEffect = new DeferredPointLightEffect(graphicsDevice);
+            spotLightEffect = new DeferredSpotLightEffect(graphicsDevice);
+            sphereModel = content.Load<Model>(@"sphere");           
+        }
+                
+        internal void DrawRTs(SpriteBatch spriteBatch)
+        {
+            float scale = 1f / 8f;
+            float height = colorRT.Height * scale;
+            Vector2 pos = new Vector2(0, height);
+            Vector2 off = new Vector2(0, height*4);
+            spriteBatch.Draw(colorRT, pos * 0 + off, null, Color.White, 0f, Vector2.Zero, scale, SpriteEffects.None, 0);
+            spriteBatch.Draw(normalRT,pos * 1 + off, null, Color.White, 0f, Vector2.Zero, scale, SpriteEffects.None, 0);
+            spriteBatch.Draw(depthRT, pos * 2 + off, null, Color.White, 0f, Vector2.Zero, scale, SpriteEffects.None, 0);
+            spriteBatch.Draw(lightRT, pos * 3 + off, null, Color.White, 0f, Vector2.Zero, scale, SpriteEffects.None, 0);
+        }
+
+        internal void SetGBuffer()
+        {
+            _graphicsDevice.SetRenderTargets(colorRT, normalRT, depthRT);
+        }
+
+        internal void ClearGBuffer()
+        {
+            _graphicsDevice.Clear(Color.Black);
+            clearBufferEffect.CurrentTechnique.Passes[0].Apply();
+            quadRenderer.Render(Vector2.One * -1, Vector2.One);
+        }
+
+        internal void ResolveGBuffer()
+        {
+            _graphicsDevice.SetRenderTargets(null);
+        }
+
+        internal void Combine()
+        {
+            _graphicsDevice.BlendState = BlendState.Opaque;
+            _graphicsDevice.DepthStencilState = DepthStencilState.None;
+            _graphicsDevice.RasterizerState = RasterizerState.CullCounterClockwise;
+            _graphicsDevice.SetRenderTarget(null);
+            _graphicsDevice.Clear(Color.Black);
+            //Combine everything
+            combineEffect.ColorMap = colorRT;
+            combineEffect.LightMap = lightRT;
+            combineEffect.HalfPixel = halfPixel;
+            combineEffect.CurrentTechnique.Passes[0].Apply();
+            quadRenderer.Render(Vector2.One * -1, Vector2.One);
+        }
+
+
+        public void DrawPointLight(Vector3 lightPosition, Color color, float lightRadius, float lightIntensity, Matrix view, Matrix projection, Vector3 cameraPosition)
+        {
+            //set the G-Buffer parameters
+            pointLightEffect.ColorMap = colorRT;
+            pointLightEffect.NormalMap = normalRT;
+            pointLightEffect.DepthMap = depthRT;
+
+            //compute the light world matrix
+            //scale according to light radius, and translate it to light position
+            Matrix sphereWorldMatrix = Matrix.CreateScale(lightRadius) * Matrix.CreateTranslation(lightPosition);
+            pointLightEffect.World = sphereWorldMatrix;
+            pointLightEffect.View = view;
+            pointLightEffect.Projection = projection;
+            //light position
+            pointLightEffect.LightPosition = lightPosition;
+
+            //set the color, radius and Intensity
+            pointLightEffect.Color = color.ToVector3();
+            pointLightEffect.LightRadius = lightRadius;
+            pointLightEffect.LightIntensity = lightIntensity;
+
+            //parameters for specular computations
+            pointLightEffect.CameraPosition = cameraPosition;
+            pointLightEffect.InvertViewProjection = Matrix.Invert(view * projection);
+            //size of a halfpixel, for texture coordinates alignment
+            pointLightEffect.HalfPixel = halfPixel;
+
+            _graphicsDevice.RasterizerState = RasterizerState.CullNone;
+            _graphicsDevice.DepthStencilState = DepthStencilState.None;
+            _graphicsDevice.BlendState = BlendState.AlphaBlend;
+
+            pointLightEffect.CurrentTechnique.Passes[0].Apply();
+            foreach (ModelMesh mesh in sphereModel.Meshes)
+            {
+                foreach (ModelMeshPart meshPart in mesh.MeshParts)
+                {
+                    _graphicsDevice.Indices = meshPart.IndexBuffer;
+                    _graphicsDevice.SetVertexBuffer(meshPart.VertexBuffer);
+
+                    _graphicsDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, meshPart.NumVertices, meshPart.StartIndex, meshPart.PrimitiveCount);
+                }
+            }
+
+            _graphicsDevice.RasterizerState = RasterizerState.CullCounterClockwise;
+            _graphicsDevice.DepthStencilState = DepthStencilState.Default;
+            _graphicsDevice.BlendState = BlendState.Opaque;
+        }
+
+        public void DrawSpotLight(Vector3 lightPosition, Color color, float lightRadius, float lightIntensity,
+            Vector3 lightDirection, float innerAngle, float outerAngle, Matrix view, Matrix projection, Vector3 cameraPosition)
+        {
+            //set the G-Buffer parameters
+            spotLightEffect.ColorMap = colorRT;
+            spotLightEffect.NormalMap = normalRT;
+            spotLightEffect.DepthMap = depthRT;
+
+            //compute the light world matrix
+            //scale according to light radius, and translate it to light position
+            Matrix sphereWorldMatrix = Matrix.CreateScale(lightRadius) * Matrix.CreateTranslation(lightPosition);
+            spotLightEffect.World = sphereWorldMatrix;
+            spotLightEffect.View = view;
+            spotLightEffect.Projection = projection;
+
+            //light position
+            spotLightEffect.LightPosition = lightPosition;
+
+            //light direction
+            spotLightEffect.LightDirection = lightDirection;
+
+            //spot light
+            if (innerAngle == outerAngle) innerAngle -= innerAngle / 360f;
+            spotLightEffect.InnerAngleCos = (float)Math.Cos(innerAngle);
+            spotLightEffect.OuterAngleCos = (float)Math.Cos(outerAngle);
+
+            //set the color, radius and Intensity
+            spotLightEffect.Color = color.ToVector3();
+            spotLightEffect.LightRadius = lightRadius;
+            spotLightEffect.LightIntensity = lightIntensity;
+
+            //parameters for specular computations
+            spotLightEffect.CameraPosition = cameraPosition;
+            spotLightEffect.InvertViewProjection = Matrix.Invert(view * projection);
+            //size of a halfpixel, for texture coordinates alignment
+            spotLightEffect.HalfPixel = halfPixel;
+
+            _graphicsDevice.RasterizerState = RasterizerState.CullNone;
+            _graphicsDevice.DepthStencilState = DepthStencilState.None;
+            _graphicsDevice.BlendState = BlendState.AlphaBlend;
+
+            spotLightEffect.CurrentTechnique.Passes[0].Apply();
+            foreach (ModelMesh mesh in sphereModel.Meshes)
+            {
+                foreach (ModelMeshPart meshPart in mesh.MeshParts)
+                {
+                    _graphicsDevice.Indices = meshPart.IndexBuffer;
+                    _graphicsDevice.SetVertexBuffer(meshPart.VertexBuffer);
+
+                    _graphicsDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, meshPart.NumVertices, meshPart.StartIndex, meshPart.PrimitiveCount);
+                }
+            }
+
+            _graphicsDevice.RasterizerState = RasterizerState.CullCounterClockwise;
+            _graphicsDevice.DepthStencilState = DepthStencilState.Default;
+            _graphicsDevice.BlendState = BlendState.Opaque;
+        }
+
+    }
+}

BIN
Samples/Deferred/Game.ico


+ 173 - 0
Samples/Deferred/Game1.cs

@@ -0,0 +1,173 @@
+#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.Deferred
+{
+    public class Game1 : Microsoft.Xna.Framework.Game
+    {
+        GraphicsDeviceManager graphics;
+        SpriteBatch spriteBatch;
+        SpriteFont font;
+
+        KeyboardState previousKeyboardState;
+        
+        bool useLightA = true;
+        bool useLightB = true;
+        bool useLightC = true; 
+        bool rotate = true;
+
+        Vector3 cameraPosition;
+
+        Matrix world;
+        Matrix projection;
+        Matrix view;
+
+        Spaceship spaceship;
+        Vector3 spaceshipPos = Vector3.Zero;
+        float time = 0;
+
+        DeferredRendering _deferredRendering;
+
+        const float LightAIntensity = 10f;
+        const float LightBIntensity = 1f;
+        const float LightCIntensity = 3f;
+
+        float lightAcurrentIntensity = LightAIntensity;
+        float lightBcurrentIntensity = LightBIntensity;
+        float lightCcurrentIntensity = LightCIntensity;
+
+        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, 2000f, 6000f);
+
+            _deferredRendering = new DeferredRendering(GraphicsDevice, Content);
+        }
+        
+        /// <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))
+                useLightA = !useLightA;
+            if (keyState.IsKeyDown(Keys.F2) && !previousKeyboardState.IsKeyDown(Keys.F2))
+                useLightB = !useLightB;
+            if (keyState.IsKeyDown(Keys.F3) && !previousKeyboardState.IsKeyDown(Keys.F3))
+                useLightC = !useLightC;
+            if (keyState.IsKeyDown(Keys.F4) && !previousKeyboardState.IsKeyDown(Keys.F4))
+                rotate = !rotate;
+
+            if (rotate)
+                time += (float)gameTime.ElapsedGameTime.TotalSeconds;
+
+            float lightAtargetIntensity = (useLightA) ? LightAIntensity : 0f;
+            float lightBtargetIntensity = (useLightB) ? LightBIntensity : 0f;
+            float lightCtargetIntensity = (useLightC) ? LightCIntensity : 0f;
+            lightAcurrentIntensity += (lightAtargetIntensity - lightAcurrentIntensity) * (0.1f);
+            lightBcurrentIntensity += (lightBtargetIntensity - lightBcurrentIntensity) * (0.1f);
+            lightCcurrentIntensity += (lightCtargetIntensity - lightCcurrentIntensity) * (0.1f);
+
+            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)
+        {
+            _deferredRendering.SetGBuffer();
+            _deferredRendering.ClearGBuffer();
+            
+            //draw models
+            GraphicsDevice.BlendState = BlendState.Opaque;
+            GraphicsDevice.DepthStencilState = DepthStencilState.Default;
+            spaceship.DrawDeferred(GraphicsDevice, _deferredRendering.basicEffect, world, view, projection);
+
+            _deferredRendering.ResolveGBuffer();
+            GraphicsDevice.SetRenderTarget(_deferredRendering.lightRT);
+            GraphicsDevice.Clear(Color.Transparent);
+
+            // Draw lights
+
+            //float ambient = 0.1f;
+            //GraphicsDevice.Clear(new Color(ambient, ambient, ambient, 0f));
+
+            var lightPos = spaceshipPos + new Vector3(2000,100,0);
+            _deferredRendering.DrawPointLight(
+                lightPos, Color.Goldenrod, 2000f, lightAcurrentIntensity,
+                view, projection, cameraPosition);
+
+            var light2Pos = spaceshipPos + new Vector3(0, 800, 1000);
+            _deferredRendering.DrawPointLight(
+                light2Pos, Color.CornflowerBlue, 900f, lightBcurrentIntensity,
+                view, projection, cameraPosition);
+
+            var spotLightPos = spaceshipPos + new Vector3(-1000,1000,0);
+            var lightDirection = spaceshipPos - spotLightPos;
+            _deferredRendering.DrawSpotLight(
+                spotLightPos, Color.White, 1000f, lightCcurrentIntensity, lightDirection,
+                MathHelper.ToRadians(3f), MathHelper.ToRadians(3f),
+                view, projection, cameraPosition);
+            
+            _deferredRendering.Combine();
+
+            
+            spriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.Opaque, SamplerState.PointClamp, DepthStencilState.None, RasterizerState.CullNone);
+            _deferredRendering.DrawRTs(spriteBatch);
+            spriteBatch.End();
+            spriteBatch.Begin();
+            spriteBatch.DrawString(font, String.Format("[F1] PointLight A - ({0})", useLightA ? "ON" : "OFF"), new Vector2(20, 20), Color.White);
+            spriteBatch.DrawString(font, String.Format("[F2] PointLight B - ({0})", useLightB ? "ON" : "OFF"), new Vector2(20, 40), Color.White);
+            spriteBatch.DrawString(font, String.Format("[F3] SpotLight C - ({0})", useLightC ? "ON" : "OFF"), new Vector2(20, 60), Color.White);
+            spriteBatch.DrawString(font, String.Format("[F4] Rotate - ({0})", rotate ? "ON" : "OFF"), new Vector2(20, 80), Color.White);
+            spriteBatch.End();
+
+            base.Draw(gameTime);
+        }
+
+    }
+}

BIN
Samples/Deferred/GameThumbnail.png


BIN
Samples/Deferred/Icon.ico


+ 19 - 0
Samples/Deferred/Program.cs

@@ -0,0 +1,19 @@
+using System;
+
+namespace Samples.Deferred
+{
+#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/Deferred/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.Deferred")]
+[assembly: AssemblyProduct("Samples.Deferred")]
+[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")]

+ 60 - 0
Samples/Deferred/QuadRenderer.cs

@@ -0,0 +1,60 @@
+
+using System;
+using System.Collections.Generic;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
+
+namespace Samples.Deferred
+{
+    public partial class QuadRenderComponent
+    {      
+        GraphicsDevice graphicsDevice; 
+        VertexPositionTexture[] verts = null;
+        short[] ib = null;
+        
+        public QuadRenderComponent(GraphicsDevice graphicsDevice)
+        {
+            this.graphicsDevice = graphicsDevice;
+            
+            verts = new VertexPositionTexture[]
+                        {
+                            new VertexPositionTexture(
+                                new Vector3(0,0,0),
+                                new Vector2(1,1)),
+                            new VertexPositionTexture(
+                                new Vector3(0,0,0),
+                                new Vector2(0,1)),
+                            new VertexPositionTexture(
+                                new Vector3(0,0,0),
+                                new Vector2(0,0)),
+                            new VertexPositionTexture(
+                                new Vector3(0,0,0),
+                                new Vector2(1,0))
+                        };
+
+            ib = new short[] { 0, 1, 2, 2, 3, 0 };
+
+            return;
+        }
+        
+        public void Render(Vector2 v1, Vector2 v2)
+        {
+            graphicsDevice.BlendState = BlendState.Opaque;
+
+            verts[0].Position.X = v2.X;
+            verts[0].Position.Y = v1.Y;
+
+            verts[1].Position.X = v1.X;
+            verts[1].Position.Y = v1.Y;
+
+            verts[2].Position.X = v1.X;
+            verts[2].Position.Y = v2.Y;
+
+            verts[3].Position.X = v2.X;
+            verts[3].Position.Y = v2.Y;
+
+            graphicsDevice.DrawUserIndexedPrimitives<VertexPositionTexture>
+                (PrimitiveType.TriangleList, verts, 0, 4, ib, 0, 2);
+        }
+    }
+}

+ 84 - 0
Samples/Deferred/Samples.Deferred.WINDOWS.MG.csproj

@@ -0,0 +1,84 @@
+<?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>{594B1001-B485-499A-A22B-42125763C2CF}</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="DeferredRendering.cs" />
+    <Compile Include="Game1.cs" />
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="QuadRenderer.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="..\DeferredContent\Samples.DeferredContent.mgcb">
+      <Link>Content\Content.mgcb</Link>
+    </MonoGameContentReference>
+    <None Include="app.config" />
+    <None Include="app.manifest" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\Shaders\Deferred\Aether.Shaders.Deferred.WINDOWS.MG.csproj">
+      <Project>{96105100-20db-4187-9bca-0a20ac9f1298}</Project>
+      <Name>Aether.Shaders.Deferred.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>

+ 132 - 0
Samples/Deferred/Samples.Deferred.WINDOWS.XNA.csproj

@@ -0,0 +1,132 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <ProjectGuid>{6AD3101D-258F-4B90-ADEF-BCA6E89D8128}</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>37BFBD85-8F1B-4620-A082-139DF8F4AFA3</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="DeferredRendering.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="Program.cs" />
+    <Compile Include="Game1.cs" />
+    <Compile Include="QuadRenderer.cs" />
+    <Compile Include="Spaceship.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <Content Include="Game.ico" />
+    <Content Include="GameThumbnail.png">
+      <XnaPlatformSpecific>true</XnaPlatformSpecific>
+    </Content>
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\Shaders\Deferred\Aether.Shaders.Deferred.WINDOWS.XNA.csproj">
+      <Project>{B82B862D-C728-4A10-8A56-65D688E022C8}</Project>
+      <Name>Aether.Shaders.Deferred.WINDOWS.XNA</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\DeferredContent\Samples.DeferredContent.contentproj">
+      <Project>{FEFA33C9-E197-458C-845E-5FA513C38DF4}</Project>
+      <Name>Samples.DeferredContent %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>

+ 57 - 0
Samples/Deferred/Spaceship.cs

@@ -0,0 +1,57 @@
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Content;
+using Microsoft.Xna.Framework.Graphics;
+using tainicom.Aether.Shaders;
+
+namespace Samples.Deferred
+{
+    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();
+            }
+        }
+
+        internal void DrawDeferred(GraphicsDevice device, DeferredBasicEffect deferredBasicEffect, Matrix world, Matrix view, Matrix projection)
+        {
+            deferredBasicEffect.World = world;
+            deferredBasicEffect.View = view;
+            deferredBasicEffect.Projection = projection;
+
+            foreach (var mesh in model.Meshes)
+            {
+                foreach (var part in mesh.MeshParts)
+                {
+                    deferredBasicEffect.CurrentTechnique.Passes[0].Apply();
+                    device.Textures[0] = ((BasicEffect)part.Effect).Texture;
+
+                    device.SetVertexBuffer(part.VertexBuffer);
+                    device.Indices = part.IndexBuffer;
+                    device.DrawIndexedPrimitives(PrimitiveType.TriangleList, 
+                            part.VertexOffset, 0, part.NumVertices,
+                            part.StartIndex, part.PrimitiveCount);
+                }
+            }
+        }
+    }
+}

+ 3 - 0
Samples/Deferred/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/Deferred/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>

+ 74 - 0
Samples/DeferredContent/Samples.DeferredContent.contentproj

@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <ProjectGuid>{FEFA33C9-E197-458C-845E-5FA513C38DF4}</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.DeferredContent</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>
+      <ProcessorParameters_GenerateTangentFrames>True</ProcessorParameters_GenerateTangentFrames>
+    </Compile>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="sphere.x">
+      <Name>sphere</Name>
+      <Importer>XImporter</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>

+ 60 - 0
Samples/DeferredContent/Samples.DeferredContent.mgcb

@@ -0,0 +1,60 @@
+
+#----------------------------- 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=True
+/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
+
+#begin sphere.x
+/importer:XImporter
+/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:sphere.x
+

BIN
Samples/DeferredContent/enemy.tga


+ 60 - 0
Samples/DeferredContent/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/DeferredContent/spaceship.fbx


+ 548 - 0
Samples/DeferredContent/sphere.x

@@ -0,0 +1,548 @@
+xof 0303txt 0032
+template XSkinMeshHeader {
+ <3cf169ce-ff7c-44ab-93c0-f78f62d172e2>
+ WORD nMaxSkinWeightsPerVertex;
+ WORD nMaxSkinWeightsPerFace;
+ WORD nBones;
+}
+
+template VertexDuplicationIndices {
+ <b8d65549-d7c9-4995-89cf-53a9a8b031e3>
+ DWORD nIndices;
+ DWORD nOriginalVertices;
+ array DWORD indices[nIndices];
+}
+
+template SkinWeights {
+ <6f0d123b-bad2-4167-a0d0-80224f25fabb>
+ STRING transformNodeName;
+ DWORD nWeights;
+ array DWORD vertexIndices[nWeights];
+ array FLOAT weights[nWeights];
+ Matrix4x4 matrixOffset;
+}
+
+
+Frame Scene_Root {
+ 
+
+ Frame sphere {
+  
+
+  FrameTransformMatrix {
+   1.000000,0.000000,-0.000000,0.000000,0.000000,1.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000000,0.000000,0.000000,1.000000;;
+  }
+
+  Mesh sphere_obj {
+   58;
+   0.000000;-1.000000;0.000000;,
+   0.000000;1.000000;0.000000;,
+   -0.382683;-0.923880;0.000000;,
+   -0.707107;-0.707107;0.000000;,
+   -0.923880;-0.382683;0.000000;,
+   -1.000000;-0.000000;0.000000;,
+   -0.923880;0.382683;0.000000;,
+   -0.707107;0.707107;0.000000;,
+   -0.382683;0.923880;0.000000;,
+   -0.270598;-0.923880;0.270598;,
+   -0.500000;-0.707107;0.500000;,
+   -0.653282;-0.382683;0.653282;,
+   -0.707107;-0.000000;0.707107;,
+   -0.653282;0.382683;0.653282;,
+   -0.500000;0.707107;0.500000;,
+   -0.270598;0.923880;0.270598;,
+   -0.000000;-0.923880;0.382683;,
+   -0.000000;-0.707107;0.707107;,
+   -0.000000;-0.382683;0.923880;,
+   -0.000000;-0.000000;1.000000;,
+   -0.000000;0.382683;0.923880;,
+   -0.000000;0.707107;0.707107;,
+   -0.000000;0.923880;0.382683;,
+   0.270598;-0.923880;0.270598;,
+   0.500000;-0.707107;0.500000;,
+   0.653282;-0.382683;0.653282;,
+   0.707107;-0.000000;0.707107;,
+   0.653282;0.382683;0.653282;,
+   0.500000;0.707107;0.500000;,
+   0.270598;0.923880;0.270598;,
+   0.382683;-0.923880;0.000000;,
+   0.707107;-0.707107;0.000000;,
+   0.923880;-0.382683;0.000000;,
+   1.000000;-0.000000;0.000000;,
+   0.923880;0.382683;0.000000;,
+   0.707107;0.707107;0.000000;,
+   0.382683;0.923880;0.000000;,
+   0.270598;-0.923880;-0.270598;,
+   0.500000;-0.707107;-0.500000;,
+   0.653282;-0.382683;-0.653282;,
+   0.707107;-0.000000;-0.707107;,
+   0.653282;0.382683;-0.653282;,
+   0.500000;0.707107;-0.500000;,
+   0.270598;0.923880;-0.270598;,
+   0.000000;-0.923880;-0.382683;,
+   0.000000;-0.707107;-0.707107;,
+   0.000000;-0.382683;-0.923880;,
+   0.000000;-0.000000;-1.000000;,
+   0.000000;0.382683;-0.923880;,
+   0.000000;0.707107;-0.707107;,
+   0.000000;0.923880;-0.382683;,
+   -0.270598;-0.923880;-0.270598;,
+   -0.500000;-0.707107;-0.500000;,
+   -0.653282;-0.382683;-0.653282;,
+   -0.707107;-0.000000;-0.707107;,
+   -0.653282;0.382683;-0.653282;,
+   -0.500000;0.707107;-0.500000;,
+   -0.270598;0.923880;-0.270598;;
+   64;
+   3;9,2,0;,
+   4;2,9,10,3;,
+   4;3,10,11,4;,
+   4;4,11,12,5;,
+   4;5,12,13,6;,
+   4;6,13,14,7;,
+   4;7,14,15,8;,
+   3;8,15,1;,
+   3;16,9,0;,
+   4;9,16,17,10;,
+   4;10,17,18,11;,
+   4;11,18,19,12;,
+   4;12,19,20,13;,
+   4;13,20,21,14;,
+   4;14,21,22,15;,
+   3;15,22,1;,
+   3;23,16,0;,
+   4;16,23,24,17;,
+   4;17,24,25,18;,
+   4;18,25,26,19;,
+   4;19,26,27,20;,
+   4;20,27,28,21;,
+   4;21,28,29,22;,
+   3;22,29,1;,
+   3;30,23,0;,
+   4;23,30,31,24;,
+   4;24,31,32,25;,
+   4;25,32,33,26;,
+   4;26,33,34,27;,
+   4;27,34,35,28;,
+   4;28,35,36,29;,
+   3;29,36,1;,
+   3;37,30,0;,
+   4;30,37,38,31;,
+   4;31,38,39,32;,
+   4;32,39,40,33;,
+   4;33,40,41,34;,
+   4;34,41,42,35;,
+   4;35,42,43,36;,
+   3;36,43,1;,
+   3;44,37,0;,
+   4;37,44,45,38;,
+   4;38,45,46,39;,
+   4;39,46,47,40;,
+   4;40,47,48,41;,
+   4;41,48,49,42;,
+   4;42,49,50,43;,
+   3;43,50,1;,
+   3;51,44,0;,
+   4;44,51,52,45;,
+   4;45,52,53,46;,
+   4;46,53,54,47;,
+   4;47,54,55,48;,
+   4;48,55,56,49;,
+   4;49,56,57,50;,
+   3;50,57,1;,
+   3;2,51,0;,
+   4;51,2,3,52;,
+   4;52,3,4,53;,
+   4;53,4,5,54;,
+   4;54,5,6,55;,
+   4;55,6,7,56;,
+   4;56,7,8,57;,
+   3;57,8,1;;
+
+   MeshNormals {
+    240;
+    -0.269132;-0.924735;0.269132;,
+    -0.380611;-0.924735;0.000000;,
+    -0.000000;-1.000000;0.000000;,
+    -0.380611;-0.924735;0.000000;,
+    -0.269132;-0.924735;0.269132;,
+    -0.498494;-0.709230;0.498494;,
+    -0.704977;-0.709230;0.000000;,
+    -0.704977;-0.709230;0.000000;,
+    -0.498494;-0.709230;0.498494;,
+    -0.652733;-0.384551;0.652733;,
+    -0.923104;-0.384551;-0.000000;,
+    -0.923104;-0.384551;-0.000000;,
+    -0.652733;-0.384551;0.652733;,
+    -0.707107;0.000000;0.707107;,
+    -1.000000;0.000000;0.000000;,
+    -1.000000;0.000000;0.000000;,
+    -0.707107;0.000000;0.707107;,
+    -0.652733;0.384551;0.652733;,
+    -0.923104;0.384551;-0.000000;,
+    -0.923104;0.384551;-0.000000;,
+    -0.652733;0.384551;0.652733;,
+    -0.498494;0.709230;0.498494;,
+    -0.704977;0.709230;0.000000;,
+    -0.704977;0.709230;0.000000;,
+    -0.498494;0.709230;0.498494;,
+    -0.269132;0.924735;0.269132;,
+    -0.380611;0.924735;0.000000;,
+    -0.380611;0.924735;0.000000;,
+    -0.269132;0.924735;0.269132;,
+    -0.000000;1.000000;0.000000;,
+    0.000000;-0.924735;0.380611;,
+    -0.269132;-0.924735;0.269132;,
+    -0.000000;-1.000000;0.000000;,
+    -0.269132;-0.924735;0.269132;,
+    0.000000;-0.924735;0.380611;,
+    -0.000000;-0.709230;0.704977;,
+    -0.498494;-0.709230;0.498494;,
+    -0.498494;-0.709230;0.498494;,
+    -0.000000;-0.709230;0.704977;,
+    0.000000;-0.384551;0.923104;,
+    -0.652733;-0.384551;0.652733;,
+    -0.652733;-0.384551;0.652733;,
+    0.000000;-0.384551;0.923104;,
+    0.000000;0.000000;1.000000;,
+    -0.707107;0.000000;0.707107;,
+    -0.707107;0.000000;0.707107;,
+    0.000000;0.000000;1.000000;,
+    0.000000;0.384551;0.923104;,
+    -0.652733;0.384551;0.652733;,
+    -0.652733;0.384551;0.652733;,
+    0.000000;0.384551;0.923104;,
+    -0.000000;0.709230;0.704977;,
+    -0.498494;0.709230;0.498494;,
+    -0.498494;0.709230;0.498494;,
+    -0.000000;0.709230;0.704977;,
+    0.000000;0.924735;0.380611;,
+    -0.269132;0.924735;0.269132;,
+    -0.269132;0.924735;0.269132;,
+    0.000000;0.924735;0.380611;,
+    -0.000000;1.000000;0.000000;,
+    0.269132;-0.924735;0.269132;,
+    0.000000;-0.924735;0.380611;,
+    -0.000000;-1.000000;0.000000;,
+    0.000000;-0.924735;0.380611;,
+    0.269132;-0.924735;0.269132;,
+    0.498494;-0.709230;0.498494;,
+    -0.000000;-0.709230;0.704977;,
+    -0.000000;-0.709230;0.704977;,
+    0.498494;-0.709230;0.498494;,
+    0.652733;-0.384551;0.652733;,
+    0.000000;-0.384551;0.923104;,
+    0.000000;-0.384551;0.923104;,
+    0.652733;-0.384551;0.652733;,
+    0.707107;0.000000;0.707107;,
+    0.000000;0.000000;1.000000;,
+    0.000000;0.000000;1.000000;,
+    0.707107;0.000000;0.707107;,
+    0.652733;0.384551;0.652733;,
+    0.000000;0.384551;0.923104;,
+    0.000000;0.384551;0.923104;,
+    0.652733;0.384551;0.652733;,
+    0.498494;0.709230;0.498494;,
+    -0.000000;0.709230;0.704977;,
+    -0.000000;0.709230;0.704977;,
+    0.498494;0.709230;0.498494;,
+    0.269132;0.924735;0.269132;,
+    0.000000;0.924735;0.380611;,
+    0.000000;0.924735;0.380611;,
+    0.269132;0.924735;0.269132;,
+    -0.000000;1.000000;0.000000;,
+    0.380611;-0.924735;0.000000;,
+    0.269132;-0.924735;0.269132;,
+    -0.000000;-1.000000;0.000000;,
+    0.269132;-0.924735;0.269132;,
+    0.380611;-0.924735;0.000000;,
+    0.704977;-0.709230;0.000000;,
+    0.498494;-0.709230;0.498494;,
+    0.498494;-0.709230;0.498494;,
+    0.704977;-0.709230;0.000000;,
+    0.923104;-0.384551;-0.000000;,
+    0.652733;-0.384551;0.652733;,
+    0.652733;-0.384551;0.652733;,
+    0.923104;-0.384551;-0.000000;,
+    1.000000;0.000000;0.000000;,
+    0.707107;0.000000;0.707107;,
+    0.707107;0.000000;0.707107;,
+    1.000000;0.000000;0.000000;,
+    0.923104;0.384551;-0.000000;,
+    0.652733;0.384551;0.652733;,
+    0.652733;0.384551;0.652733;,
+    0.923104;0.384551;-0.000000;,
+    0.704977;0.709230;0.000000;,
+    0.498494;0.709230;0.498494;,
+    0.498494;0.709230;0.498494;,
+    0.704977;0.709230;0.000000;,
+    0.380611;0.924735;0.000000;,
+    0.269132;0.924735;0.269132;,
+    0.269132;0.924735;0.269132;,
+    0.380611;0.924735;0.000000;,
+    -0.000000;1.000000;0.000000;,
+    0.269132;-0.924735;-0.269132;,
+    0.380611;-0.924735;0.000000;,
+    -0.000000;-1.000000;0.000000;,
+    0.380611;-0.924735;0.000000;,
+    0.269132;-0.924735;-0.269132;,
+    0.498494;-0.709230;-0.498494;,
+    0.704977;-0.709230;0.000000;,
+    0.704977;-0.709230;0.000000;,
+    0.498494;-0.709230;-0.498494;,
+    0.652733;-0.384551;-0.652733;,
+    0.923104;-0.384551;-0.000000;,
+    0.923104;-0.384551;-0.000000;,
+    0.652733;-0.384551;-0.652733;,
+    0.707107;0.000000;-0.707107;,
+    1.000000;0.000000;0.000000;,
+    1.000000;0.000000;0.000000;,
+    0.707107;0.000000;-0.707107;,
+    0.652733;0.384551;-0.652733;,
+    0.923104;0.384551;-0.000000;,
+    0.923104;0.384551;-0.000000;,
+    0.652733;0.384551;-0.652733;,
+    0.498494;0.709230;-0.498494;,
+    0.704977;0.709230;0.000000;,
+    0.704977;0.709230;0.000000;,
+    0.498494;0.709230;-0.498494;,
+    0.269132;0.924735;-0.269132;,
+    0.380611;0.924735;0.000000;,
+    0.380611;0.924735;0.000000;,
+    0.269132;0.924735;-0.269132;,
+    -0.000000;1.000000;0.000000;,
+    0.000000;-0.924735;-0.380611;,
+    0.269132;-0.924735;-0.269132;,
+    -0.000000;-1.000000;0.000000;,
+    0.269132;-0.924735;-0.269132;,
+    0.000000;-0.924735;-0.380611;,
+    0.000000;-0.709230;-0.704977;,
+    0.498494;-0.709230;-0.498494;,
+    0.498494;-0.709230;-0.498494;,
+    0.000000;-0.709230;-0.704977;,
+    -0.000000;-0.384551;-0.923104;,
+    0.652733;-0.384551;-0.652733;,
+    0.652733;-0.384551;-0.652733;,
+    -0.000000;-0.384551;-0.923104;,
+    0.000000;0.000000;-1.000000;,
+    0.707107;0.000000;-0.707107;,
+    0.707107;0.000000;-0.707107;,
+    0.000000;0.000000;-1.000000;,
+    -0.000000;0.384551;-0.923104;,
+    0.652733;0.384551;-0.652733;,
+    0.652733;0.384551;-0.652733;,
+    -0.000000;0.384551;-0.923104;,
+    0.000000;0.709230;-0.704977;,
+    0.498494;0.709230;-0.498494;,
+    0.498494;0.709230;-0.498494;,
+    0.000000;0.709230;-0.704977;,
+    0.000000;0.924735;-0.380611;,
+    0.269132;0.924735;-0.269132;,
+    0.269132;0.924735;-0.269132;,
+    0.000000;0.924735;-0.380611;,
+    -0.000000;1.000000;0.000000;,
+    -0.269132;-0.924735;-0.269132;,
+    0.000000;-0.924735;-0.380611;,
+    -0.000000;-1.000000;0.000000;,
+    0.000000;-0.924735;-0.380611;,
+    -0.269132;-0.924735;-0.269132;,
+    -0.498494;-0.709230;-0.498494;,
+    0.000000;-0.709230;-0.704977;,
+    0.000000;-0.709230;-0.704977;,
+    -0.498494;-0.709230;-0.498494;,
+    -0.652733;-0.384551;-0.652733;,
+    -0.000000;-0.384551;-0.923104;,
+    -0.000000;-0.384551;-0.923104;,
+    -0.652733;-0.384551;-0.652733;,
+    -0.707107;0.000000;-0.707107;,
+    0.000000;0.000000;-1.000000;,
+    0.000000;0.000000;-1.000000;,
+    -0.707107;0.000000;-0.707107;,
+    -0.652733;0.384551;-0.652733;,
+    -0.000000;0.384551;-0.923104;,
+    -0.000000;0.384551;-0.923104;,
+    -0.652733;0.384551;-0.652733;,
+    -0.498494;0.709230;-0.498494;,
+    0.000000;0.709230;-0.704977;,
+    0.000000;0.709230;-0.704977;,
+    -0.498494;0.709230;-0.498494;,
+    -0.269132;0.924735;-0.269132;,
+    0.000000;0.924735;-0.380611;,
+    0.000000;0.924735;-0.380611;,
+    -0.269132;0.924735;-0.269132;,
+    -0.000000;1.000000;0.000000;,
+    -0.380611;-0.924735;0.000000;,
+    -0.269132;-0.924735;-0.269132;,
+    -0.000000;-1.000000;0.000000;,
+    -0.269132;-0.924735;-0.269132;,
+    -0.380611;-0.924735;0.000000;,
+    -0.704977;-0.709230;0.000000;,
+    -0.498494;-0.709230;-0.498494;,
+    -0.498494;-0.709230;-0.498494;,
+    -0.704977;-0.709230;0.000000;,
+    -0.923104;-0.384551;-0.000000;,
+    -0.652733;-0.384551;-0.652733;,
+    -0.652733;-0.384551;-0.652733;,
+    -0.923104;-0.384551;-0.000000;,
+    -1.000000;0.000000;0.000000;,
+    -0.707107;0.000000;-0.707107;,
+    -0.707107;0.000000;-0.707107;,
+    -1.000000;0.000000;0.000000;,
+    -0.923104;0.384551;-0.000000;,
+    -0.652733;0.384551;-0.652733;,
+    -0.652733;0.384551;-0.652733;,
+    -0.923104;0.384551;-0.000000;,
+    -0.704977;0.709230;0.000000;,
+    -0.498494;0.709230;-0.498494;,
+    -0.498494;0.709230;-0.498494;,
+    -0.704977;0.709230;0.000000;,
+    -0.380611;0.924735;0.000000;,
+    -0.269132;0.924735;-0.269132;,
+    -0.269132;0.924735;-0.269132;,
+    -0.380611;0.924735;0.000000;,
+    -0.000000;1.000000;0.000000;;
+    64;
+    3;0,1,2;,
+    4;3,4,5,6;,
+    4;7,8,9,10;,
+    4;11,12,13,14;,
+    4;15,16,17,18;,
+    4;19,20,21,22;,
+    4;23,24,25,26;,
+    3;27,28,29;,
+    3;30,31,32;,
+    4;33,34,35,36;,
+    4;37,38,39,40;,
+    4;41,42,43,44;,
+    4;45,46,47,48;,
+    4;49,50,51,52;,
+    4;53,54,55,56;,
+    3;57,58,59;,
+    3;60,61,62;,
+    4;63,64,65,66;,
+    4;67,68,69,70;,
+    4;71,72,73,74;,
+    4;75,76,77,78;,
+    4;79,80,81,82;,
+    4;83,84,85,86;,
+    3;87,88,89;,
+    3;90,91,92;,
+    4;93,94,95,96;,
+    4;97,98,99,100;,
+    4;101,102,103,104;,
+    4;105,106,107,108;,
+    4;109,110,111,112;,
+    4;113,114,115,116;,
+    3;117,118,119;,
+    3;120,121,122;,
+    4;123,124,125,126;,
+    4;127,128,129,130;,
+    4;131,132,133,134;,
+    4;135,136,137,138;,
+    4;139,140,141,142;,
+    4;143,144,145,146;,
+    3;147,148,149;,
+    3;150,151,152;,
+    4;153,154,155,156;,
+    4;157,158,159,160;,
+    4;161,162,163,164;,
+    4;165,166,167,168;,
+    4;169,170,171,172;,
+    4;173,174,175,176;,
+    3;177,178,179;,
+    3;180,181,182;,
+    4;183,184,185,186;,
+    4;187,188,189,190;,
+    4;191,192,193,194;,
+    4;195,196,197,198;,
+    4;199,200,201,202;,
+    4;203,204,205,206;,
+    3;207,208,209;,
+    3;210,211,212;,
+    4;213,214,215,216;,
+    4;217,218,219,220;,
+    4;221,222,223,224;,
+    4;225,226,227,228;,
+    4;229,230,231,232;,
+    4;233,234,235,236;,
+    3;237,238,239;;
+   }
+
+   MeshMaterialList {
+    1;
+    64;
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0;
+
+    Material DefaultLib_Scene_Material {
+     0.700000;0.700000;0.700000;1.000000;;
+     50.000000;
+     1.000000;1.000000;1.000000;;
+     0.000000;0.000000;0.000000;;
+    }
+   }
+  }
+ }
+}

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