コード例 #1
0
        public static ShaderInputElementSpec CreateSpec(this ShaderInputElementPurpose purpose)
        {
            switch (purpose)
            {
            case ShaderInputElementPurpose.Position:
                return(new ShaderInputElementSpec(ShaderInputElementFormat.Float4, purpose));

            case ShaderInputElementPurpose.Normal:
                return(new ShaderInputElementSpec(ShaderInputElementFormat.Float4, purpose));

            case ShaderInputElementPurpose.TextureCoordinate:
                return(new ShaderInputElementSpec(ShaderInputElementFormat.Float2, purpose));

            case ShaderInputElementPurpose.Color:
                return(new ShaderInputElementSpec(ShaderInputElementFormat.Float4, purpose));

            default:
                throw new NotSupportedException("Cannot automatically generate input element spec from this value");
            }
        }
コード例 #2
0
 public ShaderInputElementSpec(ShaderInputElementFormat format, ShaderInputElementPurpose purpose)
 {
     Format = format;
     Purpose = purpose;
 }
コード例 #3
0
 public ShaderInputElementSpec(ShaderInputElementFormat format)
 {
     Format  = format;
     Purpose = ShaderInputElementPurpose.Custom;
 }
コード例 #4
0
 public ShaderInputElementSpec(ShaderInputElementFormat format, ShaderInputElementPurpose purpose)
 {
     Format  = format;
     Purpose = purpose;
 }