Browse Source

Add Deferred Shaders

Nikos Kastellanos 8 years ago
parent
commit
3d7c3c10d7
62 changed files with 2069 additions and 0 deletions
  1. 19 0
      Aether.Extras.W10.sln
  2. 7 0
      Aether.Extras.W8_1.sln
  3. 7 0
      Aether.Extras.WINDOWS.MG.sln
  4. 7 0
      Aether.Extras.WINDOWS.XNA.sln
  5. 1 0
      README.md
  6. 164 0
      Shaders/Deferred/Aether.Shaders.Deferred.W10.csproj
  7. 16 0
      Shaders/Deferred/Aether.Shaders.Deferred.W10.project.json
  8. 79 0
      Shaders/Deferred/Aether.Shaders.Deferred.W8_1.csproj
  9. 72 0
      Shaders/Deferred/Aether.Shaders.Deferred.WINDOWS.MG.csproj
  10. 69 0
      Shaders/Deferred/Aether.Shaders.Deferred.WINDOWS.XNA.csproj
  11. 147 0
      Shaders/Deferred/DeferredBasicEffect.cs
  12. 119 0
      Shaders/Deferred/DeferredClearGBufferEffect.cs
  13. 144 0
      Shaders/Deferred/DeferredCombineEffect.cs
  14. 230 0
      Shaders/Deferred/DeferredPointLightEffect.cs
  15. 256 0
      Shaders/Deferred/DeferredSpotLightEffect.cs
  16. 33 0
      Shaders/Deferred/Properties/Aether.Shaders.Deferred.rd.xml
  17. 26 0
      Shaders/Deferred/Properties/AssemblyInfo.W10.cs
  18. 37 0
      Shaders/Deferred/Properties/AssemblyInfo.cs
  19. 25 0
      Shaders/Deferred/Resources/BuildShaders.bat
  20. BIN
      Shaders/Deferred/Resources/CompileEffect/CompileEffect.exe
  21. 3 0
      Shaders/Deferred/Resources/CompileEffect/CompileEffect.exe.config
  22. BIN
      Shaders/Deferred/Resources/CompileEffect/Microsoft.Xna.Framework.Content.Pipeline.EffectImporter.dll
  23. BIN
      Shaders/Deferred/Resources/DeferredBasicEffect.dx11.mgfxo.7
  24. BIN
      Shaders/Deferred/Resources/DeferredBasicEffect.dx11.mgfxo.8
  25. 114 0
      Shaders/Deferred/Resources/DeferredBasicEffect.fx
  26. BIN
      Shaders/Deferred/Resources/DeferredBasicEffect.ogl.mgfxo.7
  27. BIN
      Shaders/Deferred/Resources/DeferredBasicEffect.ogl.mgfxo.8
  28. BIN
      Shaders/Deferred/Resources/DeferredBasicEffect.xna.WinReach
  29. BIN
      Shaders/Deferred/Resources/DeferredClearGBuffer.dx11.mgfxo.7
  30. BIN
      Shaders/Deferred/Resources/DeferredClearGBuffer.dx11.mgfxo.8
  31. 41 0
      Shaders/Deferred/Resources/DeferredClearGBuffer.fx
  32. BIN
      Shaders/Deferred/Resources/DeferredClearGBuffer.ogl.mgfxo.7
  33. BIN
      Shaders/Deferred/Resources/DeferredClearGBuffer.ogl.mgfxo.8
  34. BIN
      Shaders/Deferred/Resources/DeferredClearGBuffer.xna.WinReach
  35. BIN
      Shaders/Deferred/Resources/DeferredCombine.dx11.mgfxo.7
  36. BIN
      Shaders/Deferred/Resources/DeferredCombine.dx11.mgfxo.8
  37. 56 0
      Shaders/Deferred/Resources/DeferredCombine.fx
  38. BIN
      Shaders/Deferred/Resources/DeferredCombine.ogl.mgfxo.7
  39. BIN
      Shaders/Deferred/Resources/DeferredCombine.ogl.mgfxo.8
  40. BIN
      Shaders/Deferred/Resources/DeferredCombine.xna.WinReach
  41. BIN
      Shaders/Deferred/Resources/DeferredPointLight.dx11.mgfxo.7
  42. BIN
      Shaders/Deferred/Resources/DeferredPointLight.dx11.mgfxo.8
  43. 144 0
      Shaders/Deferred/Resources/DeferredPointLight.fx
  44. BIN
      Shaders/Deferred/Resources/DeferredPointLight.ogl.mgfxo.7
  45. BIN
      Shaders/Deferred/Resources/DeferredPointLight.ogl.mgfxo.8
  46. BIN
      Shaders/Deferred/Resources/DeferredPointLight.xna.WinReach
  47. BIN
      Shaders/Deferred/Resources/DeferredSpotLight.dx11.mgfxo.7
  48. BIN
      Shaders/Deferred/Resources/DeferredSpotLight.dx11.mgfxo.8
  49. 154 0
      Shaders/Deferred/Resources/DeferredSpotLight.fx
  50. BIN
      Shaders/Deferred/Resources/DeferredSpotLight.ogl.mgfxo.7
  51. BIN
      Shaders/Deferred/Resources/DeferredSpotLight.ogl.mgfxo.8
  52. BIN
      Shaders/Deferred/Resources/DeferredSpotLight.xna.WinReach
  53. 61 0
      Shaders/Deferred/Resources/Macros.fxh
  54. 4 0
      Shaders/Deferred/packages.config
  55. BIN
      bin/Release/W10/Aether.Shaders.Deferred.dll
  56. BIN
      bin/Release/W10/Aether.Shaders.Deferred.pri
  57. 33 0
      bin/Release/W10/Aether.Shaders.Deferred/Properties/Aether.Shaders.Deferred.rd.xml
  58. BIN
      bin/Release/W8_1/Aether.Shaders.Deferred.dll
  59. BIN
      bin/Release/W8_1/Aether.Shaders.Deferred.pri
  60. BIN
      bin/Release/Windows.XNA/Aether.Shaders.Deferred.dll
  61. BIN
      bin/Release/Windows/Aether.Shaders.Deferred.dll
  62. 1 0
      packages/repositories.config

+ 19 - 0
Aether.Extras.W10.sln

@@ -9,6 +9,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Aether.Shaders", "Aether.Sh
 EndProject
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aether.Shaders.FXAA.W10", "Shaders\FXAA\Aether.Shaders.FXAA.W10.csproj", "{CD84CAD7-12A5-47DA-82C9-A2953B9FFBF0}"
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aether.Shaders.FXAA.W10", "Shaders\FXAA\Aether.Shaders.FXAA.W10.csproj", "{CD84CAD7-12A5-47DA-82C9-A2953B9FFBF0}"
 EndProject
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aether.Shaders.Deferred.W10", "Shaders\Deferred\Aether.Shaders.Deferred.W10.csproj", "{E3A26131-F69A-4DD1-87B9-A7E3DEE255AA}"
+EndProject
 Global
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
 		Debug|Any CPU = Debug|Any CPU
@@ -53,11 +55,28 @@ Global
 		{CD84CAD7-12A5-47DA-82C9-A2953B9FFBF0}.Release|x64.Build.0 = Release|x64
 		{CD84CAD7-12A5-47DA-82C9-A2953B9FFBF0}.Release|x64.Build.0 = Release|x64
 		{CD84CAD7-12A5-47DA-82C9-A2953B9FFBF0}.Release|x86.ActiveCfg = Release|x86
 		{CD84CAD7-12A5-47DA-82C9-A2953B9FFBF0}.Release|x86.ActiveCfg = Release|x86
 		{CD84CAD7-12A5-47DA-82C9-A2953B9FFBF0}.Release|x86.Build.0 = Release|x86
 		{CD84CAD7-12A5-47DA-82C9-A2953B9FFBF0}.Release|x86.Build.0 = Release|x86
+		{E3A26131-F69A-4DD1-87B9-A7E3DEE255AA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{E3A26131-F69A-4DD1-87B9-A7E3DEE255AA}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{E3A26131-F69A-4DD1-87B9-A7E3DEE255AA}.Debug|ARM.ActiveCfg = Debug|ARM
+		{E3A26131-F69A-4DD1-87B9-A7E3DEE255AA}.Debug|ARM.Build.0 = Debug|ARM
+		{E3A26131-F69A-4DD1-87B9-A7E3DEE255AA}.Debug|x64.ActiveCfg = Debug|x64
+		{E3A26131-F69A-4DD1-87B9-A7E3DEE255AA}.Debug|x64.Build.0 = Debug|x64
+		{E3A26131-F69A-4DD1-87B9-A7E3DEE255AA}.Debug|x86.ActiveCfg = Debug|x86
+		{E3A26131-F69A-4DD1-87B9-A7E3DEE255AA}.Debug|x86.Build.0 = Debug|x86
+		{E3A26131-F69A-4DD1-87B9-A7E3DEE255AA}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{E3A26131-F69A-4DD1-87B9-A7E3DEE255AA}.Release|Any CPU.Build.0 = Release|Any CPU
+		{E3A26131-F69A-4DD1-87B9-A7E3DEE255AA}.Release|ARM.ActiveCfg = Release|ARM
+		{E3A26131-F69A-4DD1-87B9-A7E3DEE255AA}.Release|ARM.Build.0 = Release|ARM
+		{E3A26131-F69A-4DD1-87B9-A7E3DEE255AA}.Release|x64.ActiveCfg = Release|x64
+		{E3A26131-F69A-4DD1-87B9-A7E3DEE255AA}.Release|x64.Build.0 = Release|x64
+		{E3A26131-F69A-4DD1-87B9-A7E3DEE255AA}.Release|x86.ActiveCfg = Release|x86
+		{E3A26131-F69A-4DD1-87B9-A7E3DEE255AA}.Release|x86.Build.0 = Release|x86
 	EndGlobalSection
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
 		HideSolutionNode = FALSE
 	EndGlobalSection
 	EndGlobalSection
 	GlobalSection(NestedProjects) = preSolution
 	GlobalSection(NestedProjects) = preSolution
 		{CD84CAD7-12A5-47DA-82C9-A2953B9FFBF0} = {2C80D730-7FC9-45A7-BBA7-052BAABF236C}
 		{CD84CAD7-12A5-47DA-82C9-A2953B9FFBF0} = {2C80D730-7FC9-45A7-BBA7-052BAABF236C}
+		{E3A26131-F69A-4DD1-87B9-A7E3DEE255AA} = {2C80D730-7FC9-45A7-BBA7-052BAABF236C}
 	EndGlobalSection
 	EndGlobalSection
 EndGlobal
 EndGlobal

+ 7 - 0
Aether.Extras.W8_1.sln

@@ -9,6 +9,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Aether.Shaders", "Aether.Sh
 EndProject
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aether.Shaders.FXAA.W8_1", "Shaders\FXAA\Aether.Shaders.FXAA.W8_1.csproj", "{A8768C08-09ED-4A35-90CE-6A30168F720B}"
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aether.Shaders.FXAA.W8_1", "Shaders\FXAA\Aether.Shaders.FXAA.W8_1.csproj", "{A8768C08-09ED-4A35-90CE-6A30168F720B}"
 EndProject
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aether.Shaders.Deferred.W8_1", "Shaders\Deferred\Aether.Shaders.Deferred.W8_1.csproj", "{42B24719-1CD5-49AB-A76E-AD55EE44262E}"
+EndProject
 Global
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
 		Debug|Any CPU = Debug|Any CPU
@@ -23,11 +25,16 @@ Global
 		{A8768C08-09ED-4A35-90CE-6A30168F720B}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{A8768C08-09ED-4A35-90CE-6A30168F720B}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{A8768C08-09ED-4A35-90CE-6A30168F720B}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{A8768C08-09ED-4A35-90CE-6A30168F720B}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{A8768C08-09ED-4A35-90CE-6A30168F720B}.Release|Any CPU.Build.0 = Release|Any CPU
 		{A8768C08-09ED-4A35-90CE-6A30168F720B}.Release|Any CPU.Build.0 = Release|Any CPU
+		{42B24719-1CD5-49AB-A76E-AD55EE44262E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{42B24719-1CD5-49AB-A76E-AD55EE44262E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{42B24719-1CD5-49AB-A76E-AD55EE44262E}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{42B24719-1CD5-49AB-A76E-AD55EE44262E}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
 		HideSolutionNode = FALSE
 	EndGlobalSection
 	EndGlobalSection
 	GlobalSection(NestedProjects) = preSolution
 	GlobalSection(NestedProjects) = preSolution
 		{A8768C08-09ED-4A35-90CE-6A30168F720B} = {7D8D1AE1-8482-4FDD-B7E8-5AA9C06C3F66}
 		{A8768C08-09ED-4A35-90CE-6A30168F720B} = {7D8D1AE1-8482-4FDD-B7E8-5AA9C06C3F66}
+		{42B24719-1CD5-49AB-A76E-AD55EE44262E} = {7D8D1AE1-8482-4FDD-B7E8-5AA9C06C3F66}
 	EndGlobalSection
 	EndGlobalSection
 EndGlobal
 EndGlobal

+ 7 - 0
Aether.Extras.WINDOWS.MG.sln

@@ -21,6 +21,8 @@ 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
 Global
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
 		Debug|Any CPU = Debug|Any CPU
@@ -55,6 +57,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
 	EndGlobalSection
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
 		HideSolutionNode = FALSE
@@ -65,5 +71,6 @@ 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}
 	EndGlobalSection
 	EndGlobalSection
 EndGlobal
 EndGlobal

+ 7 - 0
Aether.Extras.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
 Global
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|x86 = Debug|x86
 		Debug|x86 = Debug|x86
@@ -41,6 +43,10 @@ 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
 	EndGlobalSection
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
 		HideSolutionNode = FALSE
@@ -49,5 +55,6 @@ 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}
 	EndGlobalSection
 	EndGlobalSection
 EndGlobal
 EndGlobal

+ 1 - 0
README.md

@@ -21,3 +21,4 @@ CPU animation is optimized using unsafe code, writing directly to mapped VertexB
 ## tainicom.Aether.Shaders
 ## tainicom.Aether.Shaders
 
 
 * 'FXAA' - MonoGame port of NVIDIA's FXAA 3.11 shader.
 * 'FXAA' - MonoGame port of NVIDIA's FXAA 3.11 shader.
+* 'Deferred' - Deferred rendering.

+ 164 - 0
Shaders/Deferred/Aether.Shaders.Deferred.W10.csproj

@@ -0,0 +1,164 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{E3A26131-F69A-4DD1-87B9-A7E3DEE255AA}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>tainicom.Aether.Shaders</RootNamespace>
+    <AssemblyName>Aether.Shaders.Deferred</AssemblyName>
+    <DefaultLanguage>en-US</DefaultLanguage>
+    <TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
+    <TargetPlatformVersion>10.0.10586.0</TargetPlatformVersion>
+    <TargetPlatformMinVersion>10.0.10586.0</TargetPlatformMinVersion>
+    <MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>..\..\bin\Debug\W10\</OutputPath>
+    <DefineConstants>TRACE;DEBUG;W10</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+    <GenerateLibraryLayout>true</GenerateLibraryLayout>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugType>none</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>..\..\bin\Release\W10\</OutputPath>
+    <DefineConstants>TRACE;W10</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+    <GenerateLibraryLayout>true</GenerateLibraryLayout>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
+    <PlatformTarget>ARM</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>..\..\bin\Debug\W10\ARM\</OutputPath>
+    <DefineConstants>TRACE;DEBUG;W10</DefineConstants>
+    <NoWarn>;2008</NoWarn>
+    <DebugType>full</DebugType>
+    <PlatformTarget>ARM</PlatformTarget>
+    <UseVSHostingProcess>false</UseVSHostingProcess>
+    <ErrorReport>prompt</ErrorReport>
+    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+    <GenerateLibraryLayout>true</GenerateLibraryLayout>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
+    <PlatformTarget>ARM</PlatformTarget>
+    <OutputPath>..\..\bin\Release\W10\ARM\</OutputPath>
+    <DefineConstants>TRACE;W10</DefineConstants>
+    <Optimize>true</Optimize>
+    <NoWarn>;2008</NoWarn>
+    <DebugType>none</DebugType>
+    <PlatformTarget>ARM</PlatformTarget>
+    <UseVSHostingProcess>false</UseVSHostingProcess>
+    <ErrorReport>prompt</ErrorReport>
+    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+    <GenerateLibraryLayout>true</GenerateLibraryLayout>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
+    <PlatformTarget>x64</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>..\..\bin\Debug\W10\x64\</OutputPath>
+    <DefineConstants>TRACE;DEBUG;W10</DefineConstants>
+    <NoWarn>;2008</NoWarn>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <UseVSHostingProcess>false</UseVSHostingProcess>
+    <ErrorReport>prompt</ErrorReport>
+    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+    <GenerateLibraryLayout>true</GenerateLibraryLayout>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
+    <PlatformTarget>x64</PlatformTarget>
+    <OutputPath>..\..\bin\Release\W10\x64\</OutputPath>
+    <DefineConstants>TRACE;W10</DefineConstants>
+    <Optimize>true</Optimize>
+    <NoWarn>;2008</NoWarn>
+    <DebugType>none</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <UseVSHostingProcess>false</UseVSHostingProcess>
+    <ErrorReport>prompt</ErrorReport>
+    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+    <GenerateLibraryLayout>true</GenerateLibraryLayout>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
+    <PlatformTarget>x86</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>..\..\bin\Debug\W10\x86\</OutputPath>
+    <DefineConstants>TRACE;DEBUG;W10</DefineConstants>
+    <NoWarn>;2008</NoWarn>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <UseVSHostingProcess>false</UseVSHostingProcess>
+    <ErrorReport>prompt</ErrorReport>
+    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+    <GenerateLibraryLayout>true</GenerateLibraryLayout>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
+    <PlatformTarget>x86</PlatformTarget>
+    <OutputPath>..\..\bin\Release\W10\x86\</OutputPath>
+    <DefineConstants>TRACE;W10</DefineConstants>
+    <Optimize>true</Optimize>
+    <NoWarn>;2008</NoWarn>
+    <DebugType>none</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <UseVSHostingProcess>false</UseVSHostingProcess>
+    <ErrorReport>prompt</ErrorReport>
+    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+    <GenerateLibraryLayout>true</GenerateLibraryLayout>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="DeferredBasicEffect.cs" />
+    <Compile Include="DeferredClearGBufferEffect.cs" />
+    <Compile Include="DeferredCombineEffect.cs" />
+    <Compile Include="DeferredPointLightEffect.cs" />
+    <Compile Include="DeferredSpotLightEffect.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Properties\AssemblyInfo.W10.cs" />
+    <Content Include="Properties\Aether.Shaders.Deferred.rd.xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Resources\DeferredBasicEffect.dx11.mgfxo.7" />
+    <EmbeddedResource Include="Resources\DeferredClearGBuffer.dx11.mgfxo.7" />
+    <EmbeddedResource Include="Resources\DeferredCombine.dx11.mgfxo.7" />
+    <EmbeddedResource Include="Resources\DeferredPointLight.dx11.mgfxo.7" />
+    <EmbeddedResource Include="Resources\DeferredSpotLight.dx11.mgfxo.7" />
+    <EmbeddedResource Include="Resources\DeferredBasicEffect.dx11.mgfxo.8" />
+    <EmbeddedResource Include="Resources\DeferredClearGBuffer.dx11.mgfxo.8" />
+    <EmbeddedResource Include="Resources\DeferredCombine.dx11.mgfxo.8" />
+    <EmbeddedResource Include="Resources\DeferredPointLight.dx11.mgfxo.8" />
+    <EmbeddedResource Include="Resources\DeferredSpotLight.dx11.mgfxo.8" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="Aether.Shaders.Deferred.W10.project.json" />
+  </ItemGroup>
+  <ItemGroup>
+    <Reference Include="MonoGame.Framework">
+      <HintPath>..\..\packages\MonoGame.Framework.Portable.3.2.99.1-Beta\lib\portable-net40+sl40+win+wp80\MonoGame.Framework.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+  </ItemGroup>
+  <PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
+    <VisualStudioVersion>14.0</VisualStudioVersion>
+  </PropertyGroup>
+  <Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.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>

+ 16 - 0
Shaders/Deferred/Aether.Shaders.Deferred.W10.project.json

@@ -0,0 +1,16 @@
+{
+  "dependencies": {
+    "Microsoft.NETCore.UniversalWindowsPlatform": "5.0.0"
+  },
+  "frameworks": {
+    "uap10.0": {}
+  },
+  "runtimes": {
+    "win10-arm": {},
+    "win10-arm-aot": {},
+    "win10-x86": {},
+    "win10-x86-aot": {},
+    "win10-x64": {},
+    "win10-x64-aot": {}
+  }
+}

+ 79 - 0
Shaders/Deferred/Aether.Shaders.Deferred.W8_1.csproj

@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>8.0.30703</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{42B24719-1CD5-49AB-A76E-AD55EE44262E}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>tainicom.Aether.Shaders</RootNamespace>
+    <AssemblyName>Aether.Shaders.Deferred</AssemblyName>
+    <DefaultLanguage>en-US</DefaultLanguage>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{BC8A1FFA-BEE3-4634-8014-F334798102B3};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <TargetPlatformVersion>8.1</TargetPlatformVersion>
+    <MinimumVisualStudioVersion>12</MinimumVisualStudioVersion>
+    <TargetFrameworkVersion />
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>..\..\bin\Debug\W8_1\</OutputPath>
+    <DefineConstants>TRACE;DEBUG;W8_1</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>none</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>..\..\bin\Release\W8_1\</OutputPath>
+    <DefineConstants>TRACE;W8_1</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="DeferredBasicEffect.cs" />
+    <Compile Include="DeferredClearGBufferEffect.cs" />
+    <Compile Include="DeferredCombineEffect.cs" />
+    <Compile Include="DeferredPointLightEffect.cs" />
+    <Compile Include="DeferredSpotLightEffect.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Resources\DeferredBasicEffect.dx11.mgfxo.7" />
+    <EmbeddedResource Include="Resources\DeferredClearGBuffer.dx11.mgfxo.7" />
+    <EmbeddedResource Include="Resources\DeferredCombine.dx11.mgfxo.7" />
+    <EmbeddedResource Include="Resources\DeferredPointLight.dx11.mgfxo.7" />
+    <EmbeddedResource Include="Resources\DeferredSpotLight.dx11.mgfxo.7" />
+    <EmbeddedResource Include="Resources\DeferredBasicEffect.dx11.mgfxo.8" />
+    <EmbeddedResource Include="Resources\DeferredClearGBuffer.dx11.mgfxo.8" />
+    <EmbeddedResource Include="Resources\DeferredCombine.dx11.mgfxo.8" />
+    <EmbeddedResource Include="Resources\DeferredPointLight.dx11.mgfxo.8" />
+    <EmbeddedResource Include="Resources\DeferredSpotLight.dx11.mgfxo.8" />
+  </ItemGroup>
+  <ItemGroup>
+    <Reference Include="MonoGame.Framework">
+      <HintPath>..\..\packages\MonoGame.Framework.Portable.3.2.99.1-Beta\lib\portable-net40+sl40+win+wp80\MonoGame.Framework.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+  </ItemGroup>
+  <PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '12.0' ">
+    <VisualStudioVersion>12.0</VisualStudioVersion>
+  </PropertyGroup>
+  <Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
+  <PropertyGroup>
+  </PropertyGroup>
+  <!-- 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>

+ 72 - 0
Shaders/Deferred/Aether.Shaders.Deferred.WINDOWS.MG.csproj

@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>8.0.30703</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{96105100-20DB-4187-9BCA-0A20AC9F1298}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>tainicom.Aether.Shaders</RootNamespace>
+    <AssemblyName>Aether.Shaders.Deferred</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>..\..\bin\Debug\Windows\</OutputPath>
+    <DefineConstants>TRACE;DEBUG;WINDOWS MG</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>none</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>..\..\bin\Release\Windows\</OutputPath>
+    <DefineConstants>TRACE;WINDOWS MG</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="MonoGame.Framework, Version=3.1.2.0, Culture=neutral, processorArchitecture=MSIL">
+      <HintPath>..\..\packages\MonoGame.Framework.Portable.3.2.99.1-Beta\lib\portable-net40+sl40+win+wp80\MonoGame.Framework.dll</HintPath>
+      <SpecificVersion>False</SpecificVersion>
+      <Private>False</Private>
+    </Reference>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="DeferredBasicEffect.cs" />
+    <Compile Include="DeferredClearGBufferEffect.cs" />
+    <Compile Include="DeferredCombineEffect.cs" />
+    <Compile Include="DeferredPointLightEffect.cs" />
+    <Compile Include="DeferredSpotLightEffect.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="packages.config" />
+    <EmbeddedResource Include="Resources\DeferredBasicEffect.dx11.mgfxo.7" />
+    <EmbeddedResource Include="Resources\DeferredClearGBuffer.dx11.mgfxo.7" />
+    <EmbeddedResource Include="Resources\DeferredCombine.dx11.mgfxo.7" />
+    <EmbeddedResource Include="Resources\DeferredPointLight.dx11.mgfxo.7" />
+    <EmbeddedResource Include="Resources\DeferredSpotLight.dx11.mgfxo.7" />
+    <EmbeddedResource Include="Resources\DeferredBasicEffect.dx11.mgfxo.8" />
+    <EmbeddedResource Include="Resources\DeferredClearGBuffer.dx11.mgfxo.8" />
+    <EmbeddedResource Include="Resources\DeferredCombine.dx11.mgfxo.8" />
+    <EmbeddedResource Include="Resources\DeferredPointLight.dx11.mgfxo.8" />
+    <EmbeddedResource Include="Resources\DeferredSpotLight.dx11.mgfxo.8" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.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>

+ 69 - 0
Shaders/Deferred/Aether.Shaders.Deferred.WINDOWS.XNA.csproj

@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
+  <PropertyGroup>
+    <ProjectGuid>{B82B862D-C728-4A10-8A56-65D688E022C8}</ProjectGuid>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>tainicom.Aether.Shaders</RootNamespace>
+    <AssemblyName>Aether.Shaders.Deferred</AssemblyName>
+    <XnaFrameworkVersion>v4.0</XnaFrameworkVersion>
+    <XnaPlatform>Windows</XnaPlatform>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+  </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>
+    <PlatformTarget>x86</PlatformTarget>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+    <DebugType>none</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>..\..\bin\Release\Windows.XNA\</OutputPath>
+    <DefineConstants>TRACE;WINDOWS XNA</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <PlatformTarget>x86</PlatformTarget>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="Microsoft.Xna.Framework, 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="Microsoft.Xna.Framework.Content.Pipeline, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" />
+    <Reference Include="System" />
+    <Reference Include="System.Core">
+      <RequiredTargetFramework>4.0</RequiredTargetFramework>
+    </Reference>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="DeferredBasicEffect.cs" />
+    <Compile Include="DeferredClearGBufferEffect.cs" />
+    <Compile Include="DeferredCombineEffect.cs" />
+    <Compile Include="DeferredPointLightEffect.cs" />
+    <Compile Include="DeferredSpotLightEffect.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Resources\DeferredBasicEffect.xna.WinReach" />
+    <EmbeddedResource Include="Resources\DeferredClearGBuffer.xna.WinReach" />
+    <EmbeddedResource Include="Resources\DeferredCombine.xna.WinReach" />
+    <EmbeddedResource Include="Resources\DeferredPointLight.xna.WinReach" />
+    <EmbeddedResource Include="Resources\DeferredSpotLight.xna.WinReach" />
+  </ItemGroup>
+  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\Microsoft.Xna.GameStudio.ContentPipelineExtensions.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>

+ 147 - 0
Shaders/Deferred/DeferredBasicEffect.cs

@@ -0,0 +1,147 @@
+#region License
+//   Copyright 2014-2016 Kastellanos Nikolaos
+//
+//   Licensed under the Apache License, Version 2.0 (the "License");
+//   you may not use this file except in compliance with the License.
+//   You may obtain a copy of the License at
+//
+//       http://www.apache.org/licenses/LICENSE-2.0
+//
+//   Unless required by applicable law or agreed to in writing, software
+//   distributed under the License is distributed on an "AS IS" BASIS,
+//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//   See the License for the specific language governing permissions and
+//   limitations under the License.
+#endregion
+
+using System;
+using System.IO;
+using System.Reflection;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
+
+namespace tainicom.Aether.Shaders
+{
+    public class DeferredBasicEffect : Effect, IEffectMatrices
+    {
+        #region Effect Parameters
+            
+        // IEffectMatrices
+        EffectParameter projectionParam;
+        EffectParameter viewParam;
+        EffectParameter worldParam;
+
+        #endregion
+
+        #region Fields
+
+
+#if ((MG && WINDOWS) || W8_1 || W10)
+        static readonly String resourceName = "tainicom.Aether.Shaders.Resources.DeferredBasicEffect.dx11.mgfxo";
+#else
+        static readonly String resourceName = "tainicom.Aether.Shaders.Resources.DeferredBasicEffect.xna.WinReach";
+#endif
+
+        internal static byte[] LoadEffectResource(string name)
+        {
+            using (var stream = LoadEffectResourceStream(name))
+            using (var ms = new MemoryStream())
+            {
+                stream.CopyTo(ms);
+                return ms.ToArray();
+            }
+        }
+
+        internal static Stream LoadEffectResourceStream(string name)
+        {
+            // Detect MG version            
+            var mgVersion = GetAssembly(typeof(Effect)).GetName().Version;
+            if (mgVersion.Major == 3)
+            {
+                if (mgVersion.Minor == 4)
+                    name += ".6";
+                if (mgVersion.Minor == 5)
+                    name += ".7";
+                if (mgVersion.Minor == 6)
+                    name += ".8";
+            }
+
+            Stream stream = GetAssembly(typeof(DeferredBasicEffect)).GetManifestResourceStream(name);
+            return stream;
+        }
+
+        private static Assembly GetAssembly(Type type)
+        {            
+            #if W8_1 || W10 
+            return type.GetTypeInfo().Assembly;
+            #else
+            return type.Assembly;
+            #endif
+        }
+
+        #endregion
+        
+        #region Public Properties
+
+        public Matrix Projection
+        {
+            get { return projectionParam.GetValueMatrix(); }
+            set { projectionParam.SetValue(value); }
+        }
+
+        public Matrix View
+        {
+            get { return viewParam.GetValueMatrix(); }
+            set { viewParam.SetValue(value); }
+        }
+
+        public Matrix World
+        {
+            get { return worldParam.GetValueMatrix(); }
+            set { worldParam.SetValue(value); }
+        }
+
+        #endregion
+
+        #region Methods
+
+         public DeferredBasicEffect(GraphicsDevice graphicsDevice)
+            : base(graphicsDevice, 
+#if NETFX_CORE || WP8
+            LoadEffectResourceStream(resourceName), true
+#else
+            LoadEffectResource(resourceName)
+#endif
+           )
+        {    
+            CacheEffectParameters(null);
+        }
+
+        public DeferredBasicEffect(GraphicsDevice graphicsDevice, byte[] Bytecode): base(graphicsDevice, Bytecode)
+        {   
+            CacheEffectParameters(null);
+        }
+
+        protected DeferredBasicEffect(DeferredBasicEffect cloneSource)
+            : base(cloneSource)
+        {
+            CacheEffectParameters(cloneSource);
+        }
+        
+        public override Effect Clone()
+        {
+            return new DeferredBasicEffect(this);
+        }
+
+        void CacheEffectParameters(DeferredBasicEffect cloneSource)
+        {    
+
+            // IEffectMatrices
+            projectionParam = Parameters["Projection"];
+            viewParam = Parameters["View"];
+            worldParam = Parameters["World"];
+        }
+        
+        #endregion
+    }
+}

+ 119 - 0
Shaders/Deferred/DeferredClearGBufferEffect.cs

@@ -0,0 +1,119 @@
+#region License
+//   Copyright 2014-2016 Kastellanos Nikolaos
+//
+//   Licensed under the Apache License, Version 2.0 (the "License");
+//   you may not use this file except in compliance with the License.
+//   You may obtain a copy of the License at
+//
+//       http://www.apache.org/licenses/LICENSE-2.0
+//
+//   Unless required by applicable law or agreed to in writing, software
+//   distributed under the License is distributed on an "AS IS" BASIS,
+//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//   See the License for the specific language governing permissions and
+//   limitations under the License.
+#endregion
+
+using System;
+using System.IO;
+using System.Reflection;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
+
+namespace tainicom.Aether.Shaders
+{
+    public class DeferredClearGBufferEffect : Effect
+    {
+        #region Effect Parameters
+            
+        #endregion
+
+        #region Fields
+
+
+#if ((MG && WINDOWS) || W8_1 || W10)
+        static readonly String resourceName = "tainicom.Aether.Shaders.Resources.DeferredClearGBuffer.dx11.mgfxo";
+#else
+        static readonly String resourceName = "tainicom.Aether.Shaders.Resources.DeferredClearGBuffer.xna.WinReach";
+#endif
+
+        internal static byte[] LoadEffectResource(string name)
+        {
+            using (var stream = LoadEffectResourceStream(name))
+            using (var ms = new MemoryStream())
+            {
+                stream.CopyTo(ms);
+                return ms.ToArray();
+            }
+        }
+
+        internal static Stream LoadEffectResourceStream(string name)
+        {
+            // Detect MG version            
+            var mgVersion = GetAssembly(typeof(Effect)).GetName().Version;
+            if (mgVersion.Major == 3)
+            {
+                if (mgVersion.Minor == 4)
+                    name += ".6";
+                if (mgVersion.Minor == 5)
+                    name += ".7";
+                if (mgVersion.Minor == 6)
+                    name += ".8";
+            }
+
+            Stream stream = GetAssembly(typeof(DeferredClearGBufferEffect)).GetManifestResourceStream(name);
+            return stream;
+        }
+
+        private static Assembly GetAssembly(Type type)
+        {            
+            #if W8_1 || W10 
+            return type.GetTypeInfo().Assembly;
+            #else
+            return type.Assembly;
+            #endif
+        }
+
+        #endregion
+        
+        #region Public Properties
+        
+        #endregion
+
+        #region Methods
+
+         public DeferredClearGBufferEffect(GraphicsDevice graphicsDevice)
+            : base(graphicsDevice, 
+#if NETFX_CORE || WP8
+            LoadEffectResourceStream(resourceName), true
+#else
+            LoadEffectResource(resourceName)
+#endif
+           )
+        {    
+            CacheEffectParameters(null);
+        }
+
+        public DeferredClearGBufferEffect(GraphicsDevice graphicsDevice, byte[] Bytecode): base(graphicsDevice, Bytecode)
+        {   
+            CacheEffectParameters(null);
+        }
+
+        protected DeferredClearGBufferEffect(DeferredClearGBufferEffect cloneSource)
+            : base(cloneSource)
+        {
+            CacheEffectParameters(cloneSource);
+        }
+        
+        public override Effect Clone()
+        {
+            return new DeferredClearGBufferEffect(this);
+        }
+
+        void CacheEffectParameters(DeferredClearGBufferEffect cloneSource)
+        {    
+        }
+        
+        #endregion
+    }
+}

+ 144 - 0
Shaders/Deferred/DeferredCombineEffect.cs

@@ -0,0 +1,144 @@
+#region License
+//   Copyright 2014-2016 Kastellanos Nikolaos
+//
+//   Licensed under the Apache License, Version 2.0 (the "License");
+//   you may not use this file except in compliance with the License.
+//   You may obtain a copy of the License at
+//
+//       http://www.apache.org/licenses/LICENSE-2.0
+//
+//   Unless required by applicable law or agreed to in writing, software
+//   distributed under the License is distributed on an "AS IS" BASIS,
+//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//   See the License for the specific language governing permissions and
+//   limitations under the License.
+#endregion
+
+using System;
+using System.IO;
+using System.Reflection;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
+
+namespace tainicom.Aether.Shaders
+{
+    public class DeferredCombineEffect : Effect
+    {
+        #region Effect Parameters
+
+        EffectParameter colorMapParam;
+        EffectParameter lightMapParam;
+        EffectParameter halfPixelParam;
+
+        #endregion
+
+        #region Fields
+
+
+#if ((MG && WINDOWS) || W8_1 || W10)
+        static readonly String resourceName = "tainicom.Aether.Shaders.Resources.DeferredCombine.dx11.mgfxo";
+#else
+        static readonly String resourceName = "tainicom.Aether.Shaders.Resources.DeferredCombine.xna.WinReach";
+#endif
+
+        internal static byte[] LoadEffectResource(string name)
+        {
+            using (var stream = LoadEffectResourceStream(name))
+            using (var ms = new MemoryStream())
+            {
+                stream.CopyTo(ms);
+                return ms.ToArray();
+            }
+        }
+
+        internal static Stream LoadEffectResourceStream(string name)
+        {
+            // Detect MG version            
+            var mgVersion = GetAssembly(typeof(Effect)).GetName().Version;
+            if (mgVersion.Major == 3)
+            {
+                if (mgVersion.Minor == 4)
+                    name += ".6";
+                if (mgVersion.Minor == 5)
+                    name += ".7";
+                if (mgVersion.Minor == 6)
+                    name += ".8";
+            }
+
+            Stream stream = GetAssembly(typeof(DeferredCombineEffect)).GetManifestResourceStream(name);
+            return stream;
+        }
+
+        private static Assembly GetAssembly(Type type)
+        {            
+            #if W8_1 || W10 
+            return type.GetTypeInfo().Assembly;
+            #else
+            return type.Assembly;
+            #endif
+        }
+
+        #endregion
+        
+        #region Public Properties
+
+        public RenderTarget2D ColorMap
+        {
+            get { return colorMapParam.GetValueTexture2D() as RenderTarget2D; }
+            set { colorMapParam.SetValue(value); }
+        }
+
+        public RenderTarget2D LightMap
+        {
+            get { return lightMapParam.GetValueTexture2D() as RenderTarget2D; }
+            set { lightMapParam.SetValue(value); }
+        }
+
+        public Vector2 HalfPixel
+        {
+            get { return halfPixelParam.GetValueVector2(); }
+            set { halfPixelParam.SetValue(value); }
+        }
+
+        #endregion
+
+        #region Methods
+
+         public DeferredCombineEffect(GraphicsDevice graphicsDevice)
+            : base(graphicsDevice, 
+#if NETFX_CORE || WP8
+            LoadEffectResourceStream(resourceName), true
+#else
+            LoadEffectResource(resourceName)
+#endif
+           )
+        {
+            CacheEffectParameters(null);
+        }
+
+        public DeferredCombineEffect(GraphicsDevice graphicsDevice, byte[] Bytecode): base(graphicsDevice, Bytecode)
+        {   
+            CacheEffectParameters(null);
+        }
+
+        protected DeferredCombineEffect(DeferredCombineEffect cloneSource)
+            : base(cloneSource)
+        {
+            CacheEffectParameters(cloneSource);
+        }
+        
+        public override Effect Clone()
+        {
+            return new DeferredCombineEffect(this);
+        }
+
+        void CacheEffectParameters(DeferredCombineEffect cloneSource)
+        {
+            colorMapParam = Parameters["colorMap"];
+            lightMapParam = Parameters["lightMap"];
+            halfPixelParam = Parameters["halfPixel"];
+        }
+        
+        #endregion
+    }
+}

+ 230 - 0
Shaders/Deferred/DeferredPointLightEffect.cs

@@ -0,0 +1,230 @@
+#region License
+//   Copyright 2014-2016 Kastellanos Nikolaos
+//
+//   Licensed under the Apache License, Version 2.0 (the "License");
+//   you may not use this file except in compliance with the License.
+//   You may obtain a copy of the License at
+//
+//       http://www.apache.org/licenses/LICENSE-2.0
+//
+//   Unless required by applicable law or agreed to in writing, software
+//   distributed under the License is distributed on an "AS IS" BASIS,
+//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//   See the License for the specific language governing permissions and
+//   limitations under the License.
+#endregion
+
+using System;
+using System.IO;
+using System.Reflection;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
+
+namespace tainicom.Aether.Shaders
+{
+    public class DeferredPointLightEffect : Effect, IEffectMatrices
+    {
+        #region Effect Parameters
+        
+        EffectParameter colorMapParam;
+        EffectParameter normalMapParam;
+        EffectParameter depthMapParam;
+        EffectParameter halfPixelParam;
+
+        EffectParameter lightPositionParam;
+        EffectParameter colorParam;
+        EffectParameter lightRadiusParam;
+        EffectParameter lightIntensityParam;
+        EffectParameter cameraPositionParam;
+        EffectParameter invertViewProjectionParam;
+
+        // IEffectMatrices
+        EffectParameter projectionParam;
+        EffectParameter viewParam;
+        EffectParameter worldParam;
+
+        #endregion
+
+        #region Fields
+
+
+#if ((MG && WINDOWS) || W8_1 || W10)
+        static readonly String resourceName = "tainicom.Aether.Shaders.Resources.DeferredPointLight.dx11.mgfxo";
+#else
+        static readonly String resourceName = "tainicom.Aether.Shaders.Resources.DeferredPointLight.xna.WinReach";
+#endif
+
+        internal static byte[] LoadEffectResource(string name)
+        {
+            using (var stream = LoadEffectResourceStream(name))
+            using (var ms = new MemoryStream())
+            {
+                stream.CopyTo(ms);
+                return ms.ToArray();
+            }
+        }
+
+        internal static Stream LoadEffectResourceStream(string name)
+        {
+            // Detect MG version            
+            var mgVersion = GetAssembly(typeof(Effect)).GetName().Version;
+            if (mgVersion.Major == 3)
+            {
+                if (mgVersion.Minor == 4)
+                    name += ".6";
+                if (mgVersion.Minor == 5)
+                    name += ".7";
+                if (mgVersion.Minor == 6)
+                    name += ".8";
+            }
+
+            Stream stream = GetAssembly(typeof(DeferredPointLightEffect)).GetManifestResourceStream(name);
+            return stream;
+        }
+
+        private static Assembly GetAssembly(Type type)
+        {            
+            #if W8_1 || W10 
+            return type.GetTypeInfo().Assembly;
+            #else
+            return type.Assembly;
+            #endif
+        }
+
+        #endregion
+        
+        #region Public Properties
+
+        public RenderTarget2D ColorMap
+        {
+            get { return colorMapParam.GetValueTexture2D() as RenderTarget2D; }
+            set { colorMapParam.SetValue(value); }
+        }
+
+        public RenderTarget2D NormalMap
+        {
+            get { return normalMapParam.GetValueTexture2D() as RenderTarget2D; }
+            set { normalMapParam.SetValue(value); }
+        }
+
+        public RenderTarget2D DepthMap
+        {
+            get { return depthMapParam.GetValueTexture2D() as RenderTarget2D; }
+            set { depthMapParam.SetValue(value); }
+        }
+
+        public Vector2 HalfPixel
+        {
+            get { return halfPixelParam.GetValueVector2(); }
+            set { halfPixelParam.SetValue(value); }
+        }
+
+        public Vector3 LightPosition
+        {
+            get { return lightPositionParam.GetValueVector3(); }
+            set { lightPositionParam.SetValue(value); }
+        }
+
+        public Vector3 Color
+        {
+            get { return colorParam.GetValueVector3(); }
+            set { colorParam.SetValue(value); }
+        }
+
+        public float LightRadius
+        {
+            get { return lightRadiusParam.GetValueSingle(); }
+            set { lightRadiusParam.SetValue(value); }
+        }
+
+        public float LightIntensity
+        {
+            get { return lightIntensityParam.GetValueSingle(); }
+            set { lightIntensityParam.SetValue(value); }
+        }
+
+        public Vector3 CameraPosition
+        {
+            get { return cameraPositionParam.GetValueVector3(); }
+            set { cameraPositionParam.SetValue(value); }
+        }
+
+        public Matrix InvertViewProjection
+        {
+            get { return invertViewProjectionParam.GetValueMatrix(); }
+            set { invertViewProjectionParam.SetValue(value); }
+        }
+
+        public Matrix Projection
+        {
+            get { return projectionParam.GetValueMatrix(); }
+            set { projectionParam.SetValue(value); }
+        }
+
+        public Matrix View
+        {
+            get { return viewParam.GetValueMatrix(); }
+            set { viewParam.SetValue(value); }
+        }
+
+        public Matrix World
+        {
+            get { return worldParam.GetValueMatrix(); }
+            set { worldParam.SetValue(value); }
+        }
+
+        #endregion
+
+        #region Methods
+
+         public DeferredPointLightEffect(GraphicsDevice graphicsDevice)
+            : base(graphicsDevice, 
+#if NETFX_CORE || WP8
+            LoadEffectResourceStream(resourceName), true
+#else
+            LoadEffectResource(resourceName)
+#endif
+           )
+        {    
+            CacheEffectParameters(null);
+        }
+
+        public DeferredPointLightEffect(GraphicsDevice graphicsDevice, byte[] Bytecode): base(graphicsDevice, Bytecode)
+        {   
+            CacheEffectParameters(null);
+        }
+
+        protected DeferredPointLightEffect(DeferredPointLightEffect cloneSource)
+            : base(cloneSource)
+        {
+            CacheEffectParameters(cloneSource);
+        }
+        
+        public override Effect Clone()
+        {
+            return new DeferredPointLightEffect(this);
+        }
+
+        void CacheEffectParameters(DeferredPointLightEffect cloneSource)
+        {
+            colorMapParam = Parameters["colorMap"];
+            normalMapParam = Parameters["normalMap"];
+            depthMapParam = Parameters["depthMap"];
+            halfPixelParam = Parameters["halfPixel"];
+
+            lightPositionParam = Parameters["lightPosition"];
+            colorParam = Parameters["Color"];
+            lightRadiusParam = Parameters["lightRadius"];
+            lightIntensityParam = Parameters["lightIntensity"];
+            cameraPositionParam = Parameters["cameraPosition"];
+            invertViewProjectionParam = Parameters["InvertViewProjection"];
+
+            // IEffectMatrices
+            projectionParam = Parameters["Projection"];
+            viewParam = Parameters["View"];
+            worldParam = Parameters["World"];
+        }
+        
+        #endregion
+    }
+}

+ 256 - 0
Shaders/Deferred/DeferredSpotLightEffect.cs

@@ -0,0 +1,256 @@
+#region License
+//   Copyright 2014-2016 Kastellanos Nikolaos
+//
+//   Licensed under the Apache License, Version 2.0 (the "License");
+//   you may not use this file except in compliance with the License.
+//   You may obtain a copy of the License at
+//
+//       http://www.apache.org/licenses/LICENSE-2.0
+//
+//   Unless required by applicable law or agreed to in writing, software
+//   distributed under the License is distributed on an "AS IS" BASIS,
+//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//   See the License for the specific language governing permissions and
+//   limitations under the License.
+#endregion
+
+using System;
+using System.IO;
+using System.Reflection;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
+
+namespace tainicom.Aether.Shaders
+{
+    public class DeferredSpotLightEffect : Effect, IEffectMatrices
+    {
+        #region Effect Parameters
+            
+        EffectParameter colorMapParam;
+        EffectParameter normalMapParam;
+        EffectParameter depthMapParam;
+        EffectParameter halfPixelParam;
+
+        EffectParameter lightPositionParam;
+        EffectParameter colorParam;
+        EffectParameter lightRadiusParam;
+        EffectParameter lightIntensityParam;
+        EffectParameter cameraPositionParam;
+        EffectParameter invertViewProjectionParam;
+
+        EffectParameter lightDirectionParam;
+        EffectParameter innerAngleCosParam;
+        EffectParameter outerAngleCosParam;
+
+        // IEffectMatrices
+        EffectParameter projectionParam;
+        EffectParameter viewParam;
+        EffectParameter worldParam;
+
+        #endregion
+
+        #region Fields
+
+
+#if ((MG && WINDOWS) || W8_1 || W10)
+        static readonly String resourceName = "tainicom.Aether.Shaders.Resources.DeferredSpotLight.dx11.mgfxo";
+#else
+        static readonly String resourceName = "tainicom.Aether.Shaders.Resources.DeferredSpotLight.xna.WinReach";
+#endif
+
+        internal static byte[] LoadEffectResource(string name)
+        {
+            using (var stream = LoadEffectResourceStream(name))
+            using (var ms = new MemoryStream())
+            {
+                stream.CopyTo(ms);
+                return ms.ToArray();
+            }
+        }
+
+        internal static Stream LoadEffectResourceStream(string name)
+        {
+            // Detect MG version            
+            var mgVersion = GetAssembly(typeof(Effect)).GetName().Version;
+            if (mgVersion.Major == 3)
+            {
+                if (mgVersion.Minor == 4)
+                    name += ".6";
+                if (mgVersion.Minor == 5)
+                    name += ".7";
+                if (mgVersion.Minor == 6)
+                    name += ".8";
+            }
+
+            Stream stream = GetAssembly(typeof(DeferredPointLightEffect)).GetManifestResourceStream(name);
+            return stream;
+        }
+
+        private static Assembly GetAssembly(Type type)
+        {            
+            #if W8_1 || W10 
+            return type.GetTypeInfo().Assembly;
+            #else
+            return type.Assembly;
+            #endif
+        }
+
+        #endregion
+        
+        #region Public Properties
+        
+        public RenderTarget2D ColorMap
+        {
+            get { return colorMapParam.GetValueTexture2D() as RenderTarget2D; }
+            set { colorMapParam.SetValue(value); }
+        }
+
+        public RenderTarget2D NormalMap
+        {
+            get { return normalMapParam.GetValueTexture2D() as RenderTarget2D; }
+            set { normalMapParam.SetValue(value); }
+        }
+
+        public RenderTarget2D DepthMap
+        {
+            get { return depthMapParam.GetValueTexture2D() as RenderTarget2D; }
+            set { depthMapParam.SetValue(value); }
+        }
+
+        public Vector2 HalfPixel
+        {
+            get { return halfPixelParam.GetValueVector2(); }
+            set { halfPixelParam.SetValue(value); }
+        }
+
+        public Vector3 LightPosition
+        {
+            get { return lightPositionParam.GetValueVector3(); }
+            set { lightPositionParam.SetValue(value); }
+        }
+
+        public Vector3 Color
+        {
+            get { return colorParam.GetValueVector3(); }
+            set { colorParam.SetValue(value); }
+        }
+
+        public float LightRadius
+        {
+            get { return lightRadiusParam.GetValueSingle(); }
+            set { lightRadiusParam.SetValue(value); }
+        }
+
+        public float LightIntensity
+        {
+            get { return lightIntensityParam.GetValueSingle(); }
+            set { lightIntensityParam.SetValue(value); }
+        }
+
+        public Vector3 CameraPosition
+        {
+            get { return cameraPositionParam.GetValueVector3(); }
+            set { cameraPositionParam.SetValue(value); }
+        }
+
+        public Matrix InvertViewProjection
+        {
+            get { return invertViewProjectionParam.GetValueMatrix(); }
+            set { invertViewProjectionParam.SetValue(value); }
+        }
+
+        public Vector3 LightDirection
+        {
+            get { return lightDirectionParam.GetValueVector3(); }
+            set { lightDirectionParam.SetValue(value); }
+        }
+
+        public float InnerAngleCos
+        {
+            get { return innerAngleCosParam.GetValueSingle(); }
+            set { innerAngleCosParam.SetValue(value); }
+        }
+
+        public float OuterAngleCos
+        {
+            get { return outerAngleCosParam.GetValueSingle(); }
+            set { outerAngleCosParam.SetValue(value); }
+        }
+
+        public Matrix Projection
+        {
+            get { return projectionParam.GetValueMatrix(); }
+            set { projectionParam.SetValue(value); }
+        }
+
+        public Matrix View
+        {
+            get { return viewParam.GetValueMatrix(); }
+            set { viewParam.SetValue(value); }
+        }
+
+        public Matrix World
+        {
+            get { return worldParam.GetValueMatrix(); }
+            set { worldParam.SetValue(value); }
+        }
+
+        #endregion
+
+        #region Methods
+
+         public DeferredSpotLightEffect(GraphicsDevice graphicsDevice)
+            : base(graphicsDevice, 
+#if NETFX_CORE || WP8
+            LoadEffectResourceStream(resourceName), true
+#else
+            LoadEffectResource(resourceName)
+#endif
+           )
+        {    
+            CacheEffectParameters(null);
+        }
+
+        public DeferredSpotLightEffect(GraphicsDevice graphicsDevice, byte[] Bytecode): base(graphicsDevice, Bytecode)
+        {   
+            CacheEffectParameters(null);
+        }
+
+        protected DeferredSpotLightEffect(DeferredSpotLightEffect cloneSource)
+            : base(cloneSource)
+        {
+            CacheEffectParameters(cloneSource);
+        }
+        
+        public override Effect Clone()
+        {
+            return new DeferredSpotLightEffect(this);
+        }
+
+        void CacheEffectParameters(DeferredSpotLightEffect cloneSource)
+        {    
+            colorMapParam = Parameters["colorMap"];
+            normalMapParam = Parameters["normalMap"];
+            depthMapParam = Parameters["depthMap"];
+            halfPixelParam = Parameters["halfPixel"];
+
+            lightPositionParam = Parameters["lightPosition"];
+            colorParam = Parameters["Color"];
+            lightRadiusParam = Parameters["lightRadius"];
+            lightIntensityParam = Parameters["lightIntensity"];
+            cameraPositionParam = Parameters["cameraPosition"];
+            invertViewProjectionParam = Parameters["InvertViewProjection"];
+
+            lightDirectionParam = Parameters["lightDirection"];
+            innerAngleCosParam = Parameters["innerAngleCos"];
+            outerAngleCosParam = Parameters["outerAngleCos"];
+
+            // IEffectMatrices
+            projectionParam = Parameters["Projection"];
+            viewParam = Parameters["View"];
+            worldParam = Parameters["World"];
+        }
+        
+        #endregion
+    }
+}

+ 33 - 0
Shaders/Deferred/Properties/Aether.Shaders.Deferred.rd.xml

@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+    This file contains Runtime Directives, specifications about types your application accesses
+    through reflection and other dynamic code patterns. Runtime Directives are used to control the
+    .NET Native optimizer and ensure that it does not remove code accessed by your library. If your
+    library does not do any reflection, then you generally do not need to edit this file. However,
+    if your library reflects over types, especially types passed to it or derived from its types,
+    then you should write Runtime Directives.
+
+    The most common use of reflection in libraries is to discover information about types passed
+    to the library. Runtime Directives have three ways to express requirements on types passed to
+    your library.
+
+    1.  Parameter, GenericParameter, TypeParameter, TypeEnumerableParameter
+        Use these directives to reflect over types passed as a parameter.
+
+    2.  SubTypes
+        Use a SubTypes directive to reflect over types derived from another type.
+
+    3.  AttributeImplies
+        Use an AttributeImplies directive to indicate that your library needs to reflect over
+        types or methods decorated with an attribute.
+
+    For more information on writing Runtime Directives for libraries, please visit
+    http://go.microsoft.com/fwlink/?LinkID=391919
+-->
+<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
+  <Library Name="Aether.Shaders.Deferred">
+
+  	<!-- add directives for your library here -->
+
+  </Library>
+</Directives>

+ 26 - 0
Shaders/Deferred/Properties/AssemblyInfo.W10.cs

@@ -0,0 +1,26 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+[assembly: AssemblyTitle("Aether.Shaders.Deferred")]
+[assembly: AssemblyProduct("Aether.Shaders.Deferred")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyCopyright("Copyright ©  Kastellanos Nikolaos 2014-2016")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers 
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
+[assembly: ComVisible(false)]

+ 37 - 0
Shaders/Deferred/Properties/AssemblyInfo.cs

@@ -0,0 +1,37 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+[assembly: AssemblyTitle("Aether.Shaders.Deferred")]
+[assembly: AssemblyProduct("Aether.Shaders.Deferred")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyCopyright("Copyright ©  Kastellanos Nikolaos 2014-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("089a2665-02e6-4cf3-8571-30c768fe35f9")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers 
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
+

+ 25 - 0
Shaders/Deferred/Resources/BuildShaders.bat

@@ -0,0 +1,25 @@
+@echo off
+setlocal
+
+cd %~dp0
+
+SET MGFX="C:\Program Files (x86)\MSBuild\MonoGame\v3.0\Tools\2mgfx.exe"
+SET XNAFX="CompileEffect\CompileEffect.exe"
+
+@echo Build dx11
+@for /f %%f IN ('dir /b *.fx') do (
+    call %MGFX% %%~nf.fx %%~nf.dx11.mgfxo /Profile:DirectX_11
+)
+
+@echo Build ogl
+@for /f %%f IN ('dir /b *.fx') do (
+    call %MGFX% %%~nf.fx %%~nf.ogl.mgfxo
+)
+
+@echo Build dx9/xna Reach
+@for /f %%f IN ('dir /b *.fx') do (
+    call %XNAFX% Windows Reach %%~nf.fx %%~nf.xna.WinReach
+)
+
+endlocal
+@pause

BIN
Shaders/Deferred/Resources/CompileEffect/CompileEffect.exe


+ 3 - 0
Shaders/Deferred/Resources/CompileEffect/CompileEffect.exe.config

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

BIN
Shaders/Deferred/Resources/CompileEffect/Microsoft.Xna.Framework.Content.Pipeline.EffectImporter.dll


BIN
Shaders/Deferred/Resources/DeferredBasicEffect.dx11.mgfxo.7


BIN
Shaders/Deferred/Resources/DeferredBasicEffect.dx11.mgfxo.8


+ 114 - 0
Shaders/Deferred/Resources/DeferredBasicEffect.fx

@@ -0,0 +1,114 @@
+#include "Macros.fxh"
+
+float4x4 World;
+float4x4 View;
+float4x4 Projection;
+float specularIntensity = 0.8f;
+float specularPower = 0.5f; 
+
+texture Texture;
+sampler diffuseSampler = sampler_state
+{
+    Texture = (Texture);
+    MAGFILTER = LINEAR;
+    MINFILTER = LINEAR;
+    MIPFILTER = LINEAR;
+    AddressU = Wrap;
+    AddressV = Wrap;
+};
+
+texture SpecularMap;
+sampler specularSampler = sampler_state
+{
+    Texture = (SpecularMap);
+    MagFilter = LINEAR;
+    MinFilter = LINEAR;
+    Mipfilter = LINEAR;
+    AddressU = Wrap;
+    AddressV = Wrap;
+};
+
+texture NormalMap;
+sampler normalSampler = sampler_state
+{
+    Texture = (NormalMap);
+    MagFilter = LINEAR;
+    MinFilter = LINEAR;
+    Mipfilter = LINEAR;
+    AddressU = Wrap;
+    AddressV = Wrap;
+};
+
+struct VertexShaderInput
+{
+    float4 Position : POSITION0;
+    float3 Normal : NORMAL0;
+    float2 TexCoord : TEXCOORD0;
+    float3 Binormal : BINORMAL0;
+    float3 Tangent : TANGENT0;
+};
+
+struct VertexShaderOutput
+{
+    float4 Position : POSITION0;
+    float2 TexCoord : TEXCOORD0;
+    float2 Depth : TEXCOORD1;
+    float3x3 tangentToWorld : TEXCOORD2;
+};
+
+VertexShaderOutput VertexShaderFunction(VertexShaderInput input)
+{
+    VertexShaderOutput output;
+
+    float4 worldPosition = mul(float4(input.Position.xyz,1), World);
+    float4 viewPosition = mul(worldPosition, View);
+    output.Position = mul(viewPosition, Projection);
+
+    output.TexCoord = input.TexCoord;
+    output.Depth.x = output.Position.z;
+    output.Depth.y = output.Position.w;
+
+    // calculate tangent space to world space matrix using the world space tangent,
+    // binormal, and normal as basis vectors
+    output.tangentToWorld[0] = mul(input.Tangent, World);
+    output.tangentToWorld[1] = mul(input.Binormal, World);
+    output.tangentToWorld[2] = mul(input.Normal, World);
+
+    return output;
+}
+struct PixelShaderOutput
+{
+    half4 Color : COLOR0;
+    half4 Normal : COLOR1;
+    half4 Depth : COLOR2;
+};
+
+PixelShaderOutput PixelShaderFunction(VertexShaderOutput input)
+{
+    PixelShaderOutput output;
+    output.Color = tex2D(diffuseSampler, input.TexCoord);
+    
+    float4 specularAttributes = tex2D(specularSampler, input.TexCoord);
+    //specular Intensity
+    output.Color.a = specularAttributes.r;
+    
+    // read the normal from the normal map
+    float3 normalFromMap = tex2D(normalSampler, input.TexCoord);
+    //tranform to [-1,1]
+    normalFromMap = 2.0f * normalFromMap - 1.0f;
+	normalFromMap = float3(0,0,1); //if we don't have a normalMap do this!
+    //transform into world space
+    normalFromMap = mul(normalFromMap, input.tangentToWorld);
+    //normalize the result
+    normalFromMap = normalize(normalFromMap);
+    //output the normal, in [0,1] space
+    output.Normal.rgb = 0.5f * (normalFromMap + 1.0f);
+	
+    //specular Power
+    output.Normal.a = specularAttributes.a;
+
+    output.Depth = input.Depth.x / input.Depth.y;
+    return output;
+}
+
+TECHNIQUE( Standard, VertexShaderFunction, PixelShaderFunction );

BIN
Shaders/Deferred/Resources/DeferredBasicEffect.ogl.mgfxo.7


BIN
Shaders/Deferred/Resources/DeferredBasicEffect.ogl.mgfxo.8


BIN
Shaders/Deferred/Resources/DeferredBasicEffect.xna.WinReach


BIN
Shaders/Deferred/Resources/DeferredClearGBuffer.dx11.mgfxo.7


BIN
Shaders/Deferred/Resources/DeferredClearGBuffer.dx11.mgfxo.8


+ 41 - 0
Shaders/Deferred/Resources/DeferredClearGBuffer.fx

@@ -0,0 +1,41 @@
+#include "Macros.fxh"
+
+struct VertexShaderInput
+{
+    float3 Position : POSITION0;
+};
+
+struct VertexShaderOutput
+{
+    float4 Position : POSITION0;
+};
+
+VertexShaderOutput VertexShaderFunction(VertexShaderInput input)
+{
+    VertexShaderOutput output;
+    output.Position = float4(input.Position,1);
+    return output;
+}
+struct PixelShaderOutput
+{
+    float4 Color : COLOR0;
+    float4 Normal : COLOR1;
+    float4 Depth : COLOR2;
+};
+
+PixelShaderOutput PixelShaderFunction(VertexShaderOutput input)
+{
+    PixelShaderOutput output;
+    //black color
+    output.Color = 0.0f;
+    output.Color.a = 0.0f;
+    //when transforming 0.5f into [-1,1], we will get 0.0f
+    output.Normal.rgb = 0.5f;
+    //no specular power
+    output.Normal.a = 0.0f;
+    //max depth
+    output.Depth = 0.0f;
+    return output;
+}
+
+TECHNIQUE( Standard, VertexShaderFunction, PixelShaderFunction );

BIN
Shaders/Deferred/Resources/DeferredClearGBuffer.ogl.mgfxo.7


BIN
Shaders/Deferred/Resources/DeferredClearGBuffer.ogl.mgfxo.8


BIN
Shaders/Deferred/Resources/DeferredClearGBuffer.xna.WinReach


BIN
Shaders/Deferred/Resources/DeferredCombine.dx11.mgfxo.7


BIN
Shaders/Deferred/Resources/DeferredCombine.dx11.mgfxo.8


+ 56 - 0
Shaders/Deferred/Resources/DeferredCombine.fx

@@ -0,0 +1,56 @@
+#include "Macros.fxh"
+
+texture colorMap;
+texture lightMap;
+
+sampler colorSampler = sampler_state
+{
+    Texture = (colorMap);
+    AddressU = CLAMP;
+    AddressV = CLAMP;
+    MagFilter = LINEAR;
+    MinFilter = LINEAR;
+    Mipfilter = LINEAR;
+};
+sampler lightSampler = sampler_state
+{
+    Texture = (lightMap);
+    AddressU = CLAMP;
+    AddressV = CLAMP;
+    MagFilter = LINEAR;
+    MinFilter = LINEAR;
+    Mipfilter = LINEAR;
+};
+
+
+struct VertexShaderInput
+{
+    float3 Position : POSITION0;
+    float2 TexCoord : TEXCOORD0;
+};
+
+struct VertexShaderOutput
+{
+    float4 Position : POSITION0;
+    float2 TexCoord : TEXCOORD0;
+};
+
+float2 halfPixel;
+VertexShaderOutput VertexShaderFunction(VertexShaderInput input)
+{
+    VertexShaderOutput output;
+    output.Position = float4(input.Position,1);
+    output.TexCoord = input.TexCoord - halfPixel;
+    return output;
+}
+
+float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0
+{
+    float3 diffuseColor = tex2D(colorSampler,input.TexCoord).rgb;
+    float4 light = tex2D(lightSampler,input.TexCoord);
+    float3 diffuseLight = light.rgb;
+    float specularLight = light.a;
+	return float4((diffuseColor * diffuseLight + specularLight),1);
+}
+
+TECHNIQUE( Standard, VertexShaderFunction, PixelShaderFunction );

BIN
Shaders/Deferred/Resources/DeferredCombine.ogl.mgfxo.7


BIN
Shaders/Deferred/Resources/DeferredCombine.ogl.mgfxo.8


BIN
Shaders/Deferred/Resources/DeferredCombine.xna.WinReach


BIN
Shaders/Deferred/Resources/DeferredPointLight.dx11.mgfxo.7


BIN
Shaders/Deferred/Resources/DeferredPointLight.dx11.mgfxo.8


+ 144 - 0
Shaders/Deferred/Resources/DeferredPointLight.fx

@@ -0,0 +1,144 @@
+#include "Macros.fxh"
+
+float4x4 World;
+float4x4 View;
+float4x4 Projection;
+
+//color of the light 
+float3 Color; 
+
+//position of the camera, for specular light
+float3 cameraPosition; 
+
+//this is used to compute the world-position
+float4x4 InvertViewProjection; 
+
+//this is the position of the light
+float3 lightPosition;
+
+//how far does this light reach
+float lightRadius;
+
+//control the brightness of the light
+float lightIntensity = 1.0f;
+
+// diffuse color, and specularIntensity in the alpha channel
+texture colorMap; 
+// normals, and specularPower in the alpha channel
+texture normalMap;
+//depth
+texture depthMap;
+
+sampler colorSampler = sampler_state
+{
+    Texture = (colorMap);
+    AddressU = CLAMP;
+    AddressV = CLAMP;
+    MagFilter = LINEAR;
+    MinFilter = LINEAR;
+    Mipfilter = LINEAR;
+};
+sampler depthSampler = sampler_state
+{
+    Texture = (depthMap);
+    AddressU = CLAMP;
+    AddressV = CLAMP;
+    MagFilter = POINT;
+    MinFilter = POINT;
+    Mipfilter = POINT;
+};
+sampler normalSampler = sampler_state
+{
+    Texture = (normalMap);
+    AddressU = CLAMP;
+    AddressV = CLAMP;
+    MagFilter = POINT;
+    MinFilter = POINT;
+    Mipfilter = POINT;
+};
+
+
+struct VertexShaderInput
+{
+    float3 Position : POSITION0;
+};
+
+struct VertexShaderOutput
+{
+    float4 Position : POSITION0;
+    float4 ScreenPosition : TEXCOORD0;
+};
+
+VertexShaderOutput VertexShaderFunction(VertexShaderInput input)
+{
+    VertexShaderOutput output;
+    //processing geometry coordinates
+    float4 worldPosition = mul(float4(input.Position,1), World);
+    float4 viewPosition = mul(worldPosition, View);
+    output.Position = mul(viewPosition, Projection);
+    output.ScreenPosition = output.Position;
+    return output;
+}
+
+float2 halfPixel;
+float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0
+{
+    //obtain screen position
+    input.ScreenPosition.xy /= input.ScreenPosition.w;
+
+    //obtain textureCoordinates corresponding to the current pixel
+    //the screen coordinates are in [-1,1]*[1,-1]
+    //the texture coordinates need to be in [0,1]*[0,1]
+    float2 texCoord = 0.5f * (float2(input.ScreenPosition.x,-input.ScreenPosition.y) + 1);
+    //allign texels to pixels
+    texCoord -=halfPixel;
+
+    //get normal data from the normalMap
+    float4 normalData = tex2D(normalSampler,texCoord);
+    //tranform normal back into [-1,1] range
+    float3 normal = 2.0f * normalData.xyz - 1.0f;
+	
+    //get specular power
+    float specularPower = normalData.a * 255;
+    //get specular intensity from the colorMap
+    float specularIntensity = tex2D(colorSampler, texCoord).a;
+
+    //read depth
+    float depthVal = tex2D(depthSampler,texCoord).r;
+
+    //compute screen-space position
+    float4 position;
+    position.xy = input.ScreenPosition.xy;
+    position.z = depthVal;
+    position.w = 1.0f;
+    //transform to world space
+    position = mul(position, InvertViewProjection);
+    position /= position.w;
+
+    //surface-to-light vector
+    float3 lightVector = lightPosition - position;
+	
+    //compute attenuation based on distance - linear attenuation
+    float attenuation = saturate(1.0f - length(lightVector)/lightRadius);
+
+    //normalize light vector
+    lightVector = normalize(lightVector);
+
+    //compute diffuse light
+    float NdL = max(0,dot(normal, lightVector)+0.2);
+    float3 diffuseLight = NdL * Color.rgb;
+	//float3 diffuseLight = Color.rgb;
+	//if(NdL==0) return float4(0,0,0,0);
+
+    //reflection vector
+    float3 reflectionVector = normalize(reflect(-lightVector, normal));
+    //camera-to-surface vector
+    float3 directionToCamera = normalize(cameraPosition - position);
+    //compute specular light
+    float specularLight = specularIntensity * pow( saturate(dot(reflectionVector, directionToCamera)), specularPower);
+
+    //take into account attenuation and lightIntensity.
+    return attenuation * lightIntensity * float4(diffuseLight.rgb, specularLight);
+}
+
+TECHNIQUE( Standard, VertexShaderFunction, PixelShaderFunction );

BIN
Shaders/Deferred/Resources/DeferredPointLight.ogl.mgfxo.7


BIN
Shaders/Deferred/Resources/DeferredPointLight.ogl.mgfxo.8


BIN
Shaders/Deferred/Resources/DeferredPointLight.xna.WinReach


BIN
Shaders/Deferred/Resources/DeferredSpotLight.dx11.mgfxo.7


BIN
Shaders/Deferred/Resources/DeferredSpotLight.dx11.mgfxo.8


+ 154 - 0
Shaders/Deferred/Resources/DeferredSpotLight.fx

@@ -0,0 +1,154 @@
+#include "Macros.fxh"
+
+float4x4 World;
+float4x4 View;
+float4x4 Projection;
+
+//color of the light 
+float3 Color; 
+
+//position of the camera, for specular light
+float3 cameraPosition; 
+
+//this is used to compute the world-position
+float4x4 InvertViewProjection; 
+
+//this is the position of the light
+float3 lightPosition;
+
+//how far does this light reach
+float lightRadius;
+
+//direction of the light
+float3 lightDirection;
+//
+float innerAngleCos;
+float outerAngleCos;
+
+//control the brightness of the light
+float lightIntensity = 1.0f;
+
+// diffuse color, and specularIntensity in the alpha channel
+texture colorMap; 
+// normals, and specularPower in the alpha channel
+texture normalMap;
+//depth
+texture depthMap;
+
+sampler colorSampler = sampler_state
+{
+    Texture = (colorMap);
+    AddressU = CLAMP;
+    AddressV = CLAMP;
+    MagFilter = LINEAR;
+    MinFilter = LINEAR;
+    Mipfilter = LINEAR;
+};
+sampler depthSampler = sampler_state
+{
+    Texture = (depthMap);
+    AddressU = CLAMP;
+    AddressV = CLAMP;
+    MagFilter = POINT;
+    MinFilter = POINT;
+    Mipfilter = POINT;
+};
+sampler normalSampler = sampler_state
+{
+    Texture = (normalMap);
+    AddressU = CLAMP;
+    AddressV = CLAMP;
+    MagFilter = POINT;
+    MinFilter = POINT;
+    Mipfilter = POINT;
+};
+
+
+struct VertexShaderInput
+{
+    float3 Position : POSITION0;
+};
+
+struct VertexShaderOutput
+{
+    float4 Position : POSITION0;
+    float4 ScreenPosition : TEXCOORD0;
+};
+
+VertexShaderOutput VertexShaderFunction(VertexShaderInput input)
+{
+    VertexShaderOutput output;
+    //processing geometry coordinates
+    float4 worldPosition = mul(float4(input.Position,1), World);
+    float4 viewPosition = mul(worldPosition, View);
+    output.Position = mul(viewPosition, Projection);
+    output.ScreenPosition = output.Position;
+    return output;
+}
+
+float2 halfPixel;
+float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0
+{
+    //obtain screen position
+    input.ScreenPosition.xy /= input.ScreenPosition.w;
+
+    //obtain textureCoordinates corresponding to the current pixel
+    //the screen coordinates are in [-1,1]*[1,-1]
+    //the texture coordinates need to be in [0,1]*[0,1]
+    float2 texCoord = 0.5f * (float2(input.ScreenPosition.x,-input.ScreenPosition.y) + 1);
+    //allign texels to pixels
+    texCoord -=halfPixel;
+
+    //get normal data from the normalMap
+    float4 normalData = tex2D(normalSampler,texCoord);
+    //tranform normal back into [-1,1] range
+    float3 normal = 2.0f * normalData.xyz - 1.0f;
+    //get specular power
+    float specularPower = normalData.a * 255;
+    //get specular intensity from the colorMap
+    float specularIntensity = tex2D(colorSampler, texCoord).a;
+
+    //read depth
+    float depthVal = tex2D(depthSampler,texCoord).r;
+
+    //compute screen-space position
+    float4 position;
+    position.xy = input.ScreenPosition.xy;
+    position.z = depthVal;
+    position.w = 1.0f;
+    //transform to world space
+    position = mul(position, InvertViewProjection);
+    position /= position.w;
+
+    //surface-to-light vector
+    float3 lightVector = lightPosition - position;
+
+    //compute attenuation based on distance - linear attenuation
+    float attenuation = saturate(1.0f - length(lightVector)/lightRadius);
+
+    //normalize light vector
+    lightVector = normalize(lightVector);
+
+	//spot Attenuation
+	float angleCos = dot(-lightVector, lightDirection);
+	angleCos = max(0,min(1,angleCos));
+	float spotAttenuation = (angleCos-innerAngleCos)*(1/(outerAngleCos-innerAngleCos));
+	spotAttenuation = 1 - max(0,min(1,spotAttenuation));	
+	
+    //compute diffuse light
+    float NdL = max(0,dot(normal,lightVector));
+    //float3 diffuseLight = NdL * Color.rgb;
+	float3 diffuseLight = Color.rgb;
+
+    //reflection vector
+    float3 reflectionVector = normalize(reflect(-lightVector, normal));
+    //camera-to-surface vector
+    float3 directionToCamera = normalize(cameraPosition - position);
+    //compute specular light
+    float specularLight = specularIntensity * pow( saturate(dot(reflectionVector, directionToCamera)), specularPower);
+
+    //take into account attenuation and lightIntensity.
+    return spotAttenuation * attenuation * lightIntensity * float4(diffuseLight.rgb,specularLight);
+}
+
+TECHNIQUE( Standard, VertexShaderFunction, PixelShaderFunction );

BIN
Shaders/Deferred/Resources/DeferredSpotLight.ogl.mgfxo.7


BIN
Shaders/Deferred/Resources/DeferredSpotLight.ogl.mgfxo.8


BIN
Shaders/Deferred/Resources/DeferredSpotLight.xna.WinReach


+ 61 - 0
Shaders/Deferred/Resources/Macros.fxh

@@ -0,0 +1,61 @@
+//-----------------------------------------------------------------------------
+// Macros.fxh
+//
+// Microsoft XNA Community Game Platform
+// Copyright (C) Microsoft Corporation. All rights reserved.
+//-----------------------------------------------------------------------------
+
+#ifdef SM4
+
+// Macros for targetting shader model 4.0 (DX11)
+
+#define TECHNIQUE(name, vsname, psname ) \
+	technique name { pass { VertexShader = compile vs_4_0_level_9_1 vsname (); PixelShader = compile ps_4_0_level_9_1 psname(); } }
+
+#define BEGIN_CONSTANTS     cbuffer Parameters : register(b0) {
+#define MATRIX_CONSTANTS
+#define END_CONSTANTS       };
+
+#define _vs(r)
+#define _ps(r)
+#define _cb(r)
+
+#define DECLARE_TEXTURE(Name, index) \
+    Texture2D<float4> Name : register(t##index); \
+    sampler Name##Sampler : register(s##index)
+
+#define DECLARE_CUBEMAP(Name, index) \
+    TextureCube<float4> Name : register(t##index); \
+    sampler Name##Sampler : register(s##index)
+
+#define SAMPLE_TEXTURE(Name, texCoord)  Name.Sample(Name##Sampler, texCoord)
+#define SAMPLE_CUBEMAP(Name, texCoord)  Name.Sample(Name##Sampler, texCoord)
+
+
+#else
+
+
+// Macros for targetting shader model 2.0 (DX9)
+
+#define TECHNIQUE(name, vsname, psname ) \
+	technique name { pass { VertexShader = compile vs_2_0 vsname (); PixelShader = compile ps_2_0 psname(); } }
+
+#define BEGIN_CONSTANTS
+#define MATRIX_CONSTANTS
+#define END_CONSTANTS
+
+#define _vs(r)  : register(vs, r)
+#define _ps(r)  : register(ps, r)
+#define _cb(r)
+
+#define DECLARE_TEXTURE(Name, index) \
+    sampler2D Name : register(s##index);
+
+#define DECLARE_CUBEMAP(Name, index) \
+    samplerCUBE Name : register(s##index);
+
+#define SAMPLE_TEXTURE(Name, texCoord)  tex2D(Name, texCoord)
+#define SAMPLE_CUBEMAP(Name, texCoord)  texCUBE(Name, texCoord)
+
+
+#endif

+ 4 - 0
Shaders/Deferred/packages.config

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+  <package id="MonoGame.Framework.Portable" version="3.2.99.1-Beta" targetFramework="portable-net45+win+wp80+MonoAndroid10+xamarinios10+MonoTouch10" />
+</packages>

BIN
bin/Release/W10/Aether.Shaders.Deferred.dll


BIN
bin/Release/W10/Aether.Shaders.Deferred.pri


+ 33 - 0
bin/Release/W10/Aether.Shaders.Deferred/Properties/Aether.Shaders.Deferred.rd.xml

@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+    This file contains Runtime Directives, specifications about types your application accesses
+    through reflection and other dynamic code patterns. Runtime Directives are used to control the
+    .NET Native optimizer and ensure that it does not remove code accessed by your library. If your
+    library does not do any reflection, then you generally do not need to edit this file. However,
+    if your library reflects over types, especially types passed to it or derived from its types,
+    then you should write Runtime Directives.
+
+    The most common use of reflection in libraries is to discover information about types passed
+    to the library. Runtime Directives have three ways to express requirements on types passed to
+    your library.
+
+    1.  Parameter, GenericParameter, TypeParameter, TypeEnumerableParameter
+        Use these directives to reflect over types passed as a parameter.
+
+    2.  SubTypes
+        Use a SubTypes directive to reflect over types derived from another type.
+
+    3.  AttributeImplies
+        Use an AttributeImplies directive to indicate that your library needs to reflect over
+        types or methods decorated with an attribute.
+
+    For more information on writing Runtime Directives for libraries, please visit
+    http://go.microsoft.com/fwlink/?LinkID=391919
+-->
+<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
+  <Library Name="Aether.Shaders.Deferred">
+
+  	<!-- add directives for your library here -->
+
+  </Library>
+</Directives>

BIN
bin/Release/W8_1/Aether.Shaders.Deferred.dll


BIN
bin/Release/W8_1/Aether.Shaders.Deferred.pri


BIN
bin/Release/Windows.XNA/Aether.Shaders.Deferred.dll


BIN
bin/Release/Windows/Aether.Shaders.Deferred.dll


+ 1 - 0
packages/repositories.config

@@ -6,5 +6,6 @@
   <repository path="..\Content.Pipeline\GraphicsImporters\packages.config" />
   <repository path="..\Content.Pipeline\GraphicsImporters\packages.config" />
   <repository path="..\Content.Pipeline\RawModelProcessor\packages.config" />
   <repository path="..\Content.Pipeline\RawModelProcessor\packages.config" />
   <repository path="..\Graphics\packages.config" />
   <repository path="..\Graphics\packages.config" />
+  <repository path="..\Shaders\Deferred\packages.config" />
   <repository path="..\Shaders\FXAA\packages.config" />
   <repository path="..\Shaders\FXAA\packages.config" />
 </repositories>
 </repositories>