babylon.pbrMaterial.d.ts 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. /// <reference path="../../../dist/preview release/babylon.d.ts" />
  2. declare module BABYLON {
  3. class PBRMaterial extends BABYLON.Material {
  4. directIntensity: number;
  5. emissiveIntensity: number;
  6. environmentIntensity: number;
  7. specularIntensity: number;
  8. private _lightingInfos;
  9. overloadedShadowIntensity: number;
  10. overloadedShadeIntensity: number;
  11. private _overloadedShadowInfos;
  12. cameraExposure: number;
  13. cameraContrast: number;
  14. private _cameraInfos;
  15. overloadedAmbientIntensity: number;
  16. overloadedAlbedoIntensity: number;
  17. overloadedReflectivityIntensity: number;
  18. overloadedEmissiveIntensity: number;
  19. private _overloadedIntensity;
  20. overloadedAmbient: Color3;
  21. overloadedAlbedo: Color3;
  22. overloadedReflectivity: Color3;
  23. overloadedEmissive: Color3;
  24. overloadedReflection: Color3;
  25. overloadedMicroSurface: number;
  26. overloadedMicroSurfaceIntensity: number;
  27. overloadedReflectionIntensity: number;
  28. private _overloadedMicroSurface;
  29. disableBumpMap: boolean;
  30. albedoTexture: BaseTexture;
  31. ambientTexture: BaseTexture;
  32. opacityTexture: BaseTexture;
  33. reflectionTexture: BaseTexture;
  34. emissiveTexture: BaseTexture;
  35. reflectivityTexture: BaseTexture;
  36. bumpTexture: BaseTexture;
  37. lightmapTexture: BaseTexture;
  38. refractionTexture: BaseTexture;
  39. ambientColor: Color3;
  40. albedoColor: Color3;
  41. reflectivityColor: Color3;
  42. reflectionColor: Color3;
  43. microSurface: number;
  44. emissiveColor: Color3;
  45. useAlphaFromAlbedoTexture: boolean;
  46. useEmissiveAsIllumination: boolean;
  47. linkEmissiveWithAlbedo: boolean;
  48. useSpecularOverAlpha: boolean;
  49. disableLighting: boolean;
  50. indexOfRefraction: number;
  51. invertRefractionY: boolean;
  52. linkRefractionWithTransparency: boolean;
  53. useLightmapAsShadowmap: boolean;
  54. opacityFresnelParameters: FresnelParameters;
  55. emissiveFresnelParameters: FresnelParameters;
  56. useMicroSurfaceFromReflectivityMapAlpha: boolean;
  57. private _renderTargets;
  58. private _worldViewProjectionMatrix;
  59. private _globalAmbientColor;
  60. private _tempColor;
  61. private _renderId;
  62. private _defines;
  63. private _cachedDefines;
  64. private _useLogarithmicDepth;
  65. constructor(name: string, scene: Scene);
  66. useLogarithmicDepth: boolean;
  67. needAlphaBlending(): boolean;
  68. needAlphaTesting(): boolean;
  69. private _shouldUseAlphaFromAlbedoTexture();
  70. getAlphaTestTexture(): BaseTexture;
  71. private _checkCache(scene, mesh?, useInstances?);
  72. static PrepareDefinesForLights(scene: Scene, mesh: AbstractMesh, defines: MaterialDefines): boolean;
  73. private static _scaledAlbedo;
  74. private static _scaledReflectivity;
  75. private static _scaledEmissive;
  76. private static _scaledReflection;
  77. static BindLights(scene: Scene, mesh: AbstractMesh, effect: Effect, defines: MaterialDefines): void;
  78. isReady(mesh?: AbstractMesh, useInstances?: boolean): boolean;
  79. unbind(): void;
  80. bindOnlyWorldMatrix(world: Matrix): void;
  81. private _myScene;
  82. private _myShadowGenerator;
  83. bind(world: Matrix, mesh?: Mesh): void;
  84. getAnimatables(): IAnimatable[];
  85. dispose(forceDisposeEffect?: boolean): void;
  86. clone(name: string): PBRMaterial;
  87. serialize(): any;
  88. static Parse(source: any, scene: Scene, rootUrl: string): PBRMaterial;
  89. }
  90. }
  91. /// <reference path="../../../dist/preview release/babylon.d.ts" />
  92. declare module BABYLON {
  93. class SphericalHarmonics {
  94. L00: Vector3;
  95. L1_1: Vector3;
  96. L10: Vector3;
  97. L11: Vector3;
  98. L2_2: Vector3;
  99. L2_1: Vector3;
  100. L20: Vector3;
  101. L21: Vector3;
  102. L22: Vector3;
  103. addLight(direction: Vector3, color: Color3, deltaSolidAngle: number): void;
  104. scale(scale: number): void;
  105. }
  106. }
  107. /// <reference path="../../../dist/preview release/babylon.d.ts" />
  108. declare module BABYLON {
  109. class SphericalPolynomial {
  110. x: Vector3;
  111. y: Vector3;
  112. z: Vector3;
  113. xx: Vector3;
  114. yy: Vector3;
  115. zz: Vector3;
  116. xy: Vector3;
  117. yz: Vector3;
  118. zx: Vector3;
  119. addAmbient(color: Color3): void;
  120. static getSphericalPolynomialFromHarmonics(harmonics: SphericalHarmonics): SphericalPolynomial;
  121. }
  122. }
  123. /// <reference path="../../../dist/preview release/babylon.d.ts" />
  124. declare module BABYLON.Internals {
  125. interface CubeMapInfo {
  126. front: Float32Array;
  127. back: Float32Array;
  128. left: Float32Array;
  129. right: Float32Array;
  130. up: Float32Array;
  131. down: Float32Array;
  132. size: number;
  133. }
  134. class PanoramaToCubeMapTools {
  135. private static FACE_FRONT;
  136. private static FACE_BACK;
  137. private static FACE_LEFT;
  138. private static FACE_RIGHT;
  139. private static FACE_UP;
  140. private static FACE_DOWN;
  141. static ConvertPanoramaToCubemap(float32Array: Float32Array, inputWidth: number, inputHeight: number, size: number): CubeMapInfo;
  142. private static CreateCubemapTexture(texSize, faceData, float32Array, inputWidth, inputHeight);
  143. private static CalcProjectionSpherical(vDir, float32Array, inputWidth, inputHeight);
  144. }
  145. }
  146. /// <reference path="../../../dist/preview release/babylon.d.ts" />
  147. declare module BABYLON.Internals {
  148. class CubeMapToSphericalPolynomialTools {
  149. private static FileFaces;
  150. static ConvertCubeMapToSphericalPolynomial(cubeInfo: CubeMapInfo): SphericalPolynomial;
  151. }
  152. }
  153. /// <reference path="../../../dist/preview release/babylon.d.ts" />
  154. declare module BABYLON.Internals {
  155. interface HDRInfo {
  156. height: number;
  157. width: number;
  158. dataPosition: number;
  159. }
  160. class HDRTools {
  161. private static Ldexp(mantissa, exponent);
  162. private static Rgbe2float(float32array, red, green, blue, exponent, index);
  163. private static readStringLine(uint8array, startIndex);
  164. static RGBE_ReadHeader(uint8array: Uint8Array): HDRInfo;
  165. static GetCubeMapTextureData(buffer: ArrayBuffer, size: number): CubeMapInfo;
  166. static RGBE_ReadPixels(uint8array: Uint8Array, hdrInfo: HDRInfo): Float32Array;
  167. private static RGBE_ReadPixels_RLE(uint8array, hdrInfo);
  168. }
  169. }
  170. /// <reference path="../../../dist/preview release/babylon.d.ts" />
  171. declare module BABYLON {
  172. class HDRCubeTexture extends BaseTexture {
  173. url: string;
  174. coordinatesMode: number;
  175. private _noMipmap;
  176. private _extensions;
  177. private _textureMatrix;
  178. private _size;
  179. sphericalPolynomial: SphericalPolynomial;
  180. constructor(url: string, scene: Scene, size: number, noMipmap?: boolean);
  181. private loadTexture();
  182. clone(): HDRCubeTexture;
  183. delayLoad(): void;
  184. getReflectionTextureMatrix(): Matrix;
  185. static Parse(parsedTexture: any, scene: Scene, rootUrl: string): HDRCubeTexture;
  186. serialize(): any;
  187. }
  188. }