예제 #1
0
 public void ValidShaderLabel()
 {
     CollectionAssert.AreEqual(
         new List <MatlEnums.ParamId> {
         MatlEnums.ParamId.RasterizerState0,
         MatlEnums.ParamId.BlendState0,
         MatlEnums.ParamId.CustomVector13,
         MatlEnums.ParamId.CustomVector8,
         MatlEnums.ParamId.Texture0,
         MatlEnums.ParamId.Sampler0,
         MatlEnums.ParamId.Texture9,
         MatlEnums.ParamId.Sampler9,
     },
         ShaderValidation.GetParameters("SFX_PBS_0000000000000080_opaque")
         );
 }
예제 #2
0
        private static Material CreateMaterial(MatlEntry entry, int index)
        {
            var idColor = UniqueColors.IndexToColor(index);

            var material = new Material(entry)
            {
                MaterialIdColor = new SolidColorBrush(Color.FromArgb(255,
                                                                     (byte)idColor.X,
                                                                     (byte)idColor.Y,
                                                                     (byte)idColor.Z)),
                ShaderAttributeNames = string.Join(", ", ShaderValidation.GetAttributes(entry.ShaderLabel)),
                ShaderParameterNames = string.Join(", ", ShaderValidation.GetParameters(entry.ShaderLabel).Select(p => p.ToString()).ToList()),
                RenderPasses         = ShaderValidation.GetRenderPasses(entry.ShaderLabel)
            };

            AddAttributesToMaterial(entry, material);
            return(material);
        }
예제 #3
0
 public void InvalidShaderLabel()
 {
     CollectionAssert.AreEqual(new List <MatlEnums.ParamId>(), ShaderValidation.GetParameters("SFX_PBS_0000000000000000"));
 }