diff --git a/ANX.Framework/ANX.Framework.csproj b/ANX.Framework/ANX.Framework.csproj index a82117f2..4e8be964 100644 --- a/ANX.Framework/ANX.Framework.csproj +++ b/ANX.Framework/ANX.Framework.csproj @@ -75,9 +75,15 @@ + + + + + + @@ -132,7 +138,7 @@ - + @@ -177,11 +183,14 @@ + + + @@ -256,6 +265,7 @@ + diff --git a/ANX.Framework/Content/GraphicTypeReaders/AlphaTestEffectReader.cs b/ANX.Framework/Content/GraphicTypeReaders/AlphaTestEffectReader.cs new file mode 100644 index 00000000..1f1fc4a6 --- /dev/null +++ b/ANX.Framework/Content/GraphicTypeReaders/AlphaTestEffectReader.cs @@ -0,0 +1,76 @@ +#region Using Statements +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using ANX.Framework.NonXNA; +using ANX.Framework.Graphics; + +#endregion // Using Statements + +#region License + +// +// This file is part of the ANX.Framework created by the "ANX.Framework developer group". +// +// This file is released under the Ms-PL license. +// +// +// +// Microsoft Public License (Ms-PL) +// +// This license governs use of the accompanying software. If you use the software, you accept this license. +// If you do not accept the license, do not use the software. +// +// 1.Definitions +// The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning +// here as under U.S. copyright law. +// A "contribution" is the original software, or any additions or changes to the software. +// A "contributor" is any person that distributes its contribution under this license. +// "Licensed patents" are a contributor's patent claims that read directly on its contribution. +// +// 2.Grant of Rights +// (A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations +// in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to +// reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution +// or any derivative works that you create. +// (B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in +// section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed +// patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution +// in the software or derivative works of the contribution in the software. +// +// 3.Conditions and Limitations +// (A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks. +// (B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your +// patent license from such contributor to the software ends automatically. +// (C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution +// notices that are present in the software. +// (D) If you distribute any portion of the software in source code form, you may do so only under this license by including +// a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or +// object code form, you may only do so under a license that complies with this license. +// (E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees, +// or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the +// extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a +// particular purpose and non-infringement. + +#endregion // License + +namespace ANX.Framework.Content.GraphicTypeReaders +{ + public class AlphaTestEffectReader : ContentTypeReader + { + protected internal override AlphaTestEffect Read(ContentReader input, AlphaTestEffect existingInstance) + { + var graphics = input.ResolveGraphicsDevice(); + var effect = new AlphaTestEffect(graphics); + + effect.Texture = input.ReadExternalReference(); + effect.AlphaFunction = (CompareFunction)input.ReadInt32(); + effect.ReferenceAlpha = input.ReadInt32(); + effect.DiffuseColor = input.ReadVector3(); + effect.Alpha = input.ReadSingle(); + effect.VertexColorEnabled = input.ReadBoolean(); + return effect; + } + } +} \ No newline at end of file diff --git a/ANX.Framework/Content/GraphicTypeReaders/BasicEffectReader.cs b/ANX.Framework/Content/GraphicTypeReaders/BasicEffectReader.cs new file mode 100644 index 00000000..cc8fb458 --- /dev/null +++ b/ANX.Framework/Content/GraphicTypeReaders/BasicEffectReader.cs @@ -0,0 +1,81 @@ +#region Using Statements +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using ANX.Framework.NonXNA; +using ANX.Framework.Graphics; + +#endregion // Using Statements + +#region License + +// +// This file is part of the ANX.Framework created by the "ANX.Framework developer group". +// +// This file is released under the Ms-PL license. +// +// +// +// Microsoft Public License (Ms-PL) +// +// This license governs use of the accompanying software. If you use the software, you accept this license. +// If you do not accept the license, do not use the software. +// +// 1.Definitions +// The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning +// here as under U.S. copyright law. +// A "contribution" is the original software, or any additions or changes to the software. +// A "contributor" is any person that distributes its contribution under this license. +// "Licensed patents" are a contributor's patent claims that read directly on its contribution. +// +// 2.Grant of Rights +// (A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations +// in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to +// reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution +// or any derivative works that you create. +// (B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in +// section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed +// patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution +// in the software or derivative works of the contribution in the software. +// +// 3.Conditions and Limitations +// (A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks. +// (B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your +// patent license from such contributor to the software ends automatically. +// (C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution +// notices that are present in the software. +// (D) If you distribute any portion of the software in source code form, you may do so only under this license by including +// a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or +// object code form, you may only do so under a license that complies with this license. +// (E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees, +// or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the +// extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a +// particular purpose and non-infringement. + +#endregion // License + +namespace ANX.Framework.Content.GraphicTypeReaders +{ + public class BasicEffectReader : ContentTypeReader + { + protected internal override BasicEffect Read(ContentReader input, BasicEffect existingInstance) + { + var graphics = input.ResolveGraphicsDevice(); + var effect = new BasicEffect(graphics); + Texture2D texture = input.ReadExternalReference(); + if (texture != null) + { + effect.Texture = texture; + effect.TextureEnabled = true; + } + effect.DiffuseColor = input.ReadVector3(); + effect.EmissiveColor = input.ReadVector3(); + effect.SpecularColor = input.ReadVector3(); + effect.SpecularPower = input.ReadSingle(); + effect.Alpha = input.ReadSingle(); + effect.VertexColorEnabled = input.ReadBoolean(); + return effect; + } + } +} diff --git a/ANX.Framework/Content/GraphicTypeReaders/DualTextureEffectReader.cs b/ANX.Framework/Content/GraphicTypeReaders/DualTextureEffectReader.cs new file mode 100644 index 00000000..54f1f84e --- /dev/null +++ b/ANX.Framework/Content/GraphicTypeReaders/DualTextureEffectReader.cs @@ -0,0 +1,75 @@ +#region Using Statements +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using ANX.Framework.NonXNA; +using ANX.Framework.Graphics; + +#endregion // Using Statements + +#region License + +// +// This file is part of the ANX.Framework created by the "ANX.Framework developer group". +// +// This file is released under the Ms-PL license. +// +// +// +// Microsoft Public License (Ms-PL) +// +// This license governs use of the accompanying software. If you use the software, you accept this license. +// If you do not accept the license, do not use the software. +// +// 1.Definitions +// The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning +// here as under U.S. copyright law. +// A "contribution" is the original software, or any additions or changes to the software. +// A "contributor" is any person that distributes its contribution under this license. +// "Licensed patents" are a contributor's patent claims that read directly on its contribution. +// +// 2.Grant of Rights +// (A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations +// in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to +// reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution +// or any derivative works that you create. +// (B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in +// section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed +// patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution +// in the software or derivative works of the contribution in the software. +// +// 3.Conditions and Limitations +// (A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks. +// (B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your +// patent license from such contributor to the software ends automatically. +// (C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution +// notices that are present in the software. +// (D) If you distribute any portion of the software in source code form, you may do so only under this license by including +// a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or +// object code form, you may only do so under a license that complies with this license. +// (E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees, +// or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the +// extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a +// particular purpose and non-infringement. + +#endregion // License + +namespace ANX.Framework.Content.GraphicTypeReaders +{ + public class DualTextureEffectReader : ContentTypeReader + { + protected internal override DualTextureEffect Read(ContentReader input, DualTextureEffect existingInstance) + { + var graphics = input.ResolveGraphicsDevice(); + var effect = new DualTextureEffect(graphics); + + effect.Texture =input.ReadExternalReference(); + effect.Texture2 = input.ReadExternalReference(); + effect.DiffuseColor = input.ReadVector3(); + effect.Alpha = input.ReadSingle(); + effect.VertexColorEnabled = input.ReadBoolean(); + return effect; + } + } +} diff --git a/ANX.Framework/Content/GraphicTypeReaders/EffectMaterialReader.cs b/ANX.Framework/Content/GraphicTypeReaders/EffectMaterialReader.cs new file mode 100644 index 00000000..05d52d26 --- /dev/null +++ b/ANX.Framework/Content/GraphicTypeReaders/EffectMaterialReader.cs @@ -0,0 +1,225 @@ +#region Using Statements +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using ANX.Framework.NonXNA; +using ANX.Framework.Graphics; + +#endregion // Using Statements + +#region License + +// +// This file is part of the ANX.Framework created by the "ANX.Framework developer group". +// +// This file is released under the Ms-PL license. +// +// +// +// Microsoft Public License (Ms-PL) +// +// This license governs use of the accompanying software. If you use the software, you accept this license. +// If you do not accept the license, do not use the software. +// +// 1.Definitions +// The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning +// here as under U.S. copyright law. +// A "contribution" is the original software, or any additions or changes to the software. +// A "contributor" is any person that distributes its contribution under this license. +// "Licensed patents" are a contributor's patent claims that read directly on its contribution. +// +// 2.Grant of Rights +// (A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations +// in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to +// reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution +// or any derivative works that you create. +// (B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in +// section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed +// patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution +// in the software or derivative works of the contribution in the software. +// +// 3.Conditions and Limitations +// (A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks. +// (B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your +// patent license from such contributor to the software ends automatically. +// (C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution +// notices that are present in the software. +// (D) If you distribute any portion of the software in source code form, you may do so only under this license by including +// a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or +// object code form, you may only do so under a license that complies with this license. +// (E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees, +// or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the +// extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a +// particular purpose and non-infringement. + +#endregion // License + +namespace ANX.Framework.Content.GraphicTypeReaders +{ + public class EffectMaterialReader : ContentTypeReader + { + protected internal override EffectMaterial Read(ContentReader input, EffectMaterial existingInstance) + { + Effect clonedEffect = input.ReadExternalReference(); + EffectMaterial effectMaterial = new EffectMaterial(clonedEffect); + Dictionary dictionary = input.ReadObject>(); + foreach (KeyValuePair pair in dictionary) + { + SetMaterialParameter(effectMaterial, pair.Key, pair.Value); + } + return effectMaterial; + } + + private void SetMaterialParameter(EffectMaterial material, string key, object value) + { + EffectParameter parameter = material.Parameters[key]; + if (parameter != null) + { + Type type = value.GetType(); + try + { + if (type == typeof(int[])) + { + parameter.SetValue((int[])value); + } + else if (type == typeof(bool[])) + { + parameter.SetValue((bool[])value); + } + else if (type == typeof(float[])) + { + parameter.SetValue((float[])value); + } + else if (type == typeof(Vector2[])) + { + parameter.SetValue((Vector2[])value); + } + else if (type == typeof(Vector3[])) + { + parameter.SetValue((Vector3[])value); + } + else if (type == typeof(Vector4[])) + { + parameter.SetValue((Vector4[])value); + } + else if (type == typeof(Matrix[])) + { + parameter.SetValue((Matrix[])value); + } + else if (type == typeof(int)) + { + parameter.SetValue((int)value); + } + else if (type == typeof(bool)) + { + parameter.SetValue((bool)value); + } + else if (type == typeof(float)) + { + parameter.SetValue((float)value); + } + else if (type == typeof(Vector2)) + { + parameter.SetValue((Vector2)value); + } + else if (type == typeof(Vector3)) + { + parameter.SetValue((Vector3)value); + } + else if (type == typeof(Vector4)) + { + parameter.SetValue((Vector4)value); + } + else if (type == typeof(Matrix)) + { + parameter.SetValue((Matrix)value); + } + else if (type == typeof(string)) + { + parameter.SetValue((string)value); + } + else + { + Texture texture = value as Texture; + if (texture != null) + { + parameter.SetValue(texture); + } + } + } + catch (InvalidCastException) + { + if (parameter.ColumnCount == 1) + { + if (type == typeof(Vector2)) + { + parameter.SetValue(((Vector2)value).X); + } + else if (type == typeof(Vector3)) + { + parameter.SetValue(((Vector3)value).X); + } + else if (type == typeof(Vector4)) + { + parameter.SetValue(((Vector4)value).X); + } + } + if (parameter.ColumnCount == 2) + { + if (type == typeof(Vector2)) + { + parameter.SetValue(((Vector2)value)); + } + else if (type == typeof(Vector3)) + { + Vector3 v = (Vector3)value; + parameter.SetValue(new Vector2(v.X, v.Y)); + } + else if (type == typeof(Vector4)) + { + Vector4 v = (Vector4)value; + parameter.SetValue(new Vector2(v.X, v.Y)); + } + } + if (parameter.ColumnCount == 3) + { + if (type == typeof(Vector2)) + { + Vector2 v = (Vector2)value; + parameter.SetValue(new Vector3(v.X, v.Y, 0)); + } + else if (type == typeof(Vector3)) + { + Vector3 v = (Vector3)value; + parameter.SetValue(v); + } + else if (type == typeof(Vector4)) + { + Vector4 v = (Vector4)value; + parameter.SetValue(new Vector3(v.X, v.Y, v.Z)); + } + } + if (parameter.ColumnCount == 4) + { + if (type == typeof(Vector2)) + { + Vector2 v = (Vector2)value; + parameter.SetValue(new Vector4(v.X, v.Y, 0, 1)); + } + else if (type == typeof(Vector3)) + { + Vector3 v = (Vector3)value; + parameter.SetValue(new Vector4(v, 1)); + } + else if (type == typeof(Vector4)) + { + Vector4 v = (Vector4)value; + parameter.SetValue(v); + } + } + } + } + } + } +} diff --git a/ANX.Framework/Content/GraphicTypeReaders/EnvironmentMapEffectReader.cs b/ANX.Framework/Content/GraphicTypeReaders/EnvironmentMapEffectReader.cs new file mode 100644 index 00000000..3a53ba53 --- /dev/null +++ b/ANX.Framework/Content/GraphicTypeReaders/EnvironmentMapEffectReader.cs @@ -0,0 +1,77 @@ +#region Using Statements +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using ANX.Framework.NonXNA; +using ANX.Framework.Graphics; + +#endregion // Using Statements + +#region License + +// +// This file is part of the ANX.Framework created by the "ANX.Framework developer group". +// +// This file is released under the Ms-PL license. +// +// +// +// Microsoft Public License (Ms-PL) +// +// This license governs use of the accompanying software. If you use the software, you accept this license. +// If you do not accept the license, do not use the software. +// +// 1.Definitions +// The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning +// here as under U.S. copyright law. +// A "contribution" is the original software, or any additions or changes to the software. +// A "contributor" is any person that distributes its contribution under this license. +// "Licensed patents" are a contributor's patent claims that read directly on its contribution. +// +// 2.Grant of Rights +// (A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations +// in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to +// reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution +// or any derivative works that you create. +// (B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in +// section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed +// patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution +// in the software or derivative works of the contribution in the software. +// +// 3.Conditions and Limitations +// (A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks. +// (B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your +// patent license from such contributor to the software ends automatically. +// (C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution +// notices that are present in the software. +// (D) If you distribute any portion of the software in source code form, you may do so only under this license by including +// a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or +// object code form, you may only do so under a license that complies with this license. +// (E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees, +// or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the +// extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a +// particular purpose and non-infringement. + +#endregion // License + +namespace ANX.Framework.Content.GraphicTypeReaders +{ + public class EnvironmentMapEffectReader : ContentTypeReader + { + protected internal override EnvironmentMapEffect Read(ContentReader input, EnvironmentMapEffect existingInstance) + { + var graphics = input.ResolveGraphicsDevice(); + var effect = new EnvironmentMapEffect(graphics); + effect.Texture = input.ReadExternalReference(); + effect.EnvironmentMap = input.ReadExternalReference(); + effect.EnvironmentMapAmount = input.ReadSingle(); + effect.EnvironmentMapSpecular = input.ReadVector3(); + effect.FresnelFactor = input.ReadSingle(); + effect.DiffuseColor = input.ReadVector3(); + effect.EmissiveColor = input.ReadVector3(); + effect.Alpha = input.ReadSingle(); + return effect; + } + } +} diff --git a/ANX.Framework/Content/GraphicTypeReaders/SkinnedEffectReader.cs b/ANX.Framework/Content/GraphicTypeReaders/SkinnedEffectReader.cs new file mode 100644 index 00000000..5ed43194 --- /dev/null +++ b/ANX.Framework/Content/GraphicTypeReaders/SkinnedEffectReader.cs @@ -0,0 +1,78 @@ +#region Using Statements +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using ANX.Framework.NonXNA; +using ANX.Framework.Graphics; + +#endregion // Using Statements + +#region License + +// +// This file is part of the ANX.Framework created by the "ANX.Framework developer group". +// +// This file is released under the Ms-PL license. +// +// +// +// Microsoft Public License (Ms-PL) +// +// This license governs use of the accompanying software. If you use the software, you accept this license. +// If you do not accept the license, do not use the software. +// +// 1.Definitions +// The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning +// here as under U.S. copyright law. +// A "contribution" is the original software, or any additions or changes to the software. +// A "contributor" is any person that distributes its contribution under this license. +// "Licensed patents" are a contributor's patent claims that read directly on its contribution. +// +// 2.Grant of Rights +// (A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations +// in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to +// reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution +// or any derivative works that you create. +// (B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in +// section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed +// patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution +// in the software or derivative works of the contribution in the software. +// +// 3.Conditions and Limitations +// (A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks. +// (B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your +// patent license from such contributor to the software ends automatically. +// (C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution +// notices that are present in the software. +// (D) If you distribute any portion of the software in source code form, you may do so only under this license by including +// a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or +// object code form, you may only do so under a license that complies with this license. +// (E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees, +// or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the +// extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a +// particular purpose and non-infringement. + +#endregion // License + +namespace ANX.Framework.Content.GraphicTypeReaders +{ + public class SkinnedEffectReader : ContentTypeReader + { + protected internal override SkinnedEffect Read(ContentReader input, SkinnedEffect existingInstance) + { + var graphics = input.ResolveGraphicsDevice(); + var effect = new SkinnedEffect(graphics); + + effect.Texture = input.ReadExternalReference(); + effect.WeightsPerVertex = input.ReadInt32(); + effect.DiffuseColor = input.ReadVector3(); + effect.EmissiveColor = input.ReadVector3(); + effect.SpecularColor = input.ReadVector3(); + effect.SpecularPower = input.ReadSingle(); + effect.Alpha = input.ReadSingle(); + + return effect; + } + } +} diff --git a/ANX.Framework/Graphics/BasicEffect.cs b/ANX.Framework/Graphics/BasicEffect.cs new file mode 100644 index 00000000..e76fbd04 --- /dev/null +++ b/ANX.Framework/Graphics/BasicEffect.cs @@ -0,0 +1,316 @@ +#region Using Statements +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using ANX.Framework.NonXNA; +using ANX.Framework.Graphics; + +#endregion // Using Statements + +#region License + +// +// This file is part of the ANX.Framework created by the "ANX.Framework developer group". +// +// This file is released under the Ms-PL license. +// +// +// +// Microsoft Public License (Ms-PL) +// +// This license governs use of the accompanying software. If you use the software, you accept this license. +// If you do not accept the license, do not use the software. +// +// 1.Definitions +// The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning +// here as under U.S. copyright law. +// A "contribution" is the original software, or any additions or changes to the software. +// A "contributor" is any person that distributes its contribution under this license. +// "Licensed patents" are a contributor's patent claims that read directly on its contribution. +// +// 2.Grant of Rights +// (A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations +// in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to +// reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution +// or any derivative works that you create. +// (B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in +// section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed +// patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution +// in the software or derivative works of the contribution in the software. +// +// 3.Conditions and Limitations +// (A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks. +// (B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your +// patent license from such contributor to the software ends automatically. +// (C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution +// notices that are present in the software. +// (D) If you distribute any portion of the software in source code form, you may do so only under this license by including +// a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or +// object code form, you may only do so under a license that complies with this license. +// (E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees, +// or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the +// extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a +// particular purpose and non-infringement. + +#endregion // License + + +namespace ANX.Framework.Graphics +{ + public class BasicEffect : Effect, IEffectMatrices, IEffectLights, IEffectFog + { + public BasicEffect(GraphicsDevice graphics) + : base(graphics, null) + { + throw new NotImplementedException(); + } + + protected BasicEffect(BasicEffect cloneSource) + : base(cloneSource) + { + throw new NotImplementedException(); + } + + public bool PreferPerPixelLighting + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public Matrix Projection + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public Matrix View + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public Matrix World + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public void EnableDefaultLighting() + { + throw new NotImplementedException(); + } + + public Vector3 AmbientLightColor + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public DirectionalLight DirectionalLight0 + { + get { throw new NotImplementedException(); } + } + + public DirectionalLight DirectionalLight1 + { + get { throw new NotImplementedException(); } + } + + public DirectionalLight DirectionalLight2 + { + get { throw new NotImplementedException(); } + } + + public bool LightingEnabled + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public Vector3 FogColor + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public bool FogEnabled + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public float FogEnd + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public float FogStart + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public Texture2D Texture + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public bool TextureEnabled + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public Vector3 DiffuseColor + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public Vector3 EmissiveColor + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public Vector3 SpecularColor + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public float SpecularPower + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public float Alpha + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public bool VertexColorEnabled + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public override Effect Clone() + { + return new BasicEffect(this); + } + } +} diff --git a/ANX.Framework/Graphics/DualTextureEffect.cs b/ANX.Framework/Graphics/DualTextureEffect.cs new file mode 100644 index 00000000..45d5a9d1 --- /dev/null +++ b/ANX.Framework/Graphics/DualTextureEffect.cs @@ -0,0 +1,221 @@ +#region Using Statements +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +#endregion // Using Statements + +#region License + +// +// This file is part of the ANX.Framework created by the "ANX.Framework developer group". +// +// This file is released under the Ms-PL license. +// +// +// +// Microsoft Public License (Ms-PL) +// +// This license governs use of the accompanying software. If you use the software, you accept this license. +// If you do not accept the license, do not use the software. +// +// 1.Definitions +// The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning +// here as under U.S. copyright law. +// A "contribution" is the original software, or any additions or changes to the software. +// A "contributor" is any person that distributes its contribution under this license. +// "Licensed patents" are a contributor's patent claims that read directly on its contribution. +// +// 2.Grant of Rights +// (A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations +// in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to +// reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution +// or any derivative works that you create. +// (B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in +// section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed +// patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution +// in the software or derivative works of the contribution in the software. +// +// 3.Conditions and Limitations +// (A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks. +// (B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your +// patent license from such contributor to the software ends automatically. +// (C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution +// notices that are present in the software. +// (D) If you distribute any portion of the software in source code form, you may do so only under this license by including +// a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or +// object code form, you may only do so under a license that complies with this license. +// (E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees, +// or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the +// extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a +// particular purpose and non-infringement. + +#endregion // License + +namespace ANX.Framework.Graphics +{ + public class DualTextureEffect : Effect, IEffectMatrices, IEffectFog + { + public DualTextureEffect(GraphicsDevice graphics) + : base(graphics, null) + { + throw new NotImplementedException(); + } + + protected DualTextureEffect(DualTextureEffect cloneSource) + : base(cloneSource) + { + throw new NotImplementedException(); + } + + public override Effect Clone() + { + return new DualTextureEffect(this); + } + + public Matrix Projection + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public Matrix View + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public Matrix World + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public Vector3 FogColor + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public bool FogEnabled + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public float FogEnd + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public float FogStart + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public Texture2D Texture + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public Texture2D Texture2 + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public Vector3 DiffuseColor + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public float Alpha + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public bool VertexColorEnabled + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + } +} diff --git a/ANX.Framework/Graphics/EnvironmentMapEffect.cs b/ANX.Framework/Graphics/EnvironmentMapEffect.cs new file mode 100644 index 00000000..1f9d8737 --- /dev/null +++ b/ANX.Framework/Graphics/EnvironmentMapEffect.cs @@ -0,0 +1,301 @@ +#region Using Statements +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +#endregion // Using Statements + +#region License + +// +// This file is part of the ANX.Framework created by the "ANX.Framework developer group". +// +// This file is released under the Ms-PL license. +// +// +// +// Microsoft Public License (Ms-PL) +// +// This license governs use of the accompanying software. If you use the software, you accept this license. +// If you do not accept the license, do not use the software. +// +// 1.Definitions +// The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning +// here as under U.S. copyright law. +// A "contribution" is the original software, or any additions or changes to the software. +// A "contributor" is any person that distributes its contribution under this license. +// "Licensed patents" are a contributor's patent claims that read directly on its contribution. +// +// 2.Grant of Rights +// (A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations +// in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to +// reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution +// or any derivative works that you create. +// (B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in +// section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed +// patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution +// in the software or derivative works of the contribution in the software. +// +// 3.Conditions and Limitations +// (A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks. +// (B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your +// patent license from such contributor to the software ends automatically. +// (C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution +// notices that are present in the software. +// (D) If you distribute any portion of the software in source code form, you may do so only under this license by including +// a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or +// object code form, you may only do so under a license that complies with this license. +// (E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees, +// or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the +// extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a +// particular purpose and non-infringement. + +#endregion // License + +namespace ANX.Framework.Graphics +{ + public class EnvironmentMapEffect : Effect, IEffectMatrices, IEffectLights, IEffectFog + { + public EnvironmentMapEffect(GraphicsDevice graphics) + : base(graphics, null) + { + throw new NotImplementedException(); + } + + protected EnvironmentMapEffect(EnvironmentMapEffect cloneSource) + : base(cloneSource) + { + throw new NotImplementedException(); + } + + public override Effect Clone() + { + return new EnvironmentMapEffect(this); + } + + public Matrix Projection + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public Matrix View + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public Matrix World + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public void EnableDefaultLighting() + { + throw new NotImplementedException(); + } + + public Vector3 AmbientLightColor + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public DirectionalLight DirectionalLight0 + { + get { throw new NotImplementedException(); } + } + + public DirectionalLight DirectionalLight1 + { + get { throw new NotImplementedException(); } + } + + public DirectionalLight DirectionalLight2 + { + get { throw new NotImplementedException(); } + } + + public bool LightingEnabled + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public Vector3 FogColor + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public bool FogEnabled + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public float FogEnd + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public float FogStart + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public Texture2D Texture + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public TextureCube EnvironmentMap + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public float EnvironmentMapAmount + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public Vector3 EnvironmentMapSpecular + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public float FresnelFactor + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public Vector3 DiffuseColor + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public Vector3 EmissiveColor + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public float Alpha + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + } +} diff --git a/ANX.Framework/Graphics/SkinnedEffect.cs b/ANX.Framework/Graphics/SkinnedEffect.cs new file mode 100644 index 00000000..b32f9006 --- /dev/null +++ b/ANX.Framework/Graphics/SkinnedEffect.cs @@ -0,0 +1,317 @@ +#region Using Statements +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using ANX.Framework.NonXNA; +using ANX.Framework.Graphics; + +#endregion // Using Statements + +#region License + +// +// This file is part of the ANX.Framework created by the "ANX.Framework developer group". +// +// This file is released under the Ms-PL license. +// +// +// +// Microsoft Public License (Ms-PL) +// +// This license governs use of the accompanying software. If you use the software, you accept this license. +// If you do not accept the license, do not use the software. +// +// 1.Definitions +// The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning +// here as under U.S. copyright law. +// A "contribution" is the original software, or any additions or changes to the software. +// A "contributor" is any person that distributes its contribution under this license. +// "Licensed patents" are a contributor's patent claims that read directly on its contribution. +// +// 2.Grant of Rights +// (A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations +// in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to +// reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution +// or any derivative works that you create. +// (B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in +// section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed +// patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution +// in the software or derivative works of the contribution in the software. +// +// 3.Conditions and Limitations +// (A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks. +// (B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your +// patent license from such contributor to the software ends automatically. +// (C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution +// notices that are present in the software. +// (D) If you distribute any portion of the software in source code form, you may do so only under this license by including +// a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or +// object code form, you may only do so under a license that complies with this license. +// (E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees, +// or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the +// extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a +// particular purpose and non-infringement. + +#endregion // License + + + +namespace ANX.Framework.Graphics +{ + public class SkinnedEffect : Effect, IEffectMatrices, IEffectLights, IEffectFog + { + public SkinnedEffect(GraphicsDevice graphics) + : base(graphics, null) + { + throw new NotImplementedException(); + } + + protected SkinnedEffect(SkinnedEffect cloneSource) + : base(cloneSource) + { + throw new NotImplementedException(); + } + + public override Effect Clone() + { + return new SkinnedEffect(this); + } + + public const int MaxBones = 72; + + public bool PreferPerPixelLighting + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public Matrix Projection + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public Matrix View + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public Matrix World + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public void EnableDefaultLighting() + { + throw new NotImplementedException(); + } + + public Vector3 AmbientLightColor + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public DirectionalLight DirectionalLight0 + { + get { throw new NotImplementedException(); } + } + + public DirectionalLight DirectionalLight1 + { + get { throw new NotImplementedException(); } + } + + public DirectionalLight DirectionalLight2 + { + get { throw new NotImplementedException(); } + } + + public bool LightingEnabled + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public Vector3 FogColor + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public bool FogEnabled + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public float FogEnd + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public float FogStart + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public Texture2D Texture + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public int WeightsPerVertex + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public Vector3 DiffuseColor + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public Vector3 EmissiveColor + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public Vector3 SpecularColor + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public float SpecularPower + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public float Alpha + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public Matrix[] GetBoneTransforms(int count) + { + throw new NotImplementedException(); + } + + public void SetBoneTransforms(Matrix[] boneTransforms) + { + throw new NotImplementedException(); + } + } +}