material.detailMapConfiguration.d.ts 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. import type { Nullable } from "../types";
  2. import type { BaseTexture } from "./Textures/baseTexture";
  3. import type { UniformBuffer } from "./uniformBuffer";
  4. import type { IAnimatable } from "../Animations/animatable.interface";
  5. import { MaterialDefines } from "./materialDefines";
  6. import { MaterialPluginBase } from "./materialPluginBase";
  7. import type { Engine } from "../Engines/engine";
  8. import type { Scene } from "../scene";
  9. import type { StandardMaterial } from "./standardMaterial";
  10. import type { PBRBaseMaterial } from "./PBR/pbrBaseMaterial";
  11. /**
  12. * @internal
  13. */
  14. export declare class MaterialDetailMapDefines extends MaterialDefines {
  15. DETAIL: boolean;
  16. DETAILDIRECTUV: number;
  17. DETAIL_NORMALBLENDMETHOD: number;
  18. }
  19. /**
  20. * Plugin that implements the detail map component of a material
  21. *
  22. * Inspired from:
  23. * Unity: https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@9.0/manual/Mask-Map-and-Detail-Map.html and https://docs.unity3d.com/Manual/StandardShaderMaterialParameterDetail.html
  24. * Unreal: https://docs.unrealengine.com/en-US/Engine/Rendering/Materials/HowTo/DetailTexturing/index.html
  25. * Cryengine: https://docs.cryengine.com/display/SDKDOC2/Detail+Maps
  26. */
  27. export declare class DetailMapConfiguration extends MaterialPluginBase {
  28. private _texture;
  29. /**
  30. * The detail texture of the material.
  31. */
  32. texture: Nullable<BaseTexture>;
  33. /**
  34. * Defines how strongly the detail diffuse/albedo channel is blended with the regular diffuse/albedo texture
  35. * Bigger values mean stronger blending
  36. */
  37. diffuseBlendLevel: number;
  38. /**
  39. * Defines how strongly the detail roughness channel is blended with the regular roughness value
  40. * Bigger values mean stronger blending. Only used with PBR materials
  41. */
  42. roughnessBlendLevel: number;
  43. /**
  44. * Defines how strong the bump effect from the detail map is
  45. * Bigger values mean stronger effect
  46. */
  47. bumpLevel: number;
  48. private _normalBlendMethod;
  49. /**
  50. * The method used to blend the bump and detail normals together
  51. */
  52. normalBlendMethod: number;
  53. private _isEnabled;
  54. /**
  55. * Enable or disable the detail map on this material
  56. */
  57. isEnabled: boolean;
  58. /** @internal */
  59. private _internalMarkAllSubMeshesAsTexturesDirty;
  60. /** @internal */
  61. _markAllSubMeshesAsTexturesDirty(): void;
  62. constructor(material: PBRBaseMaterial | StandardMaterial, addToPluginList?: boolean);
  63. isReadyForSubMesh(defines: MaterialDetailMapDefines, scene: Scene, engine: Engine): boolean;
  64. prepareDefines(defines: MaterialDetailMapDefines, scene: Scene): void;
  65. bindForSubMesh(uniformBuffer: UniformBuffer, scene: Scene): void;
  66. hasTexture(texture: BaseTexture): boolean;
  67. getActiveTextures(activeTextures: BaseTexture[]): void;
  68. getAnimatables(animatables: IAnimatable[]): void;
  69. dispose(forceDisposeTextures?: boolean): void;
  70. getClassName(): string;
  71. getSamplers(samplers: string[]): void;
  72. getUniforms(): {
  73. ubo?: Array<{
  74. name: string;
  75. size: number;
  76. type: string;
  77. }>;
  78. vertex?: string;
  79. fragment?: string;
  80. };
  81. }