babylon.waterMaterial.ts 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641
  1. /// <reference path="../../../dist/preview release/babylon.d.ts"/>
  2. module BABYLON {
  3. class WaterMaterialDefines extends MaterialDefines {
  4. public BUMP = false;
  5. public REFLECTION = false;
  6. public CLIPPLANE = false;
  7. public ALPHATEST = false;
  8. public DEPTHPREPASS = false;
  9. public POINTSIZE = false;
  10. public FOG = false;
  11. public NORMAL = false;
  12. public UV1 = false;
  13. public UV2 = false;
  14. public VERTEXCOLOR = false;
  15. public VERTEXALPHA = false;
  16. public NUM_BONE_INFLUENCERS = 0;
  17. public BonesPerMesh = 0;
  18. public INSTANCES = false;
  19. public SPECULARTERM = false;
  20. public LOGARITHMICDEPTH = false;
  21. public FRESNELSEPARATE = false;
  22. public BUMPSUPERIMPOSE = false;
  23. public BUMPAFFECTSREFLECTION = false;
  24. constructor() {
  25. super();
  26. this.rebuild();
  27. }
  28. }
  29. export class WaterMaterial extends PushMaterial {
  30. /*
  31. * Public members
  32. */
  33. @serializeAsTexture("bumpTexture")
  34. private _bumpTexture: BaseTexture;
  35. @expandToProperty("_markAllSubMeshesAsTexturesDirty")
  36. public bumpTexture: BaseTexture;
  37. @serializeAsColor3()
  38. public diffuseColor = new Color3(1, 1, 1);
  39. @serializeAsColor3()
  40. public specularColor = new Color3(0, 0, 0);
  41. @serialize()
  42. public specularPower = 64;
  43. @serialize("disableLighting")
  44. private _disableLighting = false;
  45. @expandToProperty("_markAllSubMeshesAsLightsDirty")
  46. public disableLighting: boolean;
  47. @serialize("maxSimultaneousLights")
  48. private _maxSimultaneousLights = 4;
  49. @expandToProperty("_markAllSubMeshesAsLightsDirty")
  50. public maxSimultaneousLights: number;
  51. /**
  52. * @param {number}: Represents the wind force
  53. */
  54. @serialize()
  55. public windForce: number = 6;
  56. /**
  57. * @param {Vector2}: The direction of the wind in the plane (X, Z)
  58. */
  59. @serializeAsVector2()
  60. public windDirection: Vector2 = new Vector2(0, 1);
  61. /**
  62. * @param {number}: Wave height, represents the height of the waves
  63. */
  64. @serialize()
  65. public waveHeight: number = 0.4;
  66. /**
  67. * @param {number}: Bump height, represents the bump height related to the bump map
  68. */
  69. @serialize()
  70. public bumpHeight: number = 0.4;
  71. /**
  72. * @param {boolean}: Add a smaller moving bump to less steady waves.
  73. */
  74. @serialize("bumpSuperimpose")
  75. private _bumpSuperimpose = false;
  76. @expandToProperty("_markAllSubMeshesAsMiscDirty")
  77. public bumpSuperimpose: boolean;
  78. /**
  79. * @param {boolean}: Color refraction and reflection differently with .waterColor2 and .colorBlendFactor2. Non-linear (physically correct) fresnel.
  80. */
  81. @serialize("fresnelSeparate")
  82. private _fresnelSeparate = false;
  83. @expandToProperty("_markAllSubMeshesAsMiscDirty")
  84. public fresnelSeparate: boolean;
  85. /**
  86. * @param {boolean}: bump Waves modify the reflection.
  87. */
  88. @serialize("bumpAffectsReflection")
  89. private _bumpAffectsReflection = false;
  90. @expandToProperty("_markAllSubMeshesAsMiscDirty")
  91. public bumpAffectsReflection: boolean;
  92. /**
  93. * @param {number}: The water color blended with the refraction (near)
  94. */
  95. @serializeAsColor3()
  96. public waterColor: Color3 = new Color3(0.1, 0.1, 0.6);
  97. /**
  98. * @param {number}: The blend factor related to the water color
  99. */
  100. @serialize()
  101. public colorBlendFactor: number = 0.2;
  102. /**
  103. * @param {number}: The water color blended with the reflection (far)
  104. */
  105. @serializeAsColor3()
  106. public waterColor2: Color3 = new Color3(0.1, 0.1, 0.6);
  107. /**
  108. * @param {number}: The blend factor related to the water color (reflection, far)
  109. */
  110. @serialize()
  111. public colorBlendFactor2: number = 0.2;
  112. /**
  113. * @param {number}: Represents the maximum length of a wave
  114. */
  115. @serialize()
  116. public waveLength: number = 0.1;
  117. /**
  118. * @param {number}: Defines the waves speed
  119. */
  120. @serialize()
  121. public waveSpeed: number = 1.0;
  122. protected _renderTargets = new SmartArray<RenderTargetTexture>(16);
  123. /*
  124. * Private members
  125. */
  126. private _mesh: AbstractMesh = null;
  127. private _refractionRTT: RenderTargetTexture;
  128. private _reflectionRTT: RenderTargetTexture;
  129. private _material: ShaderMaterial;
  130. private _reflectionTransform: Matrix = Matrix.Zero();
  131. private _lastTime: number = 0;
  132. private _lastDeltaTime: number = 0;
  133. private _renderId: number;
  134. private _useLogarithmicDepth: boolean;
  135. /**
  136. * Constructor
  137. */
  138. constructor(name: string, scene: Scene, public renderTargetSize: Vector2 = new Vector2(512, 512)) {
  139. super(name, scene);
  140. this._createRenderTargets(scene, renderTargetSize);
  141. // Create render targets
  142. this.getRenderTargetTextures = (): SmartArray<RenderTargetTexture> => {
  143. this._renderTargets.reset();
  144. this._renderTargets.push(this._reflectionRTT);
  145. this._renderTargets.push(this._refractionRTT);
  146. return this._renderTargets;
  147. }
  148. }
  149. @serialize()
  150. public get useLogarithmicDepth(): boolean {
  151. return this._useLogarithmicDepth;
  152. }
  153. public set useLogarithmicDepth(value: boolean) {
  154. this._useLogarithmicDepth = value && this.getScene().getEngine().getCaps().fragmentDepthSupported;
  155. this._markAllSubMeshesAsMiscDirty();
  156. }
  157. // Get / Set
  158. public get refractionTexture(): RenderTargetTexture {
  159. return this._refractionRTT;
  160. }
  161. public get reflectionTexture(): RenderTargetTexture {
  162. return this._reflectionRTT;
  163. }
  164. // Methods
  165. public addToRenderList(node: any): void {
  166. this._refractionRTT.renderList.push(node);
  167. this._reflectionRTT.renderList.push(node);
  168. }
  169. public enableRenderTargets(enable: boolean): void {
  170. var refreshRate = enable ? 1 : 0;
  171. this._refractionRTT.refreshRate = refreshRate;
  172. this._reflectionRTT.refreshRate = refreshRate;
  173. }
  174. public getRenderList(): AbstractMesh[] {
  175. return this._refractionRTT.renderList;
  176. }
  177. public get renderTargetsEnabled(): boolean {
  178. return !(this._refractionRTT.refreshRate === 0);
  179. }
  180. public needAlphaBlending(): boolean {
  181. return (this.alpha < 1.0);
  182. }
  183. public needAlphaTesting(): boolean {
  184. return false;
  185. }
  186. public getAlphaTestTexture(): BaseTexture {
  187. return null;
  188. }
  189. public isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean {
  190. if (this.isFrozen) {
  191. if (this._wasPreviouslyReady && subMesh.effect) {
  192. return true;
  193. }
  194. }
  195. if (!subMesh._materialDefines) {
  196. subMesh._materialDefines = new WaterMaterialDefines();
  197. }
  198. var defines = <WaterMaterialDefines>subMesh._materialDefines;
  199. var scene = this.getScene();
  200. if (!this.checkReadyOnEveryCall && subMesh.effect) {
  201. if (this._renderId === scene.getRenderId()) {
  202. return true;
  203. }
  204. }
  205. var engine = scene.getEngine();
  206. // Textures
  207. if (defines._areTexturesDirty) {
  208. defines._needUVs = false;
  209. if (scene.texturesEnabled) {
  210. if (this.bumpTexture && StandardMaterial.BumpTextureEnabled) {
  211. if (!this.bumpTexture.isReady()) {
  212. return false;
  213. } else {
  214. defines._needUVs = true;
  215. defines.BUMP = true;
  216. }
  217. }
  218. if (StandardMaterial.ReflectionTextureEnabled) {
  219. defines.REFLECTION = true;
  220. }
  221. }
  222. }
  223. MaterialHelper.PrepareDefinesForFrameBoundValues(scene, engine, defines, useInstances);
  224. MaterialHelper.PrepareDefinesForMisc(mesh, scene, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, defines);
  225. if (defines._areMiscDirty) {
  226. if (this._fresnelSeparate) {
  227. defines.FRESNELSEPARATE = true;
  228. }
  229. if (this._bumpSuperimpose) {
  230. defines.BUMPSUPERIMPOSE = true;
  231. }
  232. if (this._bumpAffectsReflection) {
  233. defines.BUMPAFFECTSREFLECTION = true;
  234. }
  235. }
  236. // Lights
  237. defines._needNormals = MaterialHelper.PrepareDefinesForLights(scene, mesh, defines, true, this._maxSimultaneousLights, this._disableLighting);
  238. // Attribs
  239. MaterialHelper.PrepareDefinesForAttributes(mesh, defines, true, true);
  240. this._mesh = mesh;
  241. // Get correct effect
  242. if (defines.isDirty) {
  243. defines.markAsProcessed();
  244. scene.resetCachedMaterial();
  245. // Fallbacks
  246. var fallbacks = new EffectFallbacks();
  247. if (defines.FOG) {
  248. fallbacks.addFallback(1, "FOG");
  249. }
  250. if (defines.LOGARITHMICDEPTH) {
  251. fallbacks.addFallback(0, "LOGARITHMICDEPTH");
  252. }
  253. MaterialHelper.HandleFallbacksForShadows(defines, fallbacks, this.maxSimultaneousLights);
  254. if (defines.NUM_BONE_INFLUENCERS > 0) {
  255. fallbacks.addCPUSkinningFallback(0, mesh);
  256. }
  257. //Attributes
  258. var attribs = [VertexBuffer.PositionKind];
  259. if (defines.NORMAL) {
  260. attribs.push(VertexBuffer.NormalKind);
  261. }
  262. if (defines.UV1) {
  263. attribs.push(VertexBuffer.UVKind);
  264. }
  265. if (defines.UV2) {
  266. attribs.push(VertexBuffer.UV2Kind);
  267. }
  268. if (defines.VERTEXCOLOR) {
  269. attribs.push(VertexBuffer.ColorKind);
  270. }
  271. MaterialHelper.PrepareAttributesForBones(attribs, mesh, defines, fallbacks);
  272. MaterialHelper.PrepareAttributesForInstances(attribs, defines);
  273. // Legacy browser patch
  274. var shaderName = "water";
  275. var join = defines.toString();
  276. var uniforms = ["world", "view", "viewProjection", "vEyePosition", "vLightsType", "vDiffuseColor", "vSpecularColor",
  277. "vFogInfos", "vFogColor", "pointSize",
  278. "vNormalInfos",
  279. "mBones",
  280. "vClipPlane", "normalMatrix",
  281. "logarithmicDepthConstant",
  282. // Water
  283. "worldReflectionViewProjection", "windDirection", "waveLength", "time", "windForce",
  284. "cameraPosition", "bumpHeight", "waveHeight", "waterColor", "waterColor2", "colorBlendFactor", "colorBlendFactor2", "waveSpeed"
  285. ]
  286. var samplers = ["normalSampler",
  287. // Water
  288. "refractionSampler", "reflectionSampler"
  289. ];
  290. var uniformBuffers = [];
  291. MaterialHelper.PrepareUniformsAndSamplersList(<EffectCreationOptions>{
  292. uniformsNames: uniforms,
  293. uniformBuffersNames: uniformBuffers,
  294. samplers: samplers,
  295. defines: defines,
  296. maxSimultaneousLights: this.maxSimultaneousLights
  297. });
  298. subMesh.setEffect(scene.getEngine().createEffect(shaderName,
  299. <EffectCreationOptions>{
  300. attributes: attribs,
  301. uniformsNames: uniforms,
  302. uniformBuffersNames: uniformBuffers,
  303. samplers: samplers,
  304. defines: join,
  305. fallbacks: fallbacks,
  306. onCompiled: this.onCompiled,
  307. onError: this.onError,
  308. indexParameters: { maxSimultaneousLights: this._maxSimultaneousLights }
  309. }, engine), defines);
  310. }
  311. if (!subMesh.effect.isReady()) {
  312. return false;
  313. }
  314. this._renderId = scene.getRenderId();
  315. this._wasPreviouslyReady = true;
  316. return true;
  317. }
  318. public bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void {
  319. var scene = this.getScene();
  320. var defines = <WaterMaterialDefines>subMesh._materialDefines;
  321. if (!defines) {
  322. return;
  323. }
  324. var effect = subMesh.effect;
  325. this._activeEffect = effect;
  326. // Matrices
  327. this.bindOnlyWorldMatrix(world);
  328. this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());
  329. // Bones
  330. MaterialHelper.BindBonesParameters(mesh, this._activeEffect);
  331. if (this._mustRebind(scene, effect)) {
  332. // Textures
  333. if (this.bumpTexture && StandardMaterial.BumpTextureEnabled) {
  334. this._activeEffect.setTexture("normalSampler", this.bumpTexture);
  335. this._activeEffect.setFloat2("vNormalInfos", this.bumpTexture.coordinatesIndex, this.bumpTexture.level);
  336. this._activeEffect.setMatrix("normalMatrix", this.bumpTexture.getTextureMatrix());
  337. }
  338. // Clip plane
  339. MaterialHelper.BindClipPlane(this._activeEffect, scene);
  340. // Point size
  341. if (this.pointsCloud) {
  342. this._activeEffect.setFloat("pointSize", this.pointSize);
  343. }
  344. this._activeEffect.setVector3("vEyePosition", scene._mirroredCameraPosition ? scene._mirroredCameraPosition : scene.activeCamera.position);
  345. }
  346. this._activeEffect.setColor4("vDiffuseColor", this.diffuseColor, this.alpha * mesh.visibility);
  347. if (defines.SPECULARTERM) {
  348. this._activeEffect.setColor4("vSpecularColor", this.specularColor, this.specularPower);
  349. }
  350. if (scene.lightsEnabled && !this.disableLighting) {
  351. MaterialHelper.BindLights(scene, mesh, this._activeEffect, defines, this.maxSimultaneousLights);
  352. }
  353. // View
  354. if (scene.fogEnabled && mesh.applyFog && scene.fogMode !== Scene.FOGMODE_NONE) {
  355. this._activeEffect.setMatrix("view", scene.getViewMatrix());
  356. }
  357. // Fog
  358. MaterialHelper.BindFogParameters(scene, mesh, this._activeEffect);
  359. // Log. depth
  360. MaterialHelper.BindLogDepth(defines, this._activeEffect, scene);
  361. // Water
  362. if (StandardMaterial.ReflectionTextureEnabled) {
  363. this._activeEffect.setTexture("refractionSampler", this._refractionRTT);
  364. this._activeEffect.setTexture("reflectionSampler", this._reflectionRTT);
  365. }
  366. var wrvp = this._mesh.getWorldMatrix().multiply(this._reflectionTransform).multiply(scene.getProjectionMatrix());
  367. // Add delta time. Prevent adding delta time if it hasn't changed.
  368. let deltaTime = scene.getEngine().getDeltaTime();
  369. if (deltaTime !== this._lastDeltaTime) {
  370. this._lastDeltaTime = deltaTime;
  371. this._lastTime += this._lastDeltaTime;
  372. }
  373. this._activeEffect.setMatrix("worldReflectionViewProjection", wrvp);
  374. this._activeEffect.setVector2("windDirection", this.windDirection);
  375. this._activeEffect.setFloat("waveLength", this.waveLength);
  376. this._activeEffect.setFloat("time", this._lastTime / 100000);
  377. this._activeEffect.setFloat("windForce", this.windForce);
  378. this._activeEffect.setFloat("waveHeight", this.waveHeight);
  379. this._activeEffect.setFloat("bumpHeight", this.bumpHeight);
  380. this._activeEffect.setColor4("waterColor", this.waterColor, 1.0);
  381. this._activeEffect.setFloat("colorBlendFactor", this.colorBlendFactor);
  382. this._activeEffect.setColor4("waterColor2", this.waterColor2, 1.0);
  383. this._activeEffect.setFloat("colorBlendFactor2", this.colorBlendFactor2);
  384. this._activeEffect.setFloat("waveSpeed", this.waveSpeed);
  385. this._afterBind(mesh, this._activeEffect);
  386. }
  387. private _createRenderTargets(scene: Scene, renderTargetSize: Vector2): void {
  388. // Render targets
  389. this._refractionRTT = new RenderTargetTexture(name + "_refraction", { width: renderTargetSize.x, height: renderTargetSize.y }, scene, false, true);
  390. this._refractionRTT.wrapU = BABYLON.Texture.MIRROR_ADDRESSMODE;
  391. this._refractionRTT.wrapV = BABYLON.Texture.MIRROR_ADDRESSMODE;
  392. this._refractionRTT.ignoreCameraViewport = true;
  393. this._reflectionRTT = new RenderTargetTexture(name + "_reflection", { width: renderTargetSize.x, height: renderTargetSize.y }, scene, false, true);
  394. this._reflectionRTT.wrapU = BABYLON.Texture.MIRROR_ADDRESSMODE;
  395. this._reflectionRTT.wrapV = BABYLON.Texture.MIRROR_ADDRESSMODE;
  396. this._reflectionRTT.ignoreCameraViewport = true;
  397. var isVisible: boolean;
  398. var clipPlane = null;
  399. var savedViewMatrix;
  400. var mirrorMatrix = Matrix.Zero();
  401. this._refractionRTT.onBeforeRender = () => {
  402. if (this._mesh) {
  403. isVisible = this._mesh.isVisible;
  404. this._mesh.isVisible = false;
  405. }
  406. // Clip plane
  407. clipPlane = scene.clipPlane;
  408. var positiony = this._mesh ? this._mesh.position.y : 0.0;
  409. scene.clipPlane = Plane.FromPositionAndNormal(new Vector3(0, positiony + 0.05, 0), new Vector3(0, 1, 0));
  410. };
  411. this._refractionRTT.onAfterRender = () => {
  412. if (this._mesh) {
  413. this._mesh.isVisible = isVisible;
  414. }
  415. // Clip plane
  416. scene.clipPlane = clipPlane;
  417. };
  418. this._reflectionRTT.onBeforeRender = () => {
  419. if (this._mesh) {
  420. isVisible = this._mesh.isVisible;
  421. this._mesh.isVisible = false;
  422. }
  423. // Clip plane
  424. clipPlane = scene.clipPlane;
  425. var positiony = this._mesh ? this._mesh.position.y : 0.0;
  426. scene.clipPlane = Plane.FromPositionAndNormal(new Vector3(0, positiony - 0.05, 0), new Vector3(0, -1, 0));
  427. // Transform
  428. Matrix.ReflectionToRef(scene.clipPlane, mirrorMatrix);
  429. savedViewMatrix = scene.getViewMatrix();
  430. mirrorMatrix.multiplyToRef(savedViewMatrix, this._reflectionTransform);
  431. scene.setTransformMatrix(this._reflectionTransform, scene.getProjectionMatrix());
  432. scene.getEngine().cullBackFaces = false;
  433. scene._mirroredCameraPosition = Vector3.TransformCoordinates(scene.activeCamera.position, mirrorMatrix);
  434. };
  435. this._reflectionRTT.onAfterRender = () => {
  436. if (this._mesh) {
  437. this._mesh.isVisible = isVisible;
  438. }
  439. // Clip plane
  440. scene.clipPlane = clipPlane;
  441. // Transform
  442. scene.setTransformMatrix(savedViewMatrix, scene.getProjectionMatrix());
  443. scene.getEngine().cullBackFaces = true;
  444. scene._mirroredCameraPosition = null;
  445. };
  446. }
  447. public getAnimatables(): IAnimatable[] {
  448. var results = [];
  449. if (this.bumpTexture && this.bumpTexture.animations && this.bumpTexture.animations.length > 0) {
  450. results.push(this.bumpTexture);
  451. }
  452. if (this._reflectionRTT && this._reflectionRTT.animations && this._reflectionRTT.animations.length > 0) {
  453. results.push(this._reflectionRTT);
  454. }
  455. if (this._refractionRTT && this._refractionRTT.animations && this._refractionRTT.animations.length > 0) {
  456. results.push(this._refractionRTT);
  457. }
  458. return results;
  459. }
  460. public getActiveTextures(): BaseTexture[] {
  461. var activeTextures = super.getActiveTextures();
  462. if (this._bumpTexture) {
  463. activeTextures.push(this._bumpTexture);
  464. }
  465. return activeTextures;
  466. }
  467. public hasTexture(texture: BaseTexture): boolean {
  468. if (super.hasTexture(texture)) {
  469. return true;
  470. }
  471. if (this._bumpTexture === texture) {
  472. return true;
  473. }
  474. return false;
  475. }
  476. public dispose(forceDisposeEffect?: boolean): void {
  477. if (this.bumpTexture) {
  478. this.bumpTexture.dispose();
  479. }
  480. var index = this.getScene().customRenderTargets.indexOf(this._refractionRTT);
  481. if (index != -1) {
  482. this.getScene().customRenderTargets.splice(index, 1);
  483. }
  484. index = -1;
  485. index = this.getScene().customRenderTargets.indexOf(this._reflectionRTT);
  486. if (index != -1) {
  487. this.getScene().customRenderTargets.splice(index, 1);
  488. }
  489. if (this._reflectionRTT) {
  490. this._reflectionRTT.dispose();
  491. }
  492. if (this._refractionRTT) {
  493. this._refractionRTT.dispose();
  494. }
  495. super.dispose(forceDisposeEffect);
  496. }
  497. public clone(name: string): WaterMaterial {
  498. return SerializationHelper.Clone(() => new WaterMaterial(name, this.getScene()), this);
  499. }
  500. public serialize(): any {
  501. var serializationObject = SerializationHelper.Serialize(this);
  502. serializationObject.customType = "BABYLON.WaterMaterial";
  503. serializationObject.reflectionTexture.isRenderTarget = true;
  504. serializationObject.refractionTexture.isRenderTarget = true;
  505. return serializationObject;
  506. }
  507. public getClassName(): string {
  508. return "WaterMaterial";
  509. }
  510. // Statics
  511. public static Parse(source: any, scene: Scene, rootUrl: string): WaterMaterial {
  512. return SerializationHelper.Parse(() => new WaterMaterial(source.name, scene), source, scene, rootUrl);
  513. }
  514. public static CreateDefaultMesh(name: string, scene: Scene): Mesh {
  515. var mesh = Mesh.CreateGround(name, 512, 512, 32, scene, false);
  516. return mesh;
  517. }
  518. }
  519. }