pbrBRDFConfiguration.d.ts 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. import { MaterialDefines } from "../materialDefines";
  2. import { MaterialPluginBase } from "../materialPluginBase";
  3. import type { PBRBaseMaterial } from "./pbrBaseMaterial";
  4. /**
  5. * @internal
  6. */
  7. export declare class MaterialBRDFDefines extends MaterialDefines {
  8. BRDF_V_HEIGHT_CORRELATED: boolean;
  9. MS_BRDF_ENERGY_CONSERVATION: boolean;
  10. SPHERICAL_HARMONICS: boolean;
  11. SPECULAR_GLOSSINESS_ENERGY_CONSERVATION: boolean;
  12. }
  13. /**
  14. * Plugin that implements the BRDF component of the PBR material
  15. */
  16. export declare class PBRBRDFConfiguration extends MaterialPluginBase {
  17. /**
  18. * Default value used for the energy conservation.
  19. * This should only be changed to adapt to the type of texture in scene.environmentBRDFTexture.
  20. */
  21. static DEFAULT_USE_ENERGY_CONSERVATION: boolean;
  22. /**
  23. * Default value used for the Smith Visibility Height Correlated mode.
  24. * This should only be changed to adapt to the type of texture in scene.environmentBRDFTexture.
  25. */
  26. static DEFAULT_USE_SMITH_VISIBILITY_HEIGHT_CORRELATED: boolean;
  27. /**
  28. * Default value used for the IBL diffuse part.
  29. * This can help switching back to the polynomials mode globally which is a tiny bit
  30. * less GPU intensive at the drawback of a lower quality.
  31. */
  32. static DEFAULT_USE_SPHERICAL_HARMONICS: boolean;
  33. /**
  34. * Default value used for activating energy conservation for the specular workflow.
  35. * If activated, the albedo color is multiplied with (1. - maxChannel(specular color)).
  36. * If deactivated, a material is only physically plausible, when (albedo color + specular color) < 1.
  37. */
  38. static DEFAULT_USE_SPECULAR_GLOSSINESS_INPUT_ENERGY_CONSERVATION: boolean;
  39. private _useEnergyConservation;
  40. /**
  41. * Defines if the material uses energy conservation.
  42. */
  43. useEnergyConservation: boolean;
  44. private _useSmithVisibilityHeightCorrelated;
  45. /**
  46. * LEGACY Mode set to false
  47. * Defines if the material uses height smith correlated visibility term.
  48. * If you intent to not use our default BRDF, you need to load a separate BRDF Texture for the PBR
  49. * You can either load https://assets.babylonjs.com/environments/uncorrelatedBRDF.png
  50. * or https://assets.babylonjs.com/environments/uncorrelatedBRDF.dds to have more precision
  51. * Not relying on height correlated will also disable energy conservation.
  52. */
  53. useSmithVisibilityHeightCorrelated: boolean;
  54. private _useSphericalHarmonics;
  55. /**
  56. * LEGACY Mode set to false
  57. * Defines if the material uses spherical harmonics vs spherical polynomials for the
  58. * diffuse part of the IBL.
  59. * The harmonics despite a tiny bigger cost has been proven to provide closer results
  60. * to the ground truth.
  61. */
  62. useSphericalHarmonics: boolean;
  63. private _useSpecularGlossinessInputEnergyConservation;
  64. /**
  65. * Defines if the material uses energy conservation, when the specular workflow is active.
  66. * If activated, the albedo color is multiplied with (1. - maxChannel(specular color)).
  67. * If deactivated, a material is only physically plausible, when (albedo color + specular color) < 1.
  68. * In the deactivated case, the material author has to ensure energy conservation, for a physically plausible rendering.
  69. */
  70. useSpecularGlossinessInputEnergyConservation: boolean;
  71. /** @internal */
  72. private _internalMarkAllSubMeshesAsMiscDirty;
  73. /** @internal */
  74. _markAllSubMeshesAsMiscDirty(): void;
  75. constructor(material: PBRBaseMaterial, addToPluginList?: boolean);
  76. prepareDefines(defines: MaterialBRDFDefines): void;
  77. getClassName(): string;
  78. }