pbrMetallicRoughnessMaterial.d.ts 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. import type { Scene } from "../../scene";
  2. import type { Color3 } from "../../Maths/math.color";
  3. import type { BaseTexture } from "../../Materials/Textures/baseTexture";
  4. import { PBRBaseSimpleMaterial } from "./pbrBaseSimpleMaterial";
  5. import type { Nullable } from "../../types";
  6. /**
  7. * The PBR material of BJS following the metal roughness convention.
  8. *
  9. * This fits to the PBR convention in the GLTF definition:
  10. * https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Archived/KHR_materials_pbrSpecularGlossiness/README.md
  11. */
  12. export declare class PBRMetallicRoughnessMaterial extends PBRBaseSimpleMaterial {
  13. /**
  14. * The base color has two different interpretations depending on the value of metalness.
  15. * When the material is a metal, the base color is the specific measured reflectance value
  16. * at normal incidence (F0). For a non-metal the base color represents the reflected diffuse color
  17. * of the material.
  18. */
  19. baseColor: Color3;
  20. /**
  21. * Base texture of the metallic workflow. It contains both the baseColor information in RGB as
  22. * well as opacity information in the alpha channel.
  23. */
  24. baseTexture: Nullable<BaseTexture>;
  25. /**
  26. * Specifies the metallic scalar value of the material.
  27. * Can also be used to scale the metalness values of the metallic texture.
  28. */
  29. metallic: number;
  30. /**
  31. * Specifies the roughness scalar value of the material.
  32. * Can also be used to scale the roughness values of the metallic texture.
  33. */
  34. roughness: number;
  35. /**
  36. * Texture containing both the metallic value in the B channel and the
  37. * roughness value in the G channel to keep better precision.
  38. */
  39. metallicRoughnessTexture: Nullable<BaseTexture>;
  40. /**
  41. * Instantiates a new PBRMetalRoughnessMaterial instance.
  42. *
  43. * @param name The material name
  44. * @param scene The scene the material will be use in.
  45. */
  46. constructor(name: string, scene?: Scene);
  47. /**
  48. * @returns the current class name of the material.
  49. */
  50. getClassName(): string;
  51. /**
  52. * Makes a duplicate of the current material.
  53. * @param name - name to use for the new material.
  54. * @returns cloned material instance
  55. */
  56. clone(name: string): PBRMetallicRoughnessMaterial;
  57. /**
  58. * Serialize the material to a parsable JSON object.
  59. * @returns the JSON object
  60. */
  61. serialize(): any;
  62. /**
  63. * Parses a JSON object corresponding to the serialize function.
  64. * @param source - JSON source object.
  65. * @param scene - Defines the scene we are parsing for
  66. * @param rootUrl - Defines the rootUrl of this parsed object
  67. * @returns a new PBRMetalRoughnessMaterial
  68. */
  69. static Parse(source: any, scene: Scene, rootUrl: string): PBRMetallicRoughnessMaterial;
  70. }