pbrSheenConfiguration.d.ts 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. import type { UniformBuffer } from "../../Materials/uniformBuffer";
  2. import { Color3 } from "../../Maths/math.color";
  3. import type { BaseTexture } from "../../Materials/Textures/baseTexture";
  4. import type { Nullable } from "../../types";
  5. import type { IAnimatable } from "../../Animations/animatable.interface";
  6. import type { EffectFallbacks } from "../effectFallbacks";
  7. import type { SubMesh } from "../../Meshes/subMesh";
  8. import { MaterialPluginBase } from "../materialPluginBase";
  9. import { MaterialDefines } from "../materialDefines";
  10. import type { Engine } from "../../Engines/engine";
  11. import type { Scene } from "../../scene";
  12. import type { PBRBaseMaterial } from "./pbrBaseMaterial";
  13. /**
  14. * @internal
  15. */
  16. export declare class MaterialSheenDefines extends MaterialDefines {
  17. SHEEN: boolean;
  18. SHEEN_TEXTURE: boolean;
  19. SHEEN_GAMMATEXTURE: boolean;
  20. SHEEN_TEXTURE_ROUGHNESS: boolean;
  21. SHEEN_TEXTUREDIRECTUV: number;
  22. SHEEN_TEXTURE_ROUGHNESSDIRECTUV: number;
  23. SHEEN_LINKWITHALBEDO: boolean;
  24. SHEEN_ROUGHNESS: boolean;
  25. SHEEN_ALBEDOSCALING: boolean;
  26. SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE: boolean;
  27. }
  28. /**
  29. * Plugin that implements the sheen component of the PBR material.
  30. */
  31. export declare class PBRSheenConfiguration extends MaterialPluginBase {
  32. private _isEnabled;
  33. /**
  34. * Defines if the material uses sheen.
  35. */
  36. isEnabled: boolean;
  37. private _linkSheenWithAlbedo;
  38. /**
  39. * Defines if the sheen is linked to the sheen color.
  40. */
  41. linkSheenWithAlbedo: boolean;
  42. /**
  43. * Defines the sheen intensity.
  44. */
  45. intensity: number;
  46. /**
  47. * Defines the sheen color.
  48. */
  49. color: Color3;
  50. private _texture;
  51. /**
  52. * Stores the sheen tint values in a texture.
  53. * rgb is tint
  54. * a is a intensity or roughness if the roughness property has been defined and useRoughnessFromTexture is true (in that case, textureRoughness won't be used)
  55. * If the roughness property has been defined and useRoughnessFromTexture is false then the alpha channel is not used to modulate roughness
  56. */
  57. texture: Nullable<BaseTexture>;
  58. private _useRoughnessFromMainTexture;
  59. /**
  60. * Indicates that the alpha channel of the texture property will be used for roughness.
  61. * Has no effect if the roughness (and texture!) property is not defined
  62. */
  63. useRoughnessFromMainTexture: boolean;
  64. private _roughness;
  65. /**
  66. * Defines the sheen roughness.
  67. * It is not taken into account if linkSheenWithAlbedo is true.
  68. * To stay backward compatible, material roughness is used instead if sheen roughness = null
  69. */
  70. roughness: Nullable<number>;
  71. private _textureRoughness;
  72. /**
  73. * Stores the sheen roughness in a texture.
  74. * alpha channel is the roughness. This texture won't be used if the texture property is not empty and useRoughnessFromTexture is true
  75. */
  76. textureRoughness: Nullable<BaseTexture>;
  77. private _albedoScaling;
  78. /**
  79. * If true, the sheen effect is layered above the base BRDF with the albedo-scaling technique.
  80. * It allows the strength of the sheen effect to not depend on the base color of the material,
  81. * making it easier to setup and tweak the effect
  82. */
  83. albedoScaling: boolean;
  84. /** @internal */
  85. private _internalMarkAllSubMeshesAsTexturesDirty;
  86. /** @internal */
  87. _markAllSubMeshesAsTexturesDirty(): void;
  88. constructor(material: PBRBaseMaterial, addToPluginList?: boolean);
  89. isReadyForSubMesh(defines: MaterialSheenDefines, scene: Scene): boolean;
  90. prepareDefinesBeforeAttributes(defines: MaterialSheenDefines, scene: Scene): void;
  91. bindForSubMesh(uniformBuffer: UniformBuffer, scene: Scene, engine: Engine, subMesh: SubMesh): void;
  92. hasTexture(texture: BaseTexture): boolean;
  93. getActiveTextures(activeTextures: BaseTexture[]): void;
  94. getAnimatables(animatables: IAnimatable[]): void;
  95. dispose(forceDisposeTextures?: boolean): void;
  96. getClassName(): string;
  97. addFallbacks(defines: MaterialSheenDefines, fallbacks: EffectFallbacks, currentRank: number): number;
  98. getSamplers(samplers: string[]): void;
  99. getUniforms(): {
  100. ubo?: Array<{
  101. name: string;
  102. size: number;
  103. type: string;
  104. }>;
  105. vertex?: string;
  106. fragment?: string;
  107. };
  108. }