babylon.waterMaterial.d.ts 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. declare module BABYLON {
  2. class WaterMaterial extends PushMaterial {
  3. renderTargetSize: Vector2;
  4. private _bumpTexture;
  5. bumpTexture: BaseTexture;
  6. diffuseColor: Color3;
  7. specularColor: Color3;
  8. specularPower: number;
  9. private _disableLighting;
  10. disableLighting: boolean;
  11. private _maxSimultaneousLights;
  12. maxSimultaneousLights: number;
  13. /**
  14. * @param {number}: Represents the wind force
  15. */
  16. windForce: number;
  17. /**
  18. * @param {Vector2}: The direction of the wind in the plane (X, Z)
  19. */
  20. windDirection: Vector2;
  21. /**
  22. * @param {number}: Wave height, represents the height of the waves
  23. */
  24. waveHeight: number;
  25. /**
  26. * @param {number}: Bump height, represents the bump height related to the bump map
  27. */
  28. bumpHeight: number;
  29. /**
  30. * @param {boolean}: Add a smaller moving bump to less steady waves.
  31. */
  32. private _bumpSuperimpose;
  33. bumpSuperimpose: boolean;
  34. /**
  35. * @param {boolean}: Color refraction and reflection differently with .waterColor2 and .colorBlendFactor2. Non-linear (physically correct) fresnel.
  36. */
  37. private _fresnelSeparate;
  38. fresnelSeparate: boolean;
  39. /**
  40. * @param {boolean}: bump Waves modify the reflection.
  41. */
  42. private _bumpAffectsReflection;
  43. bumpAffectsReflection: boolean;
  44. /**
  45. * @param {number}: The water color blended with the refraction (near)
  46. */
  47. waterColor: Color3;
  48. /**
  49. * @param {number}: The blend factor related to the water color
  50. */
  51. colorBlendFactor: number;
  52. /**
  53. * @param {number}: The water color blended with the reflection (far)
  54. */
  55. waterColor2: Color3;
  56. /**
  57. * @param {number}: The blend factor related to the water color (reflection, far)
  58. */
  59. colorBlendFactor2: number;
  60. /**
  61. * @param {number}: Represents the maximum length of a wave
  62. */
  63. waveLength: number;
  64. /**
  65. * @param {number}: Defines the waves speed
  66. */
  67. waveSpeed: number;
  68. protected _renderTargets: SmartArray<RenderTargetTexture>;
  69. private _mesh;
  70. private _refractionRTT;
  71. private _reflectionRTT;
  72. private _reflectionTransform;
  73. private _lastTime;
  74. private _lastDeltaTime;
  75. private _renderId;
  76. private _useLogarithmicDepth;
  77. private _waitingRenderList;
  78. /**
  79. * Gets a boolean indicating that current material needs to register RTT
  80. */
  81. readonly hasRenderTargetTextures: boolean;
  82. /**
  83. * Constructor
  84. */
  85. constructor(name: string, scene: Scene, renderTargetSize?: Vector2);
  86. useLogarithmicDepth: boolean;
  87. readonly refractionTexture: Nullable<RenderTargetTexture>;
  88. readonly reflectionTexture: Nullable<RenderTargetTexture>;
  89. addToRenderList(node: any): void;
  90. enableRenderTargets(enable: boolean): void;
  91. getRenderList(): Nullable<AbstractMesh[]>;
  92. readonly renderTargetsEnabled: boolean;
  93. needAlphaBlending(): boolean;
  94. needAlphaTesting(): boolean;
  95. getAlphaTestTexture(): Nullable<BaseTexture>;
  96. isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
  97. bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
  98. private _createRenderTargets;
  99. getAnimatables(): IAnimatable[];
  100. getActiveTextures(): BaseTexture[];
  101. hasTexture(texture: BaseTexture): boolean;
  102. dispose(forceDisposeEffect?: boolean): void;
  103. clone(name: string): WaterMaterial;
  104. serialize(): any;
  105. getClassName(): string;
  106. static Parse(source: any, scene: Scene, rootUrl: string): WaterMaterial;
  107. static CreateDefaultMesh(name: string, scene: Scene): Mesh;
  108. }
  109. }