pbrIridescenceConfiguration.d.ts 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. import type { Nullable } from "../../types";
  2. import type { BaseTexture } from "../../Materials/Textures/baseTexture";
  3. import type { UniformBuffer } from "../../Materials/uniformBuffer";
  4. import type { IAnimatable } from "../../Animations/animatable.interface";
  5. import type { EffectFallbacks } from "../effectFallbacks";
  6. import { MaterialPluginBase } from "../materialPluginBase";
  7. import { MaterialDefines } from "../materialDefines";
  8. import type { Scene } from "../../scene";
  9. import type { PBRBaseMaterial } from "./pbrBaseMaterial";
  10. /**
  11. * @internal
  12. */
  13. export declare class MaterialIridescenceDefines extends MaterialDefines {
  14. IRIDESCENCE: boolean;
  15. IRIDESCENCE_TEXTURE: boolean;
  16. IRIDESCENCE_TEXTUREDIRECTUV: number;
  17. IRIDESCENCE_THICKNESS_TEXTURE: boolean;
  18. IRIDESCENCE_THICKNESS_TEXTUREDIRECTUV: number;
  19. }
  20. /**
  21. * Plugin that implements the iridescence (thin film) component of the PBR material
  22. */
  23. export declare class PBRIridescenceConfiguration extends MaterialPluginBase {
  24. protected _material: PBRBaseMaterial;
  25. /**
  26. * The default minimum thickness of the thin-film layer given in nanometers (nm).
  27. * Defaults to 100 nm.
  28. * @internal
  29. */
  30. static readonly _DefaultMinimumThickness = 100;
  31. /**
  32. * The default maximum thickness of the thin-film layer given in nanometers (nm).
  33. * Defaults to 400 nm.
  34. * @internal
  35. */
  36. static readonly _DefaultMaximumThickness = 400;
  37. /**
  38. * The default index of refraction of the thin-film layer.
  39. * Defaults to 1.3
  40. * @internal
  41. */
  42. static readonly _DefaultIndexOfRefraction = 1.3;
  43. private _isEnabled;
  44. /**
  45. * Defines if the iridescence is enabled in the material.
  46. */
  47. isEnabled: boolean;
  48. /**
  49. * Defines the iridescence layer strength (between 0 and 1) it defaults to 1.
  50. */
  51. intensity: number;
  52. /**
  53. * Defines the minimum thickness of the thin-film layer given in nanometers (nm).
  54. */
  55. minimumThickness: number;
  56. /**
  57. * Defines the maximum thickness of the thin-film layer given in nanometers (nm). This will be the thickness used if not thickness texture has been set.
  58. */
  59. maximumThickness: number;
  60. /**
  61. * Defines the maximum thickness of the thin-film layer given in nanometers (nm).
  62. */
  63. indexOfRefraction: number;
  64. private _texture;
  65. /**
  66. * Stores the iridescence intensity in a texture (red channel)
  67. */
  68. texture: Nullable<BaseTexture>;
  69. private _thicknessTexture;
  70. /**
  71. * Stores the iridescence thickness in a texture (green channel)
  72. */
  73. thicknessTexture: Nullable<BaseTexture>;
  74. /** @internal */
  75. private _internalMarkAllSubMeshesAsTexturesDirty;
  76. /** @internal */
  77. _markAllSubMeshesAsTexturesDirty(): void;
  78. constructor(material: PBRBaseMaterial, addToPluginList?: boolean);
  79. isReadyForSubMesh(defines: MaterialIridescenceDefines, scene: Scene): boolean;
  80. prepareDefinesBeforeAttributes(defines: MaterialIridescenceDefines, scene: Scene): void;
  81. bindForSubMesh(uniformBuffer: UniformBuffer, scene: Scene): void;
  82. hasTexture(texture: BaseTexture): boolean;
  83. getActiveTextures(activeTextures: BaseTexture[]): void;
  84. getAnimatables(animatables: IAnimatable[]): void;
  85. dispose(forceDisposeTextures?: boolean): void;
  86. getClassName(): string;
  87. addFallbacks(defines: MaterialIridescenceDefines, fallbacks: EffectFallbacks, currentRank: number): number;
  88. getSamplers(samplers: string[]): void;
  89. getUniforms(): {
  90. ubo?: Array<{
  91. name: string;
  92. size: number;
  93. type: string;
  94. }>;
  95. vertex?: string;
  96. fragment?: string;
  97. };
  98. }