From 73b50ab6c3d9d06a90a9e9fc66e986071cb45b13 Mon Sep 17 00:00:00 2001 From: "SND\\AstrorEnales_cp" Date: Tue, 16 Oct 2012 05:49:00 +0000 Subject: [PATCH] - Translated the AlphaTest shader to GLSL (needs some more testing) - Added a bunch of Development attributes - Fixed a class file name that was different from the class name itself --- .../DX10_EffectProcessor.cs | 1 + .../EffectProcessor.cs | 1 + .../GL3_EffectProcessor.cs | 1 + ANX.Framework/ANX.Framework.csproj | 2 +- ANX.Framework/ANX.Framework_Linux.csproj | 2 +- ANX.Framework/ANX.Framework_PSVita.csproj | 2 +- .../ANX.Framework_WindowsMetro.csproj | 2 +- ANX.Framework/Content/ContentLoadException.cs | 2 + ANX.Framework/Content/ContentManager.cs | 1 + ANX.Framework/Content/ContentReader.cs | 1 + .../Content/ContentSerializerAttribute.cs | 23 +- ...tSerializerCollectionItemNameAttribute.cs} | 18 +- .../ContentSerializerIgnoreAttribute.cs | 4 +- .../ContentSerializerRuntimeTypeAttribute.cs | 8 +- .../ContentSerializerTypeVersionAttribute.cs | 10 +- .../Content/ContentTypeReaderManager.cs | 1 + .../EffectMaterialReader.cs | 2 + .../GraphicTypeReaders/EffectReader.cs | 2 +- .../GraphicTypeReaders/IndexBufferReader.cs | 3 +- .../Content/GraphicTypeReaders/ModelReader.cs | 27 +-- .../GraphicTypeReaders/SkinnedEffectReader.cs | 2 + ANX.Framework/Content/ReflectiveReader.cs | 1 + .../Content/ResourceContentManager.cs | 7 +- ANX.Framework/Graphics/RenderTarget2D.cs | 14 +- .../EffectProcessorOutputFormat.cs | 8 +- .../GraphicsDeviceWindowsGL3.cs | 14 +- .../ANX.Framework.GL3/ShaderByteCode.cs | 223 ++++++++++++++---- .../AlphaTestEffectSample.csproj | 4 + .../AlphaTestEffectSample_Linux.csproj | 4 + .../AlphaTestEffectSample_PSVita.csproj | 4 + Samples/AlphaTestEffectSample/Program.cs | 4 +- Tools/StockShaderCodeGenerator/Program.cs | 10 +- shader/GL3/AlphaTest.fx | 166 +++++++++++-- shader/GL3/DualTexture.fx | 28 +-- 34 files changed, 435 insertions(+), 167 deletions(-) rename ANX.Framework/Content/{ContentSerializerItemNameAttribute.cs => ContentSerializerCollectionItemNameAttribute.cs} (59%) diff --git a/ANX.Framework.ContentPipeline/DX10_EffectProcessor.cs b/ANX.Framework.ContentPipeline/DX10_EffectProcessor.cs index a2e372c9..e8adc377 100644 --- a/ANX.Framework.ContentPipeline/DX10_EffectProcessor.cs +++ b/ANX.Framework.ContentPipeline/DX10_EffectProcessor.cs @@ -1,5 +1,6 @@ #region Using Statements using System; +using ANX.Framework.NonXNA.RenderSystem; using Microsoft.Xna.Framework.Content.Pipeline; using ANX.RenderSystem.Windows.DX10; diff --git a/ANX.Framework.ContentPipeline/EffectProcessor.cs b/ANX.Framework.ContentPipeline/EffectProcessor.cs index aadefe9b..59408deb 100644 --- a/ANX.Framework.ContentPipeline/EffectProcessor.cs +++ b/ANX.Framework.ContentPipeline/EffectProcessor.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; using System.Linq; using System.ComponentModel; +using ANX.Framework.NonXNA.RenderSystem; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Content.Pipeline; diff --git a/ANX.Framework.ContentPipeline/GL3_EffectProcessor.cs b/ANX.Framework.ContentPipeline/GL3_EffectProcessor.cs index 08a9adb8..d83ef717 100644 --- a/ANX.Framework.ContentPipeline/GL3_EffectProcessor.cs +++ b/ANX.Framework.ContentPipeline/GL3_EffectProcessor.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.Linq; +using ANX.Framework.NonXNA.RenderSystem; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Content.Pipeline; diff --git a/ANX.Framework/ANX.Framework.csproj b/ANX.Framework/ANX.Framework.csproj index b49d8d2f..32547538 100644 --- a/ANX.Framework/ANX.Framework.csproj +++ b/ANX.Framework/ANX.Framework.csproj @@ -65,7 +65,7 @@ - + diff --git a/ANX.Framework/ANX.Framework_Linux.csproj b/ANX.Framework/ANX.Framework_Linux.csproj index 73aae983..b0eb1963 100644 --- a/ANX.Framework/ANX.Framework_Linux.csproj +++ b/ANX.Framework/ANX.Framework_Linux.csproj @@ -65,7 +65,7 @@ - + diff --git a/ANX.Framework/ANX.Framework_PSVita.csproj b/ANX.Framework/ANX.Framework_PSVita.csproj index e18b9404..45e9578c 100644 --- a/ANX.Framework/ANX.Framework_PSVita.csproj +++ b/ANX.Framework/ANX.Framework_PSVita.csproj @@ -67,7 +67,7 @@ - + diff --git a/ANX.Framework/ANX.Framework_WindowsMetro.csproj b/ANX.Framework/ANX.Framework_WindowsMetro.csproj index 0d02d896..65ee0a8d 100644 --- a/ANX.Framework/ANX.Framework_WindowsMetro.csproj +++ b/ANX.Framework/ANX.Framework_WindowsMetro.csproj @@ -68,7 +68,7 @@ - + diff --git a/ANX.Framework/Content/ContentLoadException.cs b/ANX.Framework/Content/ContentLoadException.cs index 9702822a..d4b55228 100644 --- a/ANX.Framework/Content/ContentLoadException.cs +++ b/ANX.Framework/Content/ContentLoadException.cs @@ -14,7 +14,9 @@ namespace ANX.Framework.Content #if !WINDOWSMETRO //TODO: search replacement for Win8 [SerializableAttribute] #endif + [PercentageComplete(95)] [Developer("GinieDP")] + [TestState(TestStateAttribute.TestState.Untested)] public class ContentLoadException : Exception { /// diff --git a/ANX.Framework/Content/ContentManager.cs b/ANX.Framework/Content/ContentManager.cs index 467a1f60..119dd0db 100644 --- a/ANX.Framework/Content/ContentManager.cs +++ b/ANX.Framework/Content/ContentManager.cs @@ -11,6 +11,7 @@ using ANX.Framework.NonXNA.Development; namespace ANX.Framework.Content { [Developer("GinieDP")] + [TestState(TestStateAttribute.TestState.Untested)] public class ContentManager : IDisposable { #region Constants diff --git a/ANX.Framework/Content/ContentReader.cs b/ANX.Framework/Content/ContentReader.cs index 182e9c4c..e05e42d4 100644 --- a/ANX.Framework/Content/ContentReader.cs +++ b/ANX.Framework/Content/ContentReader.cs @@ -16,6 +16,7 @@ using ANX.Framework.NonXNA.Development; namespace ANX.Framework.Content { [Developer("GinieDP")] + [TestState(TestStateAttribute.TestState.Untested)] public sealed class ContentReader : BinaryReader { private GraphicsProfile graphicsProfile; diff --git a/ANX.Framework/Content/ContentSerializerAttribute.cs b/ANX.Framework/Content/ContentSerializerAttribute.cs index ea196999..ca4242cc 100644 --- a/ANX.Framework/Content/ContentSerializerAttribute.cs +++ b/ANX.Framework/Content/ContentSerializerAttribute.cs @@ -11,7 +11,9 @@ using ANX.Framework.NonXNA.Development; namespace ANX.Framework.Content { [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] + [PercentageComplete(100)] [Developer("GinieDP")] + [TestState(TestStateAttribute.TestState.Untested)] public sealed class ContentSerializerAttribute : Attribute { public string ElementName { get; set; } @@ -20,25 +22,22 @@ namespace ANX.Framework.Content public bool Optional { get; set; } - private bool allowNull = true; - public bool AllowNull - { - get { return this.allowNull; } - set { this.allowNull = value; } - } + public bool AllowNull { get; set; } public bool SharedResource { get; set; } private string collectionItemName; + + public ContentSerializerAttribute() + { + AllowNull = true; + } + public string CollectionItemName { get { - if (string.IsNullOrEmpty(this.collectionItemName)) - { - return "Item"; - } - return this.collectionItemName; + return string.IsNullOrEmpty(this.collectionItemName) ? "Item" : this.collectionItemName; } set { @@ -65,7 +64,7 @@ namespace ANX.Framework.Content ElementName = this.ElementName, FlattenContent = this.FlattenContent, Optional = this.Optional, - allowNull = this.allowNull, + AllowNull = this.AllowNull, SharedResource = this.SharedResource, collectionItemName = this.collectionItemName }; diff --git a/ANX.Framework/Content/ContentSerializerItemNameAttribute.cs b/ANX.Framework/Content/ContentSerializerCollectionItemNameAttribute.cs similarity index 59% rename from ANX.Framework/Content/ContentSerializerItemNameAttribute.cs rename to ANX.Framework/Content/ContentSerializerCollectionItemNameAttribute.cs index d062b161..1578bf81 100644 --- a/ANX.Framework/Content/ContentSerializerItemNameAttribute.cs +++ b/ANX.Framework/Content/ContentSerializerCollectionItemNameAttribute.cs @@ -7,27 +7,21 @@ using ANX.Framework.NonXNA.Development; namespace ANX.Framework.Content { - [AttributeUsage(AttributeTargets.Class)] + [AttributeUsage(AttributeTargets.Class)] + [PercentageComplete(100)] [Developer("GinieDP")] + [TestState(TestStateAttribute.TestState.Untested)] public sealed class ContentSerializerCollectionItemNameAttribute : Attribute { - private string collectionItemName; + public string CollectionItemName { get; private set; } - public string CollectionItemName - { - get - { - return this.collectionItemName; - } - } - - public ContentSerializerCollectionItemNameAttribute(string collectionItemName) + public ContentSerializerCollectionItemNameAttribute(string collectionItemName) { if (string.IsNullOrEmpty(collectionItemName)) { throw new ArgumentNullException("collectionItemName"); } - this.collectionItemName = collectionItemName; + this.CollectionItemName = collectionItemName; } } } diff --git a/ANX.Framework/Content/ContentSerializerIgnoreAttribute.cs b/ANX.Framework/Content/ContentSerializerIgnoreAttribute.cs index 84925c76..b25519f2 100644 --- a/ANX.Framework/Content/ContentSerializerIgnoreAttribute.cs +++ b/ANX.Framework/Content/ContentSerializerIgnoreAttribute.cs @@ -10,8 +10,10 @@ using ANX.Framework.NonXNA.Development; namespace ANX.Framework.Content { - [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] + [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] + [PercentageComplete(100)] [Developer("GinieDP")] + [TestState(TestStateAttribute.TestState.Untested)] public sealed class ContentSerializerIgnoreAttribute : Attribute { } diff --git a/ANX.Framework/Content/ContentSerializerRuntimeTypeAttribute.cs b/ANX.Framework/Content/ContentSerializerRuntimeTypeAttribute.cs index 791cd0f2..0bb60336 100644 --- a/ANX.Framework/Content/ContentSerializerRuntimeTypeAttribute.cs +++ b/ANX.Framework/Content/ContentSerializerRuntimeTypeAttribute.cs @@ -11,14 +11,12 @@ using ANX.Framework.NonXNA.Development; namespace ANX.Framework.Content { [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct)] + [PercentageComplete(100)] [Developer("GinieDP")] + [TestState(TestStateAttribute.TestState.Untested)] public sealed class ContentSerializerRuntimeTypeAttribute : Attribute { - public string RuntimeType - { - get; - private set; - } + public string RuntimeType { get; private set; } public ContentSerializerRuntimeTypeAttribute(string runtimeType) { diff --git a/ANX.Framework/Content/ContentSerializerTypeVersionAttribute.cs b/ANX.Framework/Content/ContentSerializerTypeVersionAttribute.cs index 67b6751f..afae1026 100644 --- a/ANX.Framework/Content/ContentSerializerTypeVersionAttribute.cs +++ b/ANX.Framework/Content/ContentSerializerTypeVersionAttribute.cs @@ -11,15 +11,13 @@ using ANX.Framework.NonXNA.Development; namespace ANX.Framework.Content { [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct)] + [PercentageComplete(100)] [Developer("GinieDP")] + [TestState(TestStateAttribute.TestState.Untested)] public sealed class ContentSerializerTypeVersionAttribute : Attribute { - public int TypeVersion - { - get; - private set; - } - + public int TypeVersion { get; private set; } + public ContentSerializerTypeVersionAttribute(int typeVersion) { this.TypeVersion = typeVersion; diff --git a/ANX.Framework/Content/ContentTypeReaderManager.cs b/ANX.Framework/Content/ContentTypeReaderManager.cs index d7a19293..47182b20 100644 --- a/ANX.Framework/Content/ContentTypeReaderManager.cs +++ b/ANX.Framework/Content/ContentTypeReaderManager.cs @@ -13,6 +13,7 @@ using ANX.Framework.NonXNA.Development; namespace ANX.Framework.Content { [Developer("GinieDP")] + [TestState(TestStateAttribute.TestState.Untested)] public sealed class ContentTypeReaderManager { private ContentReader contentReader; diff --git a/ANX.Framework/Content/GraphicTypeReaders/EffectMaterialReader.cs b/ANX.Framework/Content/GraphicTypeReaders/EffectMaterialReader.cs index c1ff356d..26579810 100644 --- a/ANX.Framework/Content/GraphicTypeReaders/EffectMaterialReader.cs +++ b/ANX.Framework/Content/GraphicTypeReaders/EffectMaterialReader.cs @@ -12,7 +12,9 @@ using ANX.Framework.NonXNA.Development; namespace ANX.Framework.Content { + [PercentageComplete(100)] [Developer("GinieDP")] + [TestState(TestStateAttribute.TestState.Untested)] public class EffectMaterialReader : ContentTypeReader { protected internal override EffectMaterial Read(ContentReader input, EffectMaterial existingInstance) diff --git a/ANX.Framework/Content/GraphicTypeReaders/EffectReader.cs b/ANX.Framework/Content/GraphicTypeReaders/EffectReader.cs index cd65d6f2..d4e47936 100644 --- a/ANX.Framework/Content/GraphicTypeReaders/EffectReader.cs +++ b/ANX.Framework/Content/GraphicTypeReaders/EffectReader.cs @@ -1,10 +1,10 @@ #region Using Statements using System; using System.IO; -using ANX.Framework.ContentPipeline; using ANX.Framework.Graphics; using ANX.Framework.NonXNA; using ANX.Framework.NonXNA.Development; +using ANX.Framework.NonXNA.RenderSystem; #endregion // Using Statements diff --git a/ANX.Framework/Content/GraphicTypeReaders/IndexBufferReader.cs b/ANX.Framework/Content/GraphicTypeReaders/IndexBufferReader.cs index 6d2c4c35..9f1ee6af 100644 --- a/ANX.Framework/Content/GraphicTypeReaders/IndexBufferReader.cs +++ b/ANX.Framework/Content/GraphicTypeReaders/IndexBufferReader.cs @@ -2,7 +2,6 @@ using ANX.Framework.Graphics; using ANX.Framework.NonXNA.Development; - #endregion // Using Statements // This file is part of the ANX.Framework created by the @@ -11,7 +10,9 @@ using ANX.Framework.NonXNA.Development; namespace ANX.Framework.Content { + [PercentageComplete(100)] [Developer("GinieDP")] + [TestState(TestStateAttribute.TestState.Untested)] public class IndexBufferReader : ContentTypeReader { protected internal override IndexBuffer Read(ContentReader input, IndexBuffer existingInstance) diff --git a/ANX.Framework/Content/GraphicTypeReaders/ModelReader.cs b/ANX.Framework/Content/GraphicTypeReaders/ModelReader.cs index 85625d79..10a949e6 100644 --- a/ANX.Framework/Content/GraphicTypeReaders/ModelReader.cs +++ b/ANX.Framework/Content/GraphicTypeReaders/ModelReader.cs @@ -1,7 +1,6 @@ #region Using Statements using System; using ANX.Framework.Graphics; -using ANX.Framework.NonXNA; using ANX.Framework.NonXNA.Development; #endregion // Using Statements @@ -12,25 +11,13 @@ using ANX.Framework.NonXNA.Development; namespace ANX.Framework.Content { + [PercentageComplete(100)] [Developer("GinieDP")] + [TestState(TestStateAttribute.TestState.Untested)] public class ModelReader : ContentTypeReader { protected internal override Model Read(ContentReader input, Model existingInstance) { - IServiceProvider service = input.ContentManager.ServiceProvider; - - var rfc = service.GetService(typeof(IRenderSystemCreator)) as IRenderSystemCreator; - if (rfc == null) - { - throw new ContentLoadException("Service not found IRenderFrameworkCreator"); - } - - var gds = service.GetService(typeof(IGraphicsDeviceService)) as IGraphicsDeviceService; - if (gds == null) - { - throw new ContentLoadException("Service not found IGraphicsDeviceService"); - } - ModelBoneCollection bones = ReadBones(input); ModelMeshCollection meshes = ReadMeshes(input, bones); ModelBone rootBone = ReadBoneReference(input, bones); @@ -69,15 +56,7 @@ namespace ANX.Framework.Content private int ReadBoneIndex(ContentReader reader, int bones) { - int index = 0; - if (bones < 255) - { - index = (int)reader.ReadByte(); - } - else - { - index = (int)reader.ReadInt32(); - } + int index = bones < 255 ? reader.ReadByte() : reader.ReadInt32(); return index - 1; } diff --git a/ANX.Framework/Content/GraphicTypeReaders/SkinnedEffectReader.cs b/ANX.Framework/Content/GraphicTypeReaders/SkinnedEffectReader.cs index 2c045359..e28ba617 100644 --- a/ANX.Framework/Content/GraphicTypeReaders/SkinnedEffectReader.cs +++ b/ANX.Framework/Content/GraphicTypeReaders/SkinnedEffectReader.cs @@ -10,7 +10,9 @@ using ANX.Framework.NonXNA.Development; namespace ANX.Framework.Content { + [PercentageComplete(100)] [Developer("GinieDP")] + [TestState(TestStateAttribute.TestState.Untested)] public class SkinnedEffectReader : ContentTypeReader { protected internal override SkinnedEffect Read(ContentReader input, SkinnedEffect existingInstance) diff --git a/ANX.Framework/Content/ReflectiveReader.cs b/ANX.Framework/Content/ReflectiveReader.cs index 576c70b6..8d201a9c 100644 --- a/ANX.Framework/Content/ReflectiveReader.cs +++ b/ANX.Framework/Content/ReflectiveReader.cs @@ -13,6 +13,7 @@ namespace ANX.Framework.Content #if !WINDOWSMETRO [Developer("GinieDP")] + [TestState(TestStateAttribute.TestState.Untested)] public class ReflectiveReader : ContentTypeReader { private int typeVersion; diff --git a/ANX.Framework/Content/ResourceContentManager.cs b/ANX.Framework/Content/ResourceContentManager.cs index ea545b81..b93e7704 100644 --- a/ANX.Framework/Content/ResourceContentManager.cs +++ b/ANX.Framework/Content/ResourceContentManager.cs @@ -9,13 +9,14 @@ using ANX.Framework.NonXNA.Development; namespace ANX.Framework.Content { + [PercentageComplete(80)] [Developer("GinieDP")] + [TestState(TestStateAttribute.TestState.Untested)] public class ResourceContentManager : ContentManager { - private ResourceManager resource; + private readonly ResourceManager resource; - public ResourceContentManager(IServiceProvider servicesProvider, - ResourceManager resource) + public ResourceContentManager(IServiceProvider servicesProvider, ResourceManager resource) : base(servicesProvider) { if (resource == null) diff --git a/ANX.Framework/Graphics/RenderTarget2D.cs b/ANX.Framework/Graphics/RenderTarget2D.cs index 0968ef51..1a50cdb9 100644 --- a/ANX.Framework/Graphics/RenderTarget2D.cs +++ b/ANX.Framework/Graphics/RenderTarget2D.cs @@ -10,7 +10,7 @@ using ANX.Framework.NonXNA.Development; namespace ANX.Framework.Graphics { - [PercentageComplete(70)] + [PercentageComplete(100)] [TestState(TestStateAttribute.TestState.Untested)] public class RenderTarget2D : Texture2D, IDynamicGraphicsResource { @@ -90,18 +90,16 @@ namespace ANX.Framework.Graphics } #endregion - protected override void Dispose([MarshalAs(UnmanagedType.U1)] bool disposeManaged) - { - throw new NotImplementedException(); - } + protected override void Dispose([MarshalAs(UnmanagedType.U1)] bool disposeManaged) + { + base.Dispose(false); + } - void IDynamicGraphicsResource.SetContentLost(bool isContentLost) + void IDynamicGraphicsResource.SetContentLost(bool isContentLost) { this.IsContentLost = isContentLost; if (isContentLost) raise_ContentLost(this, EventArgs.Empty); - - throw new NotImplementedException(); } protected void raise_ContentLost(object sender, EventArgs args) diff --git a/ANX.Framework/NonXNA/RenderSystem/EffectProcessorOutputFormat.cs b/ANX.Framework/NonXNA/RenderSystem/EffectProcessorOutputFormat.cs index 46d85dfe..2f059a42 100644 --- a/ANX.Framework/NonXNA/RenderSystem/EffectProcessorOutputFormat.cs +++ b/ANX.Framework/NonXNA/RenderSystem/EffectProcessorOutputFormat.cs @@ -1,14 +1,12 @@ -#region Using Statements -using System; - -#endregion // Using Statements +using ANX.Framework.NonXNA.Development; // This file is part of the ANX.Framework created by the // "ANX.Framework developer group" and released under the Ms-PL license. // For details see: http://anxframework.codeplex.com/license -namespace ANX.Framework.ContentPipeline +namespace ANX.Framework.NonXNA.RenderSystem { + [Developer("Glatzemann")] public enum EffectProcessorOutputFormat : byte { XNA_BYTE_CODE = 0, diff --git a/RenderSystems/ANX.Framework.GL3/GraphicsDeviceWindowsGL3.cs b/RenderSystems/ANX.Framework.GL3/GraphicsDeviceWindowsGL3.cs index 77c0aa9b..1270dadb 100644 --- a/RenderSystems/ANX.Framework.GL3/GraphicsDeviceWindowsGL3.cs +++ b/RenderSystems/ANX.Framework.GL3/GraphicsDeviceWindowsGL3.cs @@ -246,7 +246,12 @@ namespace ANX.RenderSystem.GL3 #region DrawIndexedPrimitives public void DrawIndexedPrimitives(PrimitiveType primitiveType, int baseVertex, int minVertexIndex, int numVertices, int startIndex, int primitiveCount, IndexBuffer indexBuffer) - { + { + if (indexBuffer != null) + { + SetIndexBuffer(indexBuffer); + } + // TODO: baseVertex, minVertexIndex, numVertices, startIndex DrawElementsType elementsType = boundIndexBuffer.elementSize == IndexElementSize.SixteenBits ? DrawElementsType.UnsignedShort : @@ -264,7 +269,12 @@ namespace ANX.RenderSystem.GL3 public void DrawInstancedPrimitives(PrimitiveType primitiveType, int baseVertex, int minVertexIndex, int numVertices, int startIndex, int primitiveCount, int instanceCount, IndexBuffer indexBuffer) - { + { + if (indexBuffer != null) + { + SetIndexBuffer(indexBuffer); + } + //GL.DrawArraysInstanced( // DatatypesMapping.PrimitiveTypeToBeginMode(primitiveType), // baseVertex, numVertices, instanceCount); diff --git a/RenderSystems/ANX.Framework.GL3/ShaderByteCode.cs b/RenderSystems/ANX.Framework.GL3/ShaderByteCode.cs index 80d75f43..fd7f128f 100644 --- a/RenderSystems/ANX.Framework.GL3/ShaderByteCode.cs +++ b/RenderSystems/ANX.Framework.GL3/ShaderByteCode.cs @@ -60,49 +60,190 @@ namespace ANX.Framework.GL3 #region AlphaTestEffectShader internal static byte[] AlphaTestEffectByteCode = new byte[] { - 187, 004, 118, 101, 114, 116, 101, 120, 115, 104, 097, 100, 101, 114, 115, - 123, 115, 104, 097, 100, 101, 114, 032, 034, 083, 112, 114, 105, 116, 101, - 086, 101, 114, 116, 101, 120, 083, 104, 097, 100, 101, 114, 034, 123, 117, - 110, 105, 102, 111, 114, 109, 032, 109, 097, 116, 052, 032, 077, 097, 116, - 114, 105, 120, 084, 114, 097, 110, 115, 102, 111, 114, 109, 059, 097, 116, - 116, 114, 105, 098, 117, 116, 101, 032, 118, 101, 099, 052, 032, 112, 111, - 115, 059, 097, 116, 116, 114, 105, 098, 117, 116, 101, 032, 118, 101, 099, - 052, 032, 099, 111, 108, 059, 097, 116, 116, 114, 105, 098, 117, 116, 101, - 032, 118, 101, 099, 050, 032, 116, 101, 120, 059, 118, 097, 114, 121, 105, - 110, 103, 032, 118, 101, 099, 052, 032, 100, 105, 102, 102, 117, 115, 101, - 067, 111, 108, 111, 114, 059, 118, 097, 114, 121, 105, 110, 103, 032, 118, - 101, 099, 050, 032, 100, 105, 102, 102, 117, 115, 101, 084, 101, 120, 067, - 111, 111, 114, 100, 059, 118, 111, 105, 100, 032, 109, 097, 105, 110, 040, - 032, 041, 123, 103, 108, 095, 080, 111, 115, 105, 116, 105, 111, 110, 061, - 077, 097, 116, 114, 105, 120, 084, 114, 097, 110, 115, 102, 111, 114, 109, - 042, 112, 111, 115, 059, 100, 105, 102, 102, 117, 115, 101, 084, 101, 120, - 067, 111, 111, 114, 100, 061, 116, 101, 120, 059, 100, 105, 102, 102, 117, - 115, 101, 067, 111, 108, 111, 114, 061, 099, 111, 108, 059, 125, 125, 125, - 102, 114, 097, 103, 109, 101, 110, 116, 115, 104, 097, 100, 101, 114, 115, - 123, 115, 104, 097, 100, 101, 114, 032, 034, 083, 112, 114, 105, 116, 101, - 070, 114, 097, 103, 109, 101, 110, 116, 083, 104, 097, 100, 101, 114, 034, - 123, 117, 110, 105, 102, 111, 114, 109, 032, 115, 097, 109, 112, 108, 101, - 114, 050, 068, 032, 084, 101, 120, 116, 117, 114, 101, 059, 118, 097, 114, + 254, 020, 118, 101, 114, 116, 101, 120, 103, 108, 111, 098, 097, 108, 123, + 117, 110, 105, 102, 111, 114, 109, 032, 118, 101, 099, 052, 032, 068, 105, + 102, 102, 117, 115, 101, 067, 111, 108, 111, 114, 059, 117, 110, 105, 102, + 111, 114, 109, 032, 109, 097, 116, 052, 032, 087, 111, 114, 108, 100, 086, + 105, 101, 119, 080, 114, 111, 106, 059, 117, 110, 105, 102, 111, 114, 109, + 032, 118, 101, 099, 052, 032, 070, 111, 103, 086, 101, 099, 116, 111, 114, + 059, 097, 116, 116, 114, 105, 098, 117, 116, 101, 032, 118, 101, 099, 052, + 032, 112, 111, 115, 059, 097, 116, 116, 114, 105, 098, 117, 116, 101, 032, + 118, 101, 099, 052, 032, 099, 111, 108, 059, 097, 116, 116, 114, 105, 098, + 117, 116, 101, 032, 118, 101, 099, 050, 032, 116, 101, 120, 059, 118, 097, + 114, 121, 105, 110, 103, 032, 118, 101, 099, 050, 032, 100, 105, 102, 102, + 117, 115, 101, 084, 101, 120, 067, 111, 111, 114, 100, 059, 118, 097, 114, 121, 105, 110, 103, 032, 118, 101, 099, 052, 032, 100, 105, 102, 102, 117, 115, 101, 067, 111, 108, 111, 114, 059, 118, 097, 114, 121, 105, 110, 103, - 032, 118, 101, 099, 050, 032, 100, 105, 102, 102, 117, 115, 101, 084, 101, - 120, 067, 111, 111, 114, 100, 059, 118, 111, 105, 100, 032, 109, 097, 105, - 110, 040, 032, 041, 123, 103, 108, 095, 070, 114, 097, 103, 067, 111, 108, - 111, 114, 061, 116, 101, 120, 116, 117, 114, 101, 050, 068, 040, 084, 101, - 120, 116, 117, 114, 101, 044, 100, 105, 102, 102, 117, 115, 101, 084, 101, - 120, 067, 111, 111, 114, 100, 041, 042, 100, 105, 102, 102, 117, 115, 101, - 067, 111, 108, 111, 114, 059, 125, 125, 125, 116, 101, 099, 104, 110, 105, - 113, 117, 101, 115, 123, 116, 101, 099, 104, 110, 105, 113, 117, 101, 032, - 034, 083, 112, 114, 105, 116, 101, 084, 101, 099, 104, 110, 105, 113, 117, - 101, 034, 123, 118, 101, 114, 116, 101, 120, 032, 034, 083, 112, 114, 105, - 116, 101, 086, 101, 114, 116, 101, 120, 083, 104, 097, 100, 101, 114, 034, - 102, 114, 097, 103, 109, 101, 110, 116, 032, 034, 083, 112, 114, 105, 116, - 101, 070, 114, 097, 103, 109, 101, 110, 116, 083, 104, 097, 100, 101, 114, - 034, 125, 125, 085, 005, 093, 183, 066, 090, 070, 104, 093, 184, 253, 199, - 246, 081, 152, 083, 013, 048, 171, 074, 063, 021, 247, 182, 129, 011, 094, - 003, 189, 026, 178, 121, 230, 157, 193, 056, 001, 064, 136, 044, 054, 172, - 146, 241, 173, 160, 182, 034, 092, 221, 158, 045, 049, 229, 144, 171, 015, - 022, 089, 025, 248, 163, 175, 081 + 032, 118, 101, 099, 052, 032, 115, 112, 101, 099, 117, 108, 097, 114, 059, + 125, 118, 101, 114, 116, 101, 120, 115, 104, 097, 100, 101, 114, 115, 123, + 115, 104, 097, 100, 101, 114, 032, 034, 086, 083, 065, 108, 112, 104, 097, + 084, 101, 115, 116, 034, 123, 118, 111, 105, 100, 032, 109, 097, 105, 110, + 040, 032, 041, 123, 103, 108, 095, 080, 111, 115, 105, 116, 105, 111, 110, + 061, 087, 111, 114, 108, 100, 086, 105, 101, 119, 080, 114, 111, 106, 042, + 112, 111, 115, 059, 100, 105, 102, 102, 117, 115, 101, 084, 101, 120, 067, + 111, 111, 114, 100, 061, 116, 101, 120, 059, 100, 105, 102, 102, 117, 115, + 101, 067, 111, 108, 111, 114, 061, 068, 105, 102, 102, 117, 115, 101, 067, + 111, 108, 111, 114, 059, 115, 112, 101, 099, 117, 108, 097, 114, 061, 118, + 101, 099, 052, 040, 048, 044, 048, 044, 048, 044, 115, 097, 116, 117, 114, + 097, 116, 101, 040, 100, 111, 116, 040, 112, 111, 115, 044, 070, 111, 103, + 086, 101, 099, 116, 111, 114, 041, 041, 041, 059, 125, 125, 115, 104, 097, + 100, 101, 114, 032, 034, 086, 083, 065, 108, 112, 104, 097, 084, 101, 115, + 116, 078, 111, 070, 111, 103, 034, 123, 118, 111, 105, 100, 032, 109, 097, + 105, 110, 040, 032, 041, 123, 103, 108, 095, 080, 111, 115, 105, 116, 105, + 111, 110, 061, 087, 111, 114, 108, 100, 086, 105, 101, 119, 080, 114, 111, + 106, 042, 112, 111, 115, 059, 100, 105, 102, 102, 117, 115, 101, 084, 101, + 120, 067, 111, 111, 114, 100, 061, 116, 101, 120, 059, 100, 105, 102, 102, + 117, 115, 101, 067, 111, 108, 111, 114, 061, 068, 105, 102, 102, 117, 115, + 101, 067, 111, 108, 111, 114, 059, 125, 125, 115, 104, 097, 100, 101, 114, + 032, 034, 086, 083, 065, 108, 112, 104, 097, 084, 101, 115, 116, 086, 101, + 114, 116, 101, 120, 067, 111, 108, 111, 114, 034, 123, 118, 111, 105, 100, + 032, 109, 097, 105, 110, 040, 032, 041, 123, 103, 108, 095, 080, 111, 115, + 105, 116, 105, 111, 110, 061, 087, 111, 114, 108, 100, 086, 105, 101, 119, + 080, 114, 111, 106, 042, 112, 111, 115, 059, 100, 105, 102, 102, 117, 115, + 101, 084, 101, 120, 067, 111, 111, 114, 100, 061, 116, 101, 120, 059, 100, + 105, 102, 102, 117, 115, 101, 067, 111, 108, 111, 114, 061, 068, 105, 102, + 102, 117, 115, 101, 067, 111, 108, 111, 114, 042, 099, 111, 108, 059, 115, + 112, 101, 099, 117, 108, 097, 114, 061, 118, 101, 099, 052, 040, 048, 044, + 048, 044, 048, 044, 115, 097, 116, 117, 114, 097, 116, 101, 040, 100, 111, + 116, 040, 112, 111, 115, 044, 070, 111, 103, 086, 101, 099, 116, 111, 114, + 041, 041, 041, 059, 125, 125, 115, 104, 097, 100, 101, 114, 032, 034, 086, + 083, 065, 108, 112, 104, 097, 084, 101, 115, 116, 086, 101, 114, 116, 101, + 120, 067, 111, 108, 111, 114, 078, 111, 070, 111, 103, 034, 123, 118, 111, + 105, 100, 032, 109, 097, 105, 110, 040, 032, 041, 123, 103, 108, 095, 080, + 111, 115, 105, 116, 105, 111, 110, 061, 087, 111, 114, 108, 100, 086, 105, + 101, 119, 080, 114, 111, 106, 042, 112, 111, 115, 059, 100, 105, 102, 102, + 117, 115, 101, 084, 101, 120, 067, 111, 111, 114, 100, 061, 116, 101, 120, + 059, 100, 105, 102, 102, 117, 115, 101, 067, 111, 108, 111, 114, 061, 068, + 105, 102, 102, 117, 115, 101, 067, 111, 108, 111, 114, 042, 099, 111, 108, + 059, 125, 125, 125, 102, 114, 097, 103, 109, 101, 110, 116, 103, 108, 111, + 098, 097, 108, 123, 117, 110, 105, 102, 111, 114, 109, 032, 115, 097, 109, + 112, 108, 101, 114, 050, 068, 032, 084, 101, 120, 116, 117, 114, 101, 059, + 117, 110, 105, 102, 111, 114, 109, 032, 118, 101, 099, 052, 032, 065, 108, + 112, 104, 097, 084, 101, 115, 116, 059, 117, 110, 105, 102, 111, 114, 109, + 032, 118, 101, 099, 051, 032, 070, 111, 103, 067, 111, 108, 111, 114, 059, + 118, 097, 114, 121, 105, 110, 103, 032, 118, 101, 099, 050, 032, 100, 105, + 102, 102, 117, 115, 101, 084, 101, 120, 067, 111, 111, 114, 100, 059, 118, + 097, 114, 121, 105, 110, 103, 032, 118, 101, 099, 052, 032, 100, 105, 102, + 102, 117, 115, 101, 067, 111, 108, 111, 114, 059, 118, 097, 114, 121, 105, + 110, 103, 032, 118, 101, 099, 052, 032, 115, 112, 101, 099, 117, 108, 097, + 114, 059, 125, 102, 114, 097, 103, 109, 101, 110, 116, 115, 104, 097, 100, + 101, 114, 115, 123, 115, 104, 097, 100, 101, 114, 032, 034, 080, 083, 065, + 108, 112, 104, 097, 084, 101, 115, 116, 076, 116, 071, 116, 034, 123, 118, + 111, 105, 100, 032, 109, 097, 105, 110, 040, 032, 041, 123, 118, 101, 099, + 052, 032, 099, 111, 108, 111, 114, 061, 116, 101, 120, 116, 117, 114, 101, + 050, 068, 040, 084, 101, 120, 116, 117, 114, 101, 044, 100, 105, 102, 102, + 117, 115, 101, 084, 101, 120, 067, 111, 111, 114, 100, 041, 042, 100, 105, + 102, 102, 117, 115, 101, 067, 111, 108, 111, 114, 059, 105, 102, 040, 040, + 040, 097, 098, 115, 040, 099, 111, 108, 111, 114, 046, 097, 045, 065, 108, + 112, 104, 097, 084, 101, 115, 116, 046, 120, 041, 032, 060, 032, 065, 108, + 112, 104, 097, 084, 101, 115, 116, 046, 121, 041, 032, 063, 032, 065, 108, + 112, 104, 097, 084, 101, 115, 116, 046, 122, 032, 058, 032, 065, 108, 112, + 104, 097, 084, 101, 115, 116, 046, 119, 041, 032, 060, 032, 048, 041, 100, + 105, 115, 099, 097, 114, 100, 059, 099, 111, 108, 111, 114, 046, 114, 103, + 098, 061, 109, 105, 120, 040, 099, 111, 108, 111, 114, 046, 114, 103, 098, + 044, 070, 111, 103, 067, 111, 108, 111, 114, 042, 099, 111, 108, 111, 114, + 046, 097, 044, 115, 112, 101, 099, 117, 108, 097, 114, 046, 119, 041, 059, + 103, 108, 095, 070, 114, 097, 103, 067, 111, 108, 111, 114, 061, 099, 111, + 108, 111, 114, 059, 125, 125, 115, 104, 097, 100, 101, 114, 032, 034, 080, + 083, 065, 108, 112, 104, 097, 084, 101, 115, 116, 076, 116, 071, 116, 078, + 111, 070, 111, 103, 034, 123, 118, 111, 105, 100, 032, 109, 097, 105, 110, + 040, 032, 041, 123, 118, 101, 099, 052, 032, 099, 111, 108, 111, 114, 061, + 116, 101, 120, 116, 117, 114, 101, 050, 068, 040, 084, 101, 120, 116, 117, + 114, 101, 044, 100, 105, 102, 102, 117, 115, 101, 084, 101, 120, 067, 111, + 111, 114, 100, 041, 042, 100, 105, 102, 102, 117, 115, 101, 067, 111, 108, + 111, 114, 059, 105, 102, 040, 040, 040, 097, 098, 115, 040, 099, 111, 108, + 111, 114, 046, 097, 045, 065, 108, 112, 104, 097, 084, 101, 115, 116, 046, + 120, 041, 032, 060, 032, 065, 108, 112, 104, 097, 084, 101, 115, 116, 046, + 121, 041, 032, 063, 032, 065, 108, 112, 104, 097, 084, 101, 115, 116, 046, + 122, 032, 058, 032, 065, 108, 112, 104, 097, 084, 101, 115, 116, 046, 119, + 041, 032, 060, 032, 048, 041, 100, 105, 115, 099, 097, 114, 100, 059, 103, + 108, 095, 070, 114, 097, 103, 067, 111, 108, 111, 114, 061, 099, 111, 108, + 111, 114, 059, 125, 125, 115, 104, 097, 100, 101, 114, 032, 034, 080, 083, + 065, 108, 112, 104, 097, 084, 101, 115, 116, 069, 113, 078, 101, 034, 123, + 118, 111, 105, 100, 032, 109, 097, 105, 110, 040, 032, 041, 123, 118, 101, + 099, 052, 032, 099, 111, 108, 111, 114, 061, 116, 101, 120, 116, 117, 114, + 101, 050, 068, 040, 084, 101, 120, 116, 117, 114, 101, 044, 100, 105, 102, + 102, 117, 115, 101, 084, 101, 120, 067, 111, 111, 114, 100, 041, 042, 100, + 105, 102, 102, 117, 115, 101, 067, 111, 108, 111, 114, 059, 105, 102, 040, + 040, 040, 097, 098, 115, 040, 099, 111, 108, 111, 114, 046, 097, 045, 065, + 108, 112, 104, 097, 084, 101, 115, 116, 046, 120, 041, 032, 060, 032, 065, + 108, 112, 104, 097, 084, 101, 115, 116, 046, 121, 041, 032, 063, 032, 065, + 108, 112, 104, 097, 084, 101, 115, 116, 046, 122, 032, 058, 032, 065, 108, + 112, 104, 097, 084, 101, 115, 116, 046, 119, 041, 032, 060, 032, 048, 041, + 100, 105, 115, 099, 097, 114, 100, 059, 099, 111, 108, 111, 114, 046, 114, + 103, 098, 061, 109, 105, 120, 040, 099, 111, 108, 111, 114, 046, 114, 103, + 098, 044, 070, 111, 103, 067, 111, 108, 111, 114, 042, 099, 111, 108, 111, + 114, 046, 097, 044, 115, 112, 101, 099, 117, 108, 097, 114, 046, 119, 041, + 059, 103, 108, 095, 070, 114, 097, 103, 067, 111, 108, 111, 114, 061, 099, + 111, 108, 111, 114, 059, 125, 125, 115, 104, 097, 100, 101, 114, 032, 034, + 080, 083, 065, 108, 112, 104, 097, 084, 101, 115, 116, 069, 113, 078, 101, + 078, 111, 070, 111, 103, 034, 123, 118, 111, 105, 100, 032, 109, 097, 105, + 110, 040, 032, 041, 123, 118, 101, 099, 052, 032, 099, 111, 108, 111, 114, + 061, 116, 101, 120, 116, 117, 114, 101, 050, 068, 040, 084, 101, 120, 116, + 117, 114, 101, 044, 100, 105, 102, 102, 117, 115, 101, 084, 101, 120, 067, + 111, 111, 114, 100, 041, 042, 100, 105, 102, 102, 117, 115, 101, 067, 111, + 108, 111, 114, 059, 105, 102, 040, 040, 040, 097, 098, 115, 040, 099, 111, + 108, 111, 114, 046, 097, 045, 065, 108, 112, 104, 097, 084, 101, 115, 116, + 046, 120, 041, 032, 060, 032, 065, 108, 112, 104, 097, 084, 101, 115, 116, + 046, 121, 041, 032, 063, 032, 065, 108, 112, 104, 097, 084, 101, 115, 116, + 046, 122, 032, 058, 032, 065, 108, 112, 104, 097, 084, 101, 115, 116, 046, + 119, 041, 032, 060, 032, 048, 041, 100, 105, 115, 099, 097, 114, 100, 059, + 103, 108, 095, 070, 114, 097, 103, 067, 111, 108, 111, 114, 061, 099, 111, + 108, 111, 114, 059, 125, 125, 125, 116, 101, 099, 104, 110, 105, 113, 117, + 101, 115, 123, 116, 101, 099, 104, 110, 105, 113, 117, 101, 032, 034, 065, + 108, 112, 104, 097, 084, 101, 115, 116, 076, 116, 071, 116, 034, 123, 118, + 101, 114, 116, 101, 120, 032, 034, 086, 083, 065, 108, 112, 104, 097, 084, + 101, 115, 116, 034, 059, 102, 114, 097, 103, 109, 101, 110, 116, 032, 034, + 080, 083, 065, 108, 112, 104, 097, 084, 101, 115, 116, 076, 116, 071, 116, + 034, 059, 125, 116, 101, 099, 104, 110, 105, 113, 117, 101, 032, 034, 065, + 108, 112, 104, 097, 084, 101, 115, 116, 078, 111, 070, 111, 103, 076, 116, + 071, 116, 034, 123, 118, 101, 114, 116, 101, 120, 032, 034, 086, 083, 065, + 108, 112, 104, 097, 084, 101, 115, 116, 078, 111, 070, 111, 103, 034, 102, + 114, 097, 103, 109, 101, 110, 116, 032, 034, 080, 083, 065, 108, 112, 104, + 097, 084, 101, 115, 116, 076, 116, 071, 116, 078, 111, 070, 111, 103, 034, + 125, 116, 101, 099, 104, 110, 105, 113, 117, 101, 032, 034, 065, 108, 112, + 104, 097, 084, 101, 115, 116, 086, 101, 114, 116, 101, 120, 067, 111, 108, + 111, 114, 076, 116, 071, 116, 034, 123, 118, 101, 114, 116, 101, 120, 032, + 034, 086, 083, 065, 108, 112, 104, 097, 084, 101, 115, 116, 086, 101, 114, + 116, 101, 120, 067, 111, 108, 111, 114, 034, 102, 114, 097, 103, 109, 101, + 110, 116, 032, 034, 080, 083, 065, 108, 112, 104, 097, 084, 101, 115, 116, + 076, 116, 071, 116, 034, 125, 116, 101, 099, 104, 110, 105, 113, 117, 101, + 032, 034, 065, 108, 112, 104, 097, 084, 101, 115, 116, 086, 101, 114, 116, + 101, 120, 067, 111, 108, 111, 114, 078, 111, 070, 111, 103, 076, 116, 071, + 116, 034, 123, 118, 101, 114, 116, 101, 120, 032, 034, 086, 083, 065, 108, + 112, 104, 097, 084, 101, 115, 116, 086, 101, 114, 116, 101, 120, 067, 111, + 108, 111, 114, 078, 111, 070, 111, 103, 034, 102, 114, 097, 103, 109, 101, + 110, 116, 032, 034, 080, 083, 065, 108, 112, 104, 097, 084, 101, 115, 116, + 076, 116, 071, 116, 078, 111, 070, 111, 103, 034, 125, 116, 101, 099, 104, + 110, 105, 113, 117, 101, 032, 034, 065, 108, 112, 104, 097, 084, 101, 115, + 116, 069, 113, 078, 101, 034, 123, 118, 101, 114, 116, 101, 120, 032, 034, + 086, 083, 065, 108, 112, 104, 097, 084, 101, 115, 116, 034, 102, 114, 097, + 103, 109, 101, 110, 116, 032, 034, 080, 083, 065, 108, 112, 104, 097, 084, + 101, 115, 116, 069, 113, 078, 101, 034, 125, 116, 101, 099, 104, 110, 105, + 113, 117, 101, 032, 034, 065, 108, 112, 104, 097, 084, 101, 115, 116, 078, + 111, 070, 111, 103, 069, 113, 078, 101, 034, 123, 118, 101, 114, 116, 101, + 120, 032, 034, 086, 083, 065, 108, 112, 104, 097, 084, 101, 115, 116, 078, + 111, 070, 111, 103, 034, 102, 114, 097, 103, 109, 101, 110, 116, 032, 034, + 080, 083, 065, 108, 112, 104, 097, 084, 101, 115, 116, 069, 113, 078, 101, + 078, 111, 070, 111, 103, 034, 125, 116, 101, 099, 104, 110, 105, 113, 117, + 101, 032, 034, 065, 108, 112, 104, 097, 084, 101, 115, 116, 086, 101, 114, + 116, 101, 120, 067, 111, 108, 111, 114, 069, 113, 078, 101, 034, 123, 118, + 101, 114, 116, 101, 120, 032, 034, 086, 083, 065, 108, 112, 104, 097, 084, + 101, 115, 116, 086, 101, 114, 116, 101, 120, 067, 111, 108, 111, 114, 034, + 102, 114, 097, 103, 109, 101, 110, 116, 032, 034, 080, 083, 065, 108, 112, + 104, 097, 084, 101, 115, 116, 069, 113, 078, 101, 034, 125, 116, 101, 099, + 104, 110, 105, 113, 117, 101, 032, 034, 065, 108, 112, 104, 097, 084, 101, + 115, 116, 086, 101, 114, 116, 101, 120, 067, 111, 108, 111, 114, 078, 111, + 070, 111, 103, 069, 113, 078, 101, 034, 123, 118, 101, 114, 116, 101, 120, + 032, 034, 086, 083, 065, 108, 112, 104, 097, 084, 101, 115, 116, 086, 101, + 114, 116, 101, 120, 067, 111, 108, 111, 114, 078, 111, 070, 111, 103, 034, + 102, 114, 097, 103, 109, 101, 110, 116, 032, 034, 080, 083, 065, 108, 112, + 104, 097, 084, 101, 115, 116, 069, 113, 078, 101, 078, 111, 070, 111, 103, + 034, 125, 125, 193, 056, 059, 035, 234, 141, 192, 107, 211, 052, 014, 143, + 102, 144, 054, 000, 204, 207, 103, 231, 232, 152, 090, 168, 195, 202, 210, + 162, 091, 102, 172, 085, 224, 057, 027, 090, 158, 206, 009, 220, 150, 105, + 239, 222, 004, 062, 068, 220, 123, 245, 186, 062, 221, 115, 080, 144, 004, + 124, 076, 234, 063, 132, 204, 155 }; #endregion //AlphaTestEffectShader diff --git a/Samples/AlphaTestEffectSample/AlphaTestEffectSample.csproj b/Samples/AlphaTestEffectSample/AlphaTestEffectSample.csproj index 541abc08..f54cd881 100644 --- a/Samples/AlphaTestEffectSample/AlphaTestEffectSample.csproj +++ b/Samples/AlphaTestEffectSample/AlphaTestEffectSample.csproj @@ -105,6 +105,10 @@ {068EB2E9-963C-4E1B-8831-E25011F11FFE} ANX.PlatformSystem.Windows + + {EB8258E0-6741-4DB9-B756-1EBDF67B1ED6} + ANX.RenderSystem.GL3 + {5BE49183-2F6F-4527-AC90-D816911FCF90} ANX.RenderSystem.Windows.DX10 diff --git a/Samples/AlphaTestEffectSample/AlphaTestEffectSample_Linux.csproj b/Samples/AlphaTestEffectSample/AlphaTestEffectSample_Linux.csproj index f053aef5..3a050306 100644 --- a/Samples/AlphaTestEffectSample/AlphaTestEffectSample_Linux.csproj +++ b/Samples/AlphaTestEffectSample/AlphaTestEffectSample_Linux.csproj @@ -103,6 +103,10 @@ {068EB2E9-963C-4E1B-8831-E25011F11FFE} ANX.PlatformSystem.Windows + + {EB8258E0-6741-4DB9-B756-1EBDF67B1ED6} + ANX.RenderSystem.GL3 + {5BE49183-2F6F-4527-AC90-D816911FCF90} ANX.RenderSystem.Windows.DX10 diff --git a/Samples/AlphaTestEffectSample/AlphaTestEffectSample_PSVita.csproj b/Samples/AlphaTestEffectSample/AlphaTestEffectSample_PSVita.csproj index d2feee02..baf37bbe 100644 --- a/Samples/AlphaTestEffectSample/AlphaTestEffectSample_PSVita.csproj +++ b/Samples/AlphaTestEffectSample/AlphaTestEffectSample_PSVita.csproj @@ -103,6 +103,10 @@ {068EB2E9-963C-4E1B-8831-E25011F11FFE} ANX.PlatformSystem.Windows + + {EB8258E0-6741-4DB9-B756-1EBDF67B1ED6} + ANX.RenderSystem.GL3 + {5BE49183-2F6F-4527-AC90-D816911FCF90} ANX.RenderSystem.Windows.DX10 diff --git a/Samples/AlphaTestEffectSample/Program.cs b/Samples/AlphaTestEffectSample/Program.cs index 2b4d8000..db5fba73 100644 --- a/Samples/AlphaTestEffectSample/Program.cs +++ b/Samples/AlphaTestEffectSample/Program.cs @@ -11,9 +11,9 @@ namespace AlphaTestEffectSample { static void Main(string[] args) { - AddInSystemFactory.Instance.SetPreferredSystem(AddInType.RenderSystem, "DirectX10"); + AddInSystemFactory.Instance.SetPreferredSystem(AddInType.RenderSystem, "DirectX10"); //AddInSystemFactory.Instance.SetPreferredSystem(AddInType.RenderSystem, "DirectX11"); - //AddInSystemFactory.Instance.SetPreferredSystem(AddInType.RenderSystem, "OpenGL3"); + //AddInSystemFactory.Instance.SetPreferredSystem(AddInType.RenderSystem, "OpenGL3"); using (Game1 game = new Game1()) { diff --git a/Tools/StockShaderCodeGenerator/Program.cs b/Tools/StockShaderCodeGenerator/Program.cs index 8b019fb6..a584fa8b 100644 --- a/Tools/StockShaderCodeGenerator/Program.cs +++ b/Tools/StockShaderCodeGenerator/Program.cs @@ -1,6 +1,5 @@ using System; using System.Reflection; -using System.Diagnostics; // This file is part of the ANX.Framework created by the // "ANX.Framework developer group" and released under the Ms-PL license. @@ -22,13 +21,14 @@ namespace StockShaderCodeGenerator } } - Program.TraceListener.WriteLine("ANX.Framework StockShaderCodeGenerator (sscg) Version " + Assembly.GetExecutingAssembly().GetName().Version); + TraceListener.WriteLine("ANX.Framework StockShaderCodeGenerator (sscg) Version " + + Assembly.GetExecutingAssembly().GetName().Version); string buildFile; if (args.Length < 1) { - Program.TraceListener.WriteLine("No command line arguments provided. Trying to load build.xml from current directory."); + TraceListener.WriteLine("No command line arguments provided. Trying to load build.xml from current directory."); buildFile = "build.xml"; } else @@ -36,7 +36,7 @@ namespace StockShaderCodeGenerator buildFile = args[0]; } - Program.TraceListener.WriteLine("Creating configuration using '{0}' configuration file.", buildFile); + TraceListener.WriteLine("Creating configuration using '{0}' configuration file.", buildFile); Configuration.LoadConfiguration(buildFile); @@ -48,7 +48,7 @@ namespace StockShaderCodeGenerator } else { - Program.TraceListener.WriteLine("error while compiling shaders. Code generation skipped..."); + TraceListener.WriteLine("error while compiling shaders. Code generation skipped..."); } } } diff --git a/shader/GL3/AlphaTest.fx b/shader/GL3/AlphaTest.fx index 2dae6f32..f1a6013f 100644 --- a/shader/GL3/AlphaTest.fx +++ b/shader/GL3/AlphaTest.fx @@ -2,49 +2,173 @@ // "ANX.Framework developer group" and released under the Ms-PL license. // For details see: http://anxframework.codeplex.com/license -//TODO: dummy implementation / placeholder +vertexglobal +{ + uniform vec4 DiffuseColor; + uniform mat4 WorldViewProj; + uniform vec4 FogVector; + + attribute vec4 pos; + attribute vec4 col; + attribute vec2 tex; + + varying vec2 diffuseTexCoord; + varying vec4 diffuseColor; + varying vec4 specular; +} vertexshaders { - shader "SpriteVertexShader" + shader "VSAlphaTest" { - uniform mat4 MatrixTransform; - - attribute vec4 pos; - attribute vec4 col; - attribute vec2 tex; - - varying vec4 diffuseColor; - varying vec2 diffuseTexCoord; void main( ) { - gl_Position = MatrixTransform * pos; + gl_Position = WorldViewProj * pos; diffuseTexCoord = tex; - diffuseColor = col; + diffuseColor = DiffuseColor; + specular = vec4(0, 0, 0, saturate(dot(pos, FogVector))); + } + } + + shader "VSAlphaTestNoFog" + { + void main( ) + { + gl_Position = WorldViewProj * pos; + diffuseTexCoord = tex; + diffuseColor = DiffuseColor; + } + } + + shader "VSAlphaTestVertexColor" + { + void main( ) + { + gl_Position = WorldViewProj * pos; + diffuseTexCoord = tex; + diffuseColor = DiffuseColor * col; + specular = vec4(0, 0, 0, saturate(dot(pos, FogVector))); + } + } + + shader "VSAlphaTestVertexColorNoFog" + { + void main( ) + { + gl_Position = WorldViewProj * pos; + diffuseTexCoord = tex; + diffuseColor = DiffuseColor * col; } } } +fragmentglobal +{ + uniform sampler2D Texture; + uniform vec4 AlphaTest; + uniform vec3 FogColor; + + varying vec2 diffuseTexCoord; + varying vec4 diffuseColor; + varying vec4 specular; +} + fragmentshaders { - shader "SpriteFragmentShader" + shader "PSAlphaTestLtGt" { - uniform sampler2D Texture; - - varying vec4 diffuseColor; - varying vec2 diffuseTexCoord; void main( ) { - gl_FragColor = texture2D(Texture, diffuseTexCoord) * diffuseColor; + vec4 color = texture2D(Texture, diffuseTexCoord) * diffuseColor; + if(((abs(color.a - AlphaTest.x) < AlphaTest.y) ? AlphaTest.z : AlphaTest.w) < 0) + discard; + color.rgb = mix(color.rgb, FogColor * color.a, specular.w); + gl_FragColor = color; + } + } + + shader "PSAlphaTestLtGtNoFog" + { + void main( ) + { + vec4 color = texture2D(Texture, diffuseTexCoord) * diffuseColor; + if(((abs(color.a - AlphaTest.x) < AlphaTest.y) ? AlphaTest.z : AlphaTest.w) < 0) + discard; + gl_FragColor = color; + } + } + + shader "PSAlphaTestEqNe" + { + void main( ) + { + vec4 color = texture2D(Texture, diffuseTexCoord) * diffuseColor; + if(((abs(color.a - AlphaTest.x) < AlphaTest.y) ? AlphaTest.z : AlphaTest.w) < 0) + discard; + color.rgb = mix(color.rgb, FogColor * color.a, specular.w); + gl_FragColor = color; + } + } + + shader "PSAlphaTestEqNeNoFog" + { + void main( ) + { + vec4 color = texture2D(Texture, diffuseTexCoord) * diffuseColor; + if(((abs(color.a - AlphaTest.x) < AlphaTest.y) ? AlphaTest.z : AlphaTest.w) < 0) + discard; + gl_FragColor = color; } } } techniques { - technique "SpriteTechnique" + technique "AlphaTestLtGt" { - vertex "SpriteVertexShader" - fragment "SpriteFragmentShader" + vertex "VSAlphaTest"; + fragment "PSAlphaTestLtGt"; + } + + technique "AlphaTestNoFogLtGt" + { + vertex "VSAlphaTestNoFog" + fragment "PSAlphaTestLtGtNoFog" + } + + technique "AlphaTestVertexColorLtGt" + { + vertex "VSAlphaTestVertexColor" + fragment "PSAlphaTestLtGt" + } + + technique "AlphaTestVertexColorNoFogLtGt" + { + vertex "VSAlphaTestVertexColorNoFog" + fragment "PSAlphaTestLtGtNoFog" + } + + technique "AlphaTestEqNe" + { + vertex "VSAlphaTest" + fragment "PSAlphaTestEqNe" + } + + technique "AlphaTestNoFogEqNe" + { + vertex "VSAlphaTestNoFog" + fragment "PSAlphaTestEqNeNoFog" + } + + technique "AlphaTestVertexColorEqNe" + { + vertex "VSAlphaTestVertexColor" + fragment "PSAlphaTestEqNe" + } + + technique "AlphaTestVertexColorNoFogEqNe" + { + vertex "VSAlphaTestVertexColorNoFog" + fragment "PSAlphaTestEqNeNoFog" } } \ No newline at end of file diff --git a/shader/GL3/DualTexture.fx b/shader/GL3/DualTexture.fx index 49921ad8..9141fb9b 100644 --- a/shader/GL3/DualTexture.fx +++ b/shader/GL3/DualTexture.fx @@ -6,7 +6,7 @@ vertexglobal { uniform vec4 DiffuseColor; uniform vec4 FogVector; - uniform mat4 WorldViewProj; + uniform mat4 WorldViewProj; } vertexshaders @@ -24,7 +24,7 @@ vertexshaders void main( ) { gl_Position = WorldViewProj * pos; - diffuse = DiffuseColor; + diffuse = DiffuseColor; specular = vec4(0, 0, 0, saturate(dot(pos, FogVector))); diffuseTexCoord = tex; diffuseTexCoord2 = tex2; @@ -43,7 +43,7 @@ vertexshaders void main( ) { gl_Position = WorldViewProj * pos; - diffuse = DiffuseColor; + diffuse = DiffuseColor; diffuseTexCoord = tex; diffuseTexCoord2 = tex2; } @@ -63,7 +63,7 @@ vertexshaders void main( ) { gl_Position = WorldViewProj * pos; - diffuse = DiffuseColor * col; + diffuse = DiffuseColor * col; specular = vec4(0, 0, 0, saturate(dot(pos, FogVector))); diffuseTexCoord = tex; diffuseTexCoord2 = tex2; @@ -83,7 +83,7 @@ vertexshaders void main( ) { gl_Position = WorldViewProj * pos; - diffuse = DiffuseColor * col; + diffuse = DiffuseColor * col; diffuseTexCoord = tex; diffuseTexCoord2 = tex2; } @@ -107,11 +107,11 @@ fragmentshaders varying vec2 diffuseTexCoord2; void main( ) { - vec4 color = texture2D(Texture, diffuseTexCoord); - vec4 overlay = texture2D(Texture2, diffuseTexCoord2); - color.rgb *= 2; - color *= overlay * diffuse; - color.rgb = lerp(color.rgb, FogColor * color.a, specular.w); + vec4 color = texture2D(Texture, diffuseTexCoord); + vec4 overlay = texture2D(Texture2, diffuseTexCoord2); + color.rgb *= 2; + color *= overlay * diffuse; + color.rgb = lerp(color.rgb, FogColor * color.a, specular.w); gl_FragColor = color; } } @@ -123,10 +123,10 @@ fragmentshaders varying vec2 diffuseTexCoord2; void main( ) { - vec4 color = texture2D(Texture, diffuseTexCoord); - vec4 overlay = texture2D(Texture2, diffuseTexCoord2); - color.rgb *= 2; - color *= overlay * diffuse; + vec4 color = texture2D(Texture, diffuseTexCoord); + vec4 overlay = texture2D(Texture2, diffuseTexCoord2); + color.rgb *= 2; + color *= overlay * diffuse; gl_FragColor = color; } }