Explorar el Código

made some methods obsolete.

Vicente Penades hace 3 años
padre
commit
eedd8782a4
Se han modificado 1 ficheros con 37 adiciones y 29 borrados
  1. 37 29
      src/SharpGLTF.Toolkit/Materials/MaterialBuilder.cs

+ 37 - 29
src/SharpGLTF.Toolkit/Materials/MaterialBuilder.cs

@@ -466,35 +466,7 @@ namespace SharpGLTF.Materials
             WithChannelImage(KnownChannel.MetallicRoughness, imageFile);
             WithMetallicRoughness(metallic, roughness);
             return this;
-        }
-
-        public MaterialBuilder WithDiffuse(Vector4 rgba) { return WithChannelParam(KnownChannel.Diffuse, KnownProperty.RGBA, rgba); }
-
-        public MaterialBuilder WithDiffuse(IMAGEFILE imageFile, Vector4? rgba = null)
-        {
-            WithChannelImage(KnownChannel.Diffuse, imageFile);
-            if (rgba.HasValue) WithDiffuse(rgba.Value);
-            return this;
-        }
-
-        public MaterialBuilder WithSpecularGlossiness(Vector3? specular = null, float? glossiness = null)
-        {
-            if (!specular.HasValue && !glossiness.HasValue) return this;
-
-            var channel = UseChannel(KnownChannel.SpecularGlossiness);
-
-            if (specular.HasValue) channel.Parameters[KnownProperty.SpecularFactor] = specular.Value;
-            if (glossiness.HasValue) channel.Parameters[KnownProperty.GlossinessFactor] = glossiness.Value;
-
-            return this;
-        }
-
-        public MaterialBuilder WithSpecularGlossiness(IMAGEFILE imageFile, Vector3? specular = null, float? glossiness = null)
-        {
-            WithChannelImage(KnownChannel.SpecularGlossiness, imageFile);
-            WithSpecularGlossiness(specular, glossiness);
-            return this;
-        }
+        }        
 
         public MaterialBuilder WithClearCoatNormal(IMAGEFILE imageFile)
         {
@@ -560,6 +532,42 @@ namespace SharpGLTF.Materials
 
         #endregion
 
+        #region API - OBSOLETE
+
+        [Obsolete("This channel is used by KHR_materials_pbrSpecularGlossiness extension, which has been deprecated by Khronos; use WithBaseColor instead.")]
+        public MaterialBuilder WithDiffuse(Vector4 rgba) { return WithChannelParam(KnownChannel.Diffuse, KnownProperty.RGBA, rgba); }
+
+        [Obsolete("This channel is used by KHR_materials_pbrSpecularGlossiness extension, which has been deprecated by Khronos; use WithBaseColor instead.")]
+        public MaterialBuilder WithDiffuse(IMAGEFILE imageFile, Vector4? rgba = null)
+        {
+            WithChannelImage(KnownChannel.Diffuse, imageFile);
+            if (rgba.HasValue) WithDiffuse(rgba.Value);
+            return this;
+        }
+
+        [Obsolete("This channel is used by KHR_materials_pbrSpecularGlossiness extension, which has been deprecated by Khronos; use WithSpecularColor instead.")]
+        public MaterialBuilder WithSpecularGlossiness(Vector3? specular = null, float? glossiness = null)
+        {
+            if (!specular.HasValue && !glossiness.HasValue) return this;
+
+            var channel = UseChannel(KnownChannel.SpecularGlossiness);
+
+            if (specular.HasValue) channel.Parameters[KnownProperty.SpecularFactor] = specular.Value;
+            if (glossiness.HasValue) channel.Parameters[KnownProperty.GlossinessFactor] = glossiness.Value;
+
+            return this;
+        }
+
+        [Obsolete("This channel is used by KHR_materials_pbrSpecularGlossiness extension, which has been deprecated by Khronos; use WithSpecularColor instead.")]
+        public MaterialBuilder WithSpecularGlossiness(IMAGEFILE imageFile, Vector3? specular = null, float? glossiness = null)
+        {
+            WithChannelImage(KnownChannel.SpecularGlossiness, imageFile);
+            WithSpecularGlossiness(specular, glossiness);
+            return this;
+        }
+
+        #endregion
+
         #region nested types
 
         sealed class _ContentComparer : IEqualityComparer<MaterialBuilder>