예제 #1
0
        private static VertexAttribute GetActualVertexAttribute(VertexAttributeFlag attribute)
        {
            switch (attribute)
            {
            case VertexAttributeFlag.Position: return(VertexAttribute.Position);

            case VertexAttributeFlag.Normal: return(VertexAttribute.Normal);

            case VertexAttributeFlag.Tangent: return(VertexAttribute.Tangent);

            case VertexAttributeFlag.Color: return(VertexAttribute.Color);

            case VertexAttributeFlag.TexCoord0: return(VertexAttribute.TexCoord0);

            case VertexAttributeFlag.TexCoord1: return(VertexAttribute.TexCoord1);

            case VertexAttributeFlag.TexCoord2: return(VertexAttribute.TexCoord2);

            case VertexAttributeFlag.TexCoord3: return(VertexAttribute.TexCoord3);

            case VertexAttributeFlag.TexCoord4: return(VertexAttribute.TexCoord4);

            case VertexAttributeFlag.TexCoord5: return(VertexAttribute.TexCoord5);

            case VertexAttributeFlag.TexCoord6: return(VertexAttribute.TexCoord6);

            case VertexAttributeFlag.TexCoord7: return(VertexAttribute.TexCoord7);

            case VertexAttributeFlag.BlendWeight: return(VertexAttribute.BlendWeight);

            case VertexAttributeFlag.BlendIndices: return(VertexAttribute.BlendIndices);

            default: throw new InvalidOperationException("Unexpected attribute : " + attribute);
            }
        }
예제 #2
0
        private static Type GetOutputType(VertexAttributeFlag attribute)
        {
            switch (attribute)
            {
            case VertexAttributeFlag.Position: return(typeof(Vector3));

            case VertexAttributeFlag.Normal: return(typeof(Vector3));

            case VertexAttributeFlag.Tangent: return(typeof(Vector4));

            case VertexAttributeFlag.Color: return(typeof(Vector4));

            case VertexAttributeFlag.TexCoord0:
            case VertexAttributeFlag.TexCoord1:
            case VertexAttributeFlag.TexCoord2:
            case VertexAttributeFlag.TexCoord3:
            case VertexAttributeFlag.TexCoord4:
            case VertexAttributeFlag.TexCoord5:
            case VertexAttributeFlag.TexCoord6:
            case VertexAttributeFlag.TexCoord7: return(typeof(Vector2));

            case VertexAttributeFlag.BlendWeight: return(typeof(Vector4));

            case VertexAttributeFlag.BlendIndices: return(typeof(Vector4));

            default: throw new InvalidOperationException("Unexpected attribute : " + attribute);
            }
        }
예제 #3
0
 private bool HasOutput(VertexAttributeFlag flag)
 {
     return((output & flag) == flag);
 }