public static Material ToUnityMaterial(this PbrMaterial vpMat, IMaterialProvider materialProvider, Material textureMaterial)
        {
            if (materialProvider.HasMaterial(vpMat))
            {
                return(materialProvider.GetMaterial(vpMat));
            }

            var unityMaterial = RenderPipeline.Current.MaterialConverter.MergeMaterials(vpMat, textureMaterial);

            materialProvider.SaveMaterial(vpMat, unityMaterial);

            return(unityMaterial);
        }
        public static Material ToUnityMaterial(this PbrMaterial vpMat, IMaterialProvider materialProvider, ITextureProvider textureProvider, StringBuilder debug = null)
        {
            if (materialProvider.HasMaterial(vpMat))
            {
                return(materialProvider.GetMaterial(vpMat));
            }

            var unityMaterial = RenderPipeline.Current.MaterialConverter.CreateMaterial(vpMat, textureProvider, debug);

            materialProvider.SaveMaterial(vpMat, unityMaterial);

            return(unityMaterial);
        }
Пример #3
0
 public void AddToList(List <Sprite> sprites, IMaterialProvider provider)
 {
     Material = provider.GetMaterial(Tag);
     sprites.Add(this);
 }