@babylonjs/materials 5.0.0-rc.0 → 5.0.0-rc.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (230) hide show
  1. package/cell/cell.fragment.d.ts +17 -17
  2. package/cell/cell.fragment.js +20 -18
  3. package/cell/cell.fragment.js.map +1 -1
  4. package/cell/cell.vertex.d.ts +18 -18
  5. package/cell/cell.vertex.js +21 -19
  6. package/cell/cell.vertex.js.map +1 -1
  7. package/cell/cellMaterial.d.ts +37 -37
  8. package/cell/cellMaterial.js +304 -290
  9. package/cell/cellMaterial.js.map +1 -1
  10. package/cell/index.d.ts +1 -1
  11. package/cell/index.js +1 -1
  12. package/cell/index.js.map +1 -1
  13. package/custom/customMaterial.d.ts +69 -69
  14. package/custom/customMaterial.js +216 -218
  15. package/custom/customMaterial.js.map +1 -1
  16. package/custom/index.d.ts +2 -2
  17. package/custom/index.js +2 -2
  18. package/custom/index.js.map +1 -1
  19. package/custom/pbrCustomMaterial.d.ts +71 -71
  20. package/custom/pbrCustomMaterial.js +241 -243
  21. package/custom/pbrCustomMaterial.js.map +1 -1
  22. package/fire/fire.fragment.d.ts +11 -11
  23. package/fire/fire.fragment.js +14 -12
  24. package/fire/fire.fragment.js.map +1 -1
  25. package/fire/fire.vertex.d.ts +15 -15
  26. package/fire/fire.vertex.js +18 -16
  27. package/fire/fire.vertex.js.map +1 -1
  28. package/fire/fireMaterial.d.ts +38 -38
  29. package/fire/fireMaterial.js +342 -327
  30. package/fire/fireMaterial.js.map +1 -1
  31. package/fire/index.d.ts +1 -1
  32. package/fire/index.js +1 -1
  33. package/fire/index.js.map +1 -1
  34. package/fur/fur.fragment.d.ts +17 -17
  35. package/fur/fur.fragment.js +20 -18
  36. package/fur/fur.fragment.js.map +1 -1
  37. package/fur/fur.vertex.d.ts +18 -18
  38. package/fur/fur.vertex.js +21 -19
  39. package/fur/fur.vertex.js.map +1 -1
  40. package/fur/furMaterial.d.ts +57 -56
  41. package/fur/furMaterial.js +500 -480
  42. package/fur/furMaterial.js.map +1 -1
  43. package/fur/index.d.ts +1 -1
  44. package/fur/index.js +1 -1
  45. package/fur/index.js.map +1 -1
  46. package/gradient/gradient.fragment.d.ts +17 -17
  47. package/gradient/gradient.fragment.js +20 -18
  48. package/gradient/gradient.fragment.js.map +1 -1
  49. package/gradient/gradient.vertex.d.ts +18 -18
  50. package/gradient/gradient.vertex.js +21 -19
  51. package/gradient/gradient.vertex.js.map +1 -1
  52. package/gradient/gradientMaterial.d.ts +37 -37
  53. package/gradient/gradientMaterial.js +275 -259
  54. package/gradient/gradientMaterial.js.map +1 -1
  55. package/gradient/index.d.ts +1 -1
  56. package/gradient/index.js +1 -1
  57. package/gradient/index.js.map +1 -1
  58. package/grid/grid.fragment.d.ts +8 -8
  59. package/grid/grid.fragment.js +11 -9
  60. package/grid/grid.fragment.js.map +1 -1
  61. package/grid/grid.vertex.d.ts +9 -9
  62. package/grid/grid.vertex.js +12 -10
  63. package/grid/grid.vertex.js.map +1 -1
  64. package/grid/gridMaterial.d.ts +78 -77
  65. package/grid/gridMaterial.js +276 -261
  66. package/grid/gridMaterial.js.map +1 -1
  67. package/grid/index.d.ts +1 -1
  68. package/grid/index.js +1 -1
  69. package/grid/index.js.map +1 -1
  70. package/index.d.ts +15 -15
  71. package/index.js +16 -15
  72. package/index.js.map +1 -1
  73. package/lava/index.d.ts +1 -1
  74. package/lava/index.js +1 -1
  75. package/lava/index.js.map +1 -1
  76. package/lava/lava.fragment.d.ts +17 -17
  77. package/lava/lava.fragment.js +20 -18
  78. package/lava/lava.fragment.js.map +1 -1
  79. package/lava/lava.vertex.d.ts +18 -18
  80. package/lava/lava.vertex.js +21 -19
  81. package/lava/lava.vertex.js.map +1 -1
  82. package/lava/lavaMaterial.d.ts +45 -45
  83. package/lava/lavaMaterial.js +394 -378
  84. package/lava/lavaMaterial.js.map +1 -1
  85. package/legacy/legacy-cell.d.ts +1 -1
  86. package/legacy/legacy-cell.js +13 -12
  87. package/legacy/legacy-cell.js.map +1 -1
  88. package/legacy/legacy-custom.d.ts +1 -1
  89. package/legacy/legacy-custom.js +13 -12
  90. package/legacy/legacy-custom.js.map +1 -1
  91. package/legacy/legacy-fire.d.ts +1 -1
  92. package/legacy/legacy-fire.js +13 -12
  93. package/legacy/legacy-fire.js.map +1 -1
  94. package/legacy/legacy-fur.d.ts +1 -1
  95. package/legacy/legacy-fur.js +13 -12
  96. package/legacy/legacy-fur.js.map +1 -1
  97. package/legacy/legacy-gradient.d.ts +1 -1
  98. package/legacy/legacy-gradient.js +13 -12
  99. package/legacy/legacy-gradient.js.map +1 -1
  100. package/legacy/legacy-grid.d.ts +1 -1
  101. package/legacy/legacy-grid.js +13 -12
  102. package/legacy/legacy-grid.js.map +1 -1
  103. package/legacy/legacy-lava.d.ts +1 -1
  104. package/legacy/legacy-lava.js +13 -12
  105. package/legacy/legacy-lava.js.map +1 -1
  106. package/legacy/legacy-mix.d.ts +1 -1
  107. package/legacy/legacy-mix.js +13 -12
  108. package/legacy/legacy-mix.js.map +1 -1
  109. package/legacy/legacy-normal.d.ts +1 -1
  110. package/legacy/legacy-normal.js +13 -12
  111. package/legacy/legacy-normal.js.map +1 -1
  112. package/legacy/legacy-shadowOnly.d.ts +1 -1
  113. package/legacy/legacy-shadowOnly.js +13 -12
  114. package/legacy/legacy-shadowOnly.js.map +1 -1
  115. package/legacy/legacy-simple.d.ts +1 -1
  116. package/legacy/legacy-simple.js +13 -12
  117. package/legacy/legacy-simple.js.map +1 -1
  118. package/legacy/legacy-sky.d.ts +1 -1
  119. package/legacy/legacy-sky.js +13 -12
  120. package/legacy/legacy-sky.js.map +1 -1
  121. package/legacy/legacy-terrain.d.ts +1 -1
  122. package/legacy/legacy-terrain.js +13 -12
  123. package/legacy/legacy-terrain.js.map +1 -1
  124. package/legacy/legacy-triPlanar.d.ts +1 -1
  125. package/legacy/legacy-triPlanar.js +13 -12
  126. package/legacy/legacy-triPlanar.js.map +1 -1
  127. package/legacy/legacy-water.d.ts +1 -1
  128. package/legacy/legacy-water.js +13 -12
  129. package/legacy/legacy-water.js.map +1 -1
  130. package/legacy/legacy.d.ts +1 -1
  131. package/legacy/legacy.js +16 -15
  132. package/legacy/legacy.js.map +1 -1
  133. package/mix/index.d.ts +1 -1
  134. package/mix/index.js +1 -1
  135. package/mix/index.js.map +1 -1
  136. package/mix/mix.fragment.d.ts +17 -17
  137. package/mix/mix.fragment.js +20 -18
  138. package/mix/mix.fragment.js.map +1 -1
  139. package/mix/mix.vertex.d.ts +18 -18
  140. package/mix/mix.vertex.js +21 -19
  141. package/mix/mix.vertex.js.map +1 -1
  142. package/mix/mixMaterial.d.ts +65 -65
  143. package/mix/mixMaterial.js +510 -483
  144. package/mix/mixMaterial.js.map +1 -1
  145. package/normal/index.d.ts +1 -1
  146. package/normal/index.js +1 -1
  147. package/normal/index.js.map +1 -1
  148. package/normal/normal.fragment.d.ts +17 -17
  149. package/normal/normal.fragment.js +20 -18
  150. package/normal/normal.fragment.js.map +1 -1
  151. package/normal/normal.vertex.d.ts +18 -18
  152. package/normal/normal.vertex.js +21 -19
  153. package/normal/normal.vertex.js.map +1 -1
  154. package/normal/normalMaterial.d.ts +36 -36
  155. package/normal/normalMaterial.js +336 -322
  156. package/normal/normalMaterial.js.map +1 -1
  157. package/package.json +22 -254
  158. package/readme.md +2 -2
  159. package/shadowOnly/index.d.ts +1 -1
  160. package/shadowOnly/index.js +1 -1
  161. package/shadowOnly/index.js.map +1 -1
  162. package/shadowOnly/shadowOnly.fragment.d.ts +16 -16
  163. package/shadowOnly/shadowOnly.fragment.js +19 -17
  164. package/shadowOnly/shadowOnly.fragment.js.map +1 -1
  165. package/shadowOnly/shadowOnly.vertex.d.ts +18 -18
  166. package/shadowOnly/shadowOnly.vertex.js +21 -19
  167. package/shadowOnly/shadowOnly.vertex.js.map +1 -1
  168. package/shadowOnly/shadowOnlyMaterial.d.ts +30 -30
  169. package/shadowOnly/shadowOnlyMaterial.js +254 -240
  170. package/shadowOnly/shadowOnlyMaterial.js.map +1 -1
  171. package/simple/index.d.ts +1 -1
  172. package/simple/index.js +1 -1
  173. package/simple/index.js.map +1 -1
  174. package/simple/simple.fragment.d.ts +17 -17
  175. package/simple/simple.fragment.js +20 -18
  176. package/simple/simple.fragment.js.map +1 -1
  177. package/simple/simple.vertex.d.ts +18 -18
  178. package/simple/simple.vertex.js +21 -19
  179. package/simple/simple.vertex.js.map +1 -1
  180. package/simple/simpleMaterial.d.ts +35 -35
  181. package/simple/simpleMaterial.js +295 -281
  182. package/simple/simpleMaterial.js.map +1 -1
  183. package/sky/index.d.ts +1 -1
  184. package/sky/index.js +1 -1
  185. package/sky/index.js.map +1 -1
  186. package/sky/sky.fragment.d.ts +10 -10
  187. package/sky/sky.fragment.js +13 -11
  188. package/sky/sky.fragment.js.map +1 -1
  189. package/sky/sky.vertex.d.ts +9 -9
  190. package/sky/sky.vertex.js +12 -10
  191. package/sky/sky.vertex.js.map +1 -1
  192. package/sky/skyMaterial.d.ts +147 -147
  193. package/sky/skyMaterial.js +359 -340
  194. package/sky/skyMaterial.js.map +1 -1
  195. package/terrain/index.d.ts +1 -1
  196. package/terrain/index.js +1 -1
  197. package/terrain/index.js.map +1 -1
  198. package/terrain/terrain.fragment.d.ts +17 -17
  199. package/terrain/terrain.fragment.js +20 -18
  200. package/terrain/terrain.fragment.js.map +1 -1
  201. package/terrain/terrain.vertex.d.ts +18 -18
  202. package/terrain/terrain.vertex.js +21 -19
  203. package/terrain/terrain.vertex.js.map +1 -1
  204. package/terrain/terrainMaterial.d.ts +50 -50
  205. package/terrain/terrainMaterial.js +426 -411
  206. package/terrain/terrainMaterial.js.map +1 -1
  207. package/triPlanar/index.d.ts +1 -1
  208. package/triPlanar/index.js +1 -1
  209. package/triPlanar/index.js.map +1 -1
  210. package/triPlanar/triPlanarMaterial.d.ts +49 -49
  211. package/triPlanar/triPlanarMaterial.js +403 -391
  212. package/triPlanar/triPlanarMaterial.js.map +1 -1
  213. package/triPlanar/triplanar.fragment.d.ts +17 -17
  214. package/triPlanar/triplanar.fragment.js +20 -18
  215. package/triPlanar/triplanar.fragment.js.map +1 -1
  216. package/triPlanar/triplanar.vertex.d.ts +18 -18
  217. package/triPlanar/triplanar.vertex.js +21 -19
  218. package/triPlanar/triplanar.vertex.js.map +1 -1
  219. package/water/index.d.ts +1 -1
  220. package/water/index.js +1 -1
  221. package/water/index.js.map +1 -1
  222. package/water/water.fragment.d.ts +19 -19
  223. package/water/water.fragment.js +22 -20
  224. package/water/water.fragment.js.map +1 -1
  225. package/water/water.vertex.d.ts +20 -20
  226. package/water/water.vertex.js +23 -21
  227. package/water/water.vertex.js.map +1 -1
  228. package/water/waterMaterial.d.ts +135 -132
  229. package/water/waterMaterial.js +736 -705
  230. package/water/waterMaterial.js.map +1 -1
@@ -1,412 +1,427 @@
1
- import { __decorate, __extends } from "tslib";
2
- import { serializeAsTexture, serialize, expandToProperty, serializeAsColor3, SerializationHelper } from "@babylonjs/core/Misc/decorators.js";
3
- import { Color3 } from "@babylonjs/core/Maths/math.color.js";
4
- import { MaterialDefines } from "@babylonjs/core/Materials/materialDefines.js";
5
- import { MaterialHelper } from "@babylonjs/core/Materials/materialHelper.js";
6
- import { PushMaterial } from "@babylonjs/core/Materials/pushMaterial.js";
7
- import { MaterialFlags } from "@babylonjs/core/Materials/materialFlags.js";
8
- import { VertexBuffer } from "@babylonjs/core/Buffers/buffer.js";
9
- import { Scene } from "@babylonjs/core/scene.js";
10
- import { RegisterClass } from '@babylonjs/core/Misc/typeStore.js';
11
- import "./terrain.fragment.js";
12
- import "./terrain.vertex.js";
13
- import { EffectFallbacks } from '@babylonjs/core/Materials/effectFallbacks.js';
14
- var TerrainMaterialDefines = /** @class */ (function (_super) {
15
- __extends(TerrainMaterialDefines, _super);
16
- function TerrainMaterialDefines() {
17
- var _this = _super.call(this) || this;
18
- _this.DIFFUSE = false;
19
- _this.BUMP = false;
20
- _this.CLIPPLANE = false;
21
- _this.CLIPPLANE2 = false;
22
- _this.CLIPPLANE3 = false;
23
- _this.CLIPPLANE4 = false;
24
- _this.CLIPPLANE5 = false;
25
- _this.CLIPPLANE6 = false;
26
- _this.ALPHATEST = false;
27
- _this.DEPTHPREPASS = false;
28
- _this.POINTSIZE = false;
29
- _this.FOG = false;
30
- _this.SPECULARTERM = false;
31
- _this.NORMAL = false;
32
- _this.UV1 = false;
33
- _this.UV2 = false;
34
- _this.VERTEXCOLOR = false;
35
- _this.VERTEXALPHA = false;
36
- _this.NUM_BONE_INFLUENCERS = 0;
37
- _this.BonesPerMesh = 0;
38
- _this.INSTANCES = false;
39
- _this.INSTANCESCOLOR = false;
40
- _this.IMAGEPROCESSINGPOSTPROCESS = false;
41
- _this.SKIPFINALCOLORCLAMP = false;
42
- _this.rebuild();
43
- return _this;
44
- }
45
- return TerrainMaterialDefines;
46
- }(MaterialDefines));
47
- var TerrainMaterial = /** @class */ (function (_super) {
48
- __extends(TerrainMaterial, _super);
49
- function TerrainMaterial(name, scene) {
50
- var _this = _super.call(this, name, scene) || this;
51
- _this.diffuseColor = new Color3(1, 1, 1);
52
- _this.specularColor = new Color3(0, 0, 0);
53
- _this.specularPower = 64;
54
- _this._disableLighting = false;
55
- _this._maxSimultaneousLights = 4;
56
- return _this;
57
- }
58
- TerrainMaterial.prototype.needAlphaBlending = function () {
59
- return (this.alpha < 1.0);
60
- };
61
- TerrainMaterial.prototype.needAlphaTesting = function () {
62
- return false;
63
- };
64
- TerrainMaterial.prototype.getAlphaTestTexture = function () {
65
- return null;
66
- };
67
- // Methods
68
- TerrainMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) {
69
- if (this.isFrozen) {
70
- if (subMesh.effect && subMesh.effect._wasPreviouslyReady) {
71
- return true;
72
- }
73
- }
74
- if (!subMesh.materialDefines) {
75
- subMesh.materialDefines = new TerrainMaterialDefines();
76
- }
77
- var defines = subMesh.materialDefines;
78
- var scene = this.getScene();
79
- if (this._isReadyForSubMesh(subMesh)) {
80
- return true;
81
- }
82
- var engine = scene.getEngine();
83
- // Textures
84
- if (scene.texturesEnabled) {
85
- if (!this.mixTexture || !this.mixTexture.isReady()) {
86
- return false;
87
- }
88
- defines._needUVs = true;
89
- if (MaterialFlags.DiffuseTextureEnabled) {
90
- if (!this.diffuseTexture1 || !this.diffuseTexture1.isReady()) {
91
- return false;
92
- }
93
- if (!this.diffuseTexture2 || !this.diffuseTexture2.isReady()) {
94
- return false;
95
- }
96
- if (!this.diffuseTexture3 || !this.diffuseTexture3.isReady()) {
97
- return false;
98
- }
99
- defines.DIFFUSE = true;
100
- }
101
- if (this.bumpTexture1 && this.bumpTexture2 && this.bumpTexture3 && MaterialFlags.BumpTextureEnabled) {
102
- if (!this.bumpTexture1.isReady()) {
103
- return false;
104
- }
105
- if (!this.bumpTexture2.isReady()) {
106
- return false;
107
- }
108
- if (!this.bumpTexture3.isReady()) {
109
- return false;
110
- }
111
- defines._needNormals = true;
112
- defines.BUMP = true;
113
- }
114
- }
115
- // Misc.
116
- MaterialHelper.PrepareDefinesForMisc(mesh, scene, false, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(mesh), defines);
117
- // Lights
118
- defines._needNormals = MaterialHelper.PrepareDefinesForLights(scene, mesh, defines, false, this._maxSimultaneousLights, this._disableLighting);
119
- // Values that need to be evaluated on every frame
120
- MaterialHelper.PrepareDefinesForFrameBoundValues(scene, engine, defines, useInstances ? true : false);
121
- // Attribs
122
- MaterialHelper.PrepareDefinesForAttributes(mesh, defines, true, true);
123
- // Get correct effect
124
- if (defines.isDirty) {
125
- defines.markAsProcessed();
126
- scene.resetCachedMaterial();
127
- // Fallbacks
128
- var fallbacks = new EffectFallbacks();
129
- if (defines.FOG) {
130
- fallbacks.addFallback(1, "FOG");
131
- }
132
- MaterialHelper.HandleFallbacksForShadows(defines, fallbacks, this.maxSimultaneousLights);
133
- if (defines.NUM_BONE_INFLUENCERS > 0) {
134
- fallbacks.addCPUSkinningFallback(0, mesh);
135
- }
136
- defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess;
137
- //Attributes
138
- var attribs = [VertexBuffer.PositionKind];
139
- if (defines.NORMAL) {
140
- attribs.push(VertexBuffer.NormalKind);
141
- }
142
- if (defines.UV1) {
143
- attribs.push(VertexBuffer.UVKind);
144
- }
145
- if (defines.UV2) {
146
- attribs.push(VertexBuffer.UV2Kind);
147
- }
148
- if (defines.VERTEXCOLOR) {
149
- attribs.push(VertexBuffer.ColorKind);
150
- }
151
- MaterialHelper.PrepareAttributesForBones(attribs, mesh, defines, fallbacks);
152
- MaterialHelper.PrepareAttributesForInstances(attribs, defines);
153
- // Legacy browser patch
154
- var shaderName = "terrain";
155
- var join = defines.toString();
156
- var uniforms = ["world", "view", "viewProjection", "vEyePosition", "vLightsType", "vDiffuseColor", "vSpecularColor",
157
- "vFogInfos", "vFogColor", "pointSize",
158
- "vTextureInfos",
159
- "mBones",
160
- "vClipPlane", "vClipPlane2", "vClipPlane3", "vClipPlane4", "vClipPlane5", "vClipPlane6", "textureMatrix",
161
- "diffuse1Infos", "diffuse2Infos", "diffuse3Infos"
162
- ];
163
- var samplers = ["textureSampler", "diffuse1Sampler", "diffuse2Sampler", "diffuse3Sampler",
164
- "bump1Sampler", "bump2Sampler", "bump3Sampler"
165
- ];
166
- var uniformBuffers = new Array();
167
- MaterialHelper.PrepareUniformsAndSamplersList({
168
- uniformsNames: uniforms,
169
- uniformBuffersNames: uniformBuffers,
170
- samplers: samplers,
171
- defines: defines,
172
- maxSimultaneousLights: this.maxSimultaneousLights
173
- });
174
- subMesh.setEffect(scene.getEngine().createEffect(shaderName, {
175
- attributes: attribs,
176
- uniformsNames: uniforms,
177
- uniformBuffersNames: uniformBuffers,
178
- samplers: samplers,
179
- defines: join,
180
- fallbacks: fallbacks,
181
- onCompiled: this.onCompiled,
182
- onError: this.onError,
183
- indexParameters: { maxSimultaneousLights: this.maxSimultaneousLights }
184
- }, engine), defines, this._materialContext);
185
- }
186
- if (!subMesh.effect || !subMesh.effect.isReady()) {
187
- return false;
188
- }
189
- defines._renderId = scene.getRenderId();
190
- subMesh.effect._wasPreviouslyReady = true;
191
- return true;
192
- };
193
- TerrainMaterial.prototype.bindForSubMesh = function (world, mesh, subMesh) {
194
- var scene = this.getScene();
195
- var defines = subMesh.materialDefines;
196
- if (!defines) {
197
- return;
198
- }
199
- var effect = subMesh.effect;
200
- if (!effect) {
201
- return;
202
- }
203
- this._activeEffect = effect;
204
- // Matrices
205
- this.bindOnlyWorldMatrix(world);
206
- this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());
207
- // Bones
208
- MaterialHelper.BindBonesParameters(mesh, this._activeEffect);
209
- if (this._mustRebind(scene, effect)) {
210
- // Textures
211
- if (this.mixTexture) {
212
- this._activeEffect.setTexture("textureSampler", this._mixTexture);
213
- this._activeEffect.setFloat2("vTextureInfos", this._mixTexture.coordinatesIndex, this._mixTexture.level);
214
- this._activeEffect.setMatrix("textureMatrix", this._mixTexture.getTextureMatrix());
215
- if (MaterialFlags.DiffuseTextureEnabled) {
216
- if (this._diffuseTexture1) {
217
- this._activeEffect.setTexture("diffuse1Sampler", this._diffuseTexture1);
218
- this._activeEffect.setFloat2("diffuse1Infos", this._diffuseTexture1.uScale, this._diffuseTexture1.vScale);
219
- }
220
- if (this._diffuseTexture2) {
221
- this._activeEffect.setTexture("diffuse2Sampler", this._diffuseTexture2);
222
- this._activeEffect.setFloat2("diffuse2Infos", this._diffuseTexture2.uScale, this._diffuseTexture2.vScale);
223
- }
224
- if (this._diffuseTexture3) {
225
- this._activeEffect.setTexture("diffuse3Sampler", this._diffuseTexture3);
226
- this._activeEffect.setFloat2("diffuse3Infos", this._diffuseTexture3.uScale, this._diffuseTexture3.vScale);
227
- }
228
- }
229
- if (MaterialFlags.BumpTextureEnabled && scene.getEngine().getCaps().standardDerivatives) {
230
- if (this._bumpTexture1) {
231
- this._activeEffect.setTexture("bump1Sampler", this._bumpTexture1);
232
- }
233
- if (this._bumpTexture2) {
234
- this._activeEffect.setTexture("bump2Sampler", this._bumpTexture2);
235
- }
236
- if (this._bumpTexture3) {
237
- this._activeEffect.setTexture("bump3Sampler", this._bumpTexture3);
238
- }
239
- }
240
- }
241
- // Clip plane
242
- MaterialHelper.BindClipPlane(this._activeEffect, scene);
243
- // Point size
244
- if (this.pointsCloud) {
245
- this._activeEffect.setFloat("pointSize", this.pointSize);
246
- }
247
- scene.bindEyePosition(effect);
248
- }
249
- this._activeEffect.setColor4("vDiffuseColor", this.diffuseColor, this.alpha * mesh.visibility);
250
- if (defines.SPECULARTERM) {
251
- this._activeEffect.setColor4("vSpecularColor", this.specularColor, this.specularPower);
252
- }
253
- if (scene.lightsEnabled && !this.disableLighting) {
254
- MaterialHelper.BindLights(scene, mesh, this._activeEffect, defines, this.maxSimultaneousLights);
255
- }
256
- // View
257
- if (scene.fogEnabled && mesh.applyFog && scene.fogMode !== Scene.FOGMODE_NONE) {
258
- this._activeEffect.setMatrix("view", scene.getViewMatrix());
259
- }
260
- // Fog
261
- MaterialHelper.BindFogParameters(scene, mesh, this._activeEffect);
262
- this._afterBind(mesh, this._activeEffect);
263
- };
264
- TerrainMaterial.prototype.getAnimatables = function () {
265
- var results = [];
266
- if (this.mixTexture && this.mixTexture.animations && this.mixTexture.animations.length > 0) {
267
- results.push(this.mixTexture);
268
- }
269
- return results;
270
- };
271
- TerrainMaterial.prototype.getActiveTextures = function () {
272
- var activeTextures = _super.prototype.getActiveTextures.call(this);
273
- if (this._mixTexture) {
274
- activeTextures.push(this._mixTexture);
275
- }
276
- if (this._diffuseTexture1) {
277
- activeTextures.push(this._diffuseTexture1);
278
- }
279
- if (this._diffuseTexture2) {
280
- activeTextures.push(this._diffuseTexture2);
281
- }
282
- if (this._diffuseTexture3) {
283
- activeTextures.push(this._diffuseTexture3);
284
- }
285
- if (this._bumpTexture1) {
286
- activeTextures.push(this._bumpTexture1);
287
- }
288
- if (this._bumpTexture2) {
289
- activeTextures.push(this._bumpTexture2);
290
- }
291
- if (this._bumpTexture3) {
292
- activeTextures.push(this._bumpTexture3);
293
- }
294
- return activeTextures;
295
- };
296
- TerrainMaterial.prototype.hasTexture = function (texture) {
297
- if (_super.prototype.hasTexture.call(this, texture)) {
298
- return true;
299
- }
300
- if (this._mixTexture === texture) {
301
- return true;
302
- }
303
- if (this._diffuseTexture1 === texture) {
304
- return true;
305
- }
306
- if (this._diffuseTexture2 === texture) {
307
- return true;
308
- }
309
- if (this._diffuseTexture3 === texture) {
310
- return true;
311
- }
312
- if (this._bumpTexture1 === texture) {
313
- return true;
314
- }
315
- if (this._bumpTexture2 === texture) {
316
- return true;
317
- }
318
- if (this._bumpTexture3 === texture) {
319
- return true;
320
- }
321
- return false;
322
- };
323
- TerrainMaterial.prototype.dispose = function (forceDisposeEffect) {
324
- if (this.mixTexture) {
325
- this.mixTexture.dispose();
326
- }
327
- _super.prototype.dispose.call(this, forceDisposeEffect);
328
- };
329
- TerrainMaterial.prototype.clone = function (name) {
330
- var _this = this;
331
- return SerializationHelper.Clone(function () { return new TerrainMaterial(name, _this.getScene()); }, this);
332
- };
333
- TerrainMaterial.prototype.serialize = function () {
334
- var serializationObject = _super.prototype.serialize.call(this);
335
- serializationObject.customType = "BABYLON.TerrainMaterial";
336
- return serializationObject;
337
- };
338
- TerrainMaterial.prototype.getClassName = function () {
339
- return "TerrainMaterial";
340
- };
341
- // Statics
342
- TerrainMaterial.Parse = function (source, scene, rootUrl) {
343
- return SerializationHelper.Parse(function () { return new TerrainMaterial(source.name, scene); }, source, scene, rootUrl);
344
- };
345
- __decorate([
346
- serializeAsTexture("mixTexture")
347
- ], TerrainMaterial.prototype, "_mixTexture", void 0);
348
- __decorate([
349
- expandToProperty("_markAllSubMeshesAsTexturesDirty")
350
- ], TerrainMaterial.prototype, "mixTexture", void 0);
351
- __decorate([
352
- serializeAsTexture("diffuseTexture1")
353
- ], TerrainMaterial.prototype, "_diffuseTexture1", void 0);
354
- __decorate([
355
- expandToProperty("_markAllSubMeshesAsTexturesDirty")
356
- ], TerrainMaterial.prototype, "diffuseTexture1", void 0);
357
- __decorate([
358
- serializeAsTexture("diffuseTexture2")
359
- ], TerrainMaterial.prototype, "_diffuseTexture2", void 0);
360
- __decorate([
361
- expandToProperty("_markAllSubMeshesAsTexturesDirty")
362
- ], TerrainMaterial.prototype, "diffuseTexture2", void 0);
363
- __decorate([
364
- serializeAsTexture("diffuseTexture3")
365
- ], TerrainMaterial.prototype, "_diffuseTexture3", void 0);
366
- __decorate([
367
- expandToProperty("_markAllSubMeshesAsTexturesDirty")
368
- ], TerrainMaterial.prototype, "diffuseTexture3", void 0);
369
- __decorate([
370
- serializeAsTexture("bumpTexture1")
371
- ], TerrainMaterial.prototype, "_bumpTexture1", void 0);
372
- __decorate([
373
- expandToProperty("_markAllSubMeshesAsTexturesDirty")
374
- ], TerrainMaterial.prototype, "bumpTexture1", void 0);
375
- __decorate([
376
- serializeAsTexture("bumpTexture2")
377
- ], TerrainMaterial.prototype, "_bumpTexture2", void 0);
378
- __decorate([
379
- expandToProperty("_markAllSubMeshesAsTexturesDirty")
380
- ], TerrainMaterial.prototype, "bumpTexture2", void 0);
381
- __decorate([
382
- serializeAsTexture("bumpTexture3")
383
- ], TerrainMaterial.prototype, "_bumpTexture3", void 0);
384
- __decorate([
385
- expandToProperty("_markAllSubMeshesAsTexturesDirty")
386
- ], TerrainMaterial.prototype, "bumpTexture3", void 0);
387
- __decorate([
388
- serializeAsColor3()
389
- ], TerrainMaterial.prototype, "diffuseColor", void 0);
390
- __decorate([
391
- serializeAsColor3()
392
- ], TerrainMaterial.prototype, "specularColor", void 0);
393
- __decorate([
394
- serialize()
395
- ], TerrainMaterial.prototype, "specularPower", void 0);
396
- __decorate([
397
- serialize("disableLighting")
398
- ], TerrainMaterial.prototype, "_disableLighting", void 0);
399
- __decorate([
400
- expandToProperty("_markAllSubMeshesAsLightsDirty")
401
- ], TerrainMaterial.prototype, "disableLighting", void 0);
402
- __decorate([
403
- serialize("maxSimultaneousLights")
404
- ], TerrainMaterial.prototype, "_maxSimultaneousLights", void 0);
405
- __decorate([
406
- expandToProperty("_markAllSubMeshesAsLightsDirty")
407
- ], TerrainMaterial.prototype, "maxSimultaneousLights", void 0);
408
- return TerrainMaterial;
409
- }(PushMaterial));
410
- export { TerrainMaterial };
411
- RegisterClass("BABYLON.TerrainMaterial", TerrainMaterial);
1
+ import { __decorate, __extends } from "tslib";
2
+ import { serializeAsTexture, serialize, expandToProperty, serializeAsColor3, SerializationHelper } from "@babylonjs/core/Misc/decorators.js";
3
+ import { Color3 } from "@babylonjs/core/Maths/math.color.js";
4
+ import { MaterialDefines } from "@babylonjs/core/Materials/materialDefines.js";
5
+ import { MaterialHelper } from "@babylonjs/core/Materials/materialHelper.js";
6
+ import { PushMaterial } from "@babylonjs/core/Materials/pushMaterial.js";
7
+ import { MaterialFlags } from "@babylonjs/core/Materials/materialFlags.js";
8
+ import { VertexBuffer } from "@babylonjs/core/Buffers/buffer.js";
9
+ import { Scene } from "@babylonjs/core/scene.js";
10
+ import { RegisterClass } from "@babylonjs/core/Misc/typeStore.js";
11
+ import "./terrain.fragment";
12
+ import "./terrain.vertex";
13
+ import { EffectFallbacks } from "@babylonjs/core/Materials/effectFallbacks.js";
14
+ var TerrainMaterialDefines = /** @class */ (function (_super) {
15
+ __extends(TerrainMaterialDefines, _super);
16
+ function TerrainMaterialDefines() {
17
+ var _this = _super.call(this) || this;
18
+ _this.DIFFUSE = false;
19
+ _this.BUMP = false;
20
+ _this.CLIPPLANE = false;
21
+ _this.CLIPPLANE2 = false;
22
+ _this.CLIPPLANE3 = false;
23
+ _this.CLIPPLANE4 = false;
24
+ _this.CLIPPLANE5 = false;
25
+ _this.CLIPPLANE6 = false;
26
+ _this.ALPHATEST = false;
27
+ _this.DEPTHPREPASS = false;
28
+ _this.POINTSIZE = false;
29
+ _this.FOG = false;
30
+ _this.SPECULARTERM = false;
31
+ _this.NORMAL = false;
32
+ _this.UV1 = false;
33
+ _this.UV2 = false;
34
+ _this.VERTEXCOLOR = false;
35
+ _this.VERTEXALPHA = false;
36
+ _this.NUM_BONE_INFLUENCERS = 0;
37
+ _this.BonesPerMesh = 0;
38
+ _this.INSTANCES = false;
39
+ _this.INSTANCESCOLOR = false;
40
+ _this.IMAGEPROCESSINGPOSTPROCESS = false;
41
+ _this.SKIPFINALCOLORCLAMP = false;
42
+ _this.rebuild();
43
+ return _this;
44
+ }
45
+ return TerrainMaterialDefines;
46
+ }(MaterialDefines));
47
+ var TerrainMaterial = /** @class */ (function (_super) {
48
+ __extends(TerrainMaterial, _super);
49
+ function TerrainMaterial(name, scene) {
50
+ var _this = _super.call(this, name, scene) || this;
51
+ _this.diffuseColor = new Color3(1, 1, 1);
52
+ _this.specularColor = new Color3(0, 0, 0);
53
+ _this.specularPower = 64;
54
+ _this._disableLighting = false;
55
+ _this._maxSimultaneousLights = 4;
56
+ return _this;
57
+ }
58
+ TerrainMaterial.prototype.needAlphaBlending = function () {
59
+ return this.alpha < 1.0;
60
+ };
61
+ TerrainMaterial.prototype.needAlphaTesting = function () {
62
+ return false;
63
+ };
64
+ TerrainMaterial.prototype.getAlphaTestTexture = function () {
65
+ return null;
66
+ };
67
+ // Methods
68
+ TerrainMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) {
69
+ if (this.isFrozen) {
70
+ if (subMesh.effect && subMesh.effect._wasPreviouslyReady) {
71
+ return true;
72
+ }
73
+ }
74
+ if (!subMesh.materialDefines) {
75
+ subMesh.materialDefines = new TerrainMaterialDefines();
76
+ }
77
+ var defines = subMesh.materialDefines;
78
+ var scene = this.getScene();
79
+ if (this._isReadyForSubMesh(subMesh)) {
80
+ return true;
81
+ }
82
+ var engine = scene.getEngine();
83
+ // Textures
84
+ if (scene.texturesEnabled) {
85
+ if (!this.mixTexture || !this.mixTexture.isReady()) {
86
+ return false;
87
+ }
88
+ defines._needUVs = true;
89
+ if (MaterialFlags.DiffuseTextureEnabled) {
90
+ if (!this.diffuseTexture1 || !this.diffuseTexture1.isReady()) {
91
+ return false;
92
+ }
93
+ if (!this.diffuseTexture2 || !this.diffuseTexture2.isReady()) {
94
+ return false;
95
+ }
96
+ if (!this.diffuseTexture3 || !this.diffuseTexture3.isReady()) {
97
+ return false;
98
+ }
99
+ defines.DIFFUSE = true;
100
+ }
101
+ if (this.bumpTexture1 && this.bumpTexture2 && this.bumpTexture3 && MaterialFlags.BumpTextureEnabled) {
102
+ if (!this.bumpTexture1.isReady()) {
103
+ return false;
104
+ }
105
+ if (!this.bumpTexture2.isReady()) {
106
+ return false;
107
+ }
108
+ if (!this.bumpTexture3.isReady()) {
109
+ return false;
110
+ }
111
+ defines._needNormals = true;
112
+ defines.BUMP = true;
113
+ }
114
+ }
115
+ // Misc.
116
+ MaterialHelper.PrepareDefinesForMisc(mesh, scene, false, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(mesh), defines);
117
+ // Lights
118
+ defines._needNormals = MaterialHelper.PrepareDefinesForLights(scene, mesh, defines, false, this._maxSimultaneousLights, this._disableLighting);
119
+ // Values that need to be evaluated on every frame
120
+ MaterialHelper.PrepareDefinesForFrameBoundValues(scene, engine, defines, useInstances ? true : false);
121
+ // Attribs
122
+ MaterialHelper.PrepareDefinesForAttributes(mesh, defines, true, true);
123
+ // Get correct effect
124
+ if (defines.isDirty) {
125
+ defines.markAsProcessed();
126
+ scene.resetCachedMaterial();
127
+ // Fallbacks
128
+ var fallbacks = new EffectFallbacks();
129
+ if (defines.FOG) {
130
+ fallbacks.addFallback(1, "FOG");
131
+ }
132
+ MaterialHelper.HandleFallbacksForShadows(defines, fallbacks, this.maxSimultaneousLights);
133
+ if (defines.NUM_BONE_INFLUENCERS > 0) {
134
+ fallbacks.addCPUSkinningFallback(0, mesh);
135
+ }
136
+ defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess;
137
+ //Attributes
138
+ var attribs = [VertexBuffer.PositionKind];
139
+ if (defines.NORMAL) {
140
+ attribs.push(VertexBuffer.NormalKind);
141
+ }
142
+ if (defines.UV1) {
143
+ attribs.push(VertexBuffer.UVKind);
144
+ }
145
+ if (defines.UV2) {
146
+ attribs.push(VertexBuffer.UV2Kind);
147
+ }
148
+ if (defines.VERTEXCOLOR) {
149
+ attribs.push(VertexBuffer.ColorKind);
150
+ }
151
+ MaterialHelper.PrepareAttributesForBones(attribs, mesh, defines, fallbacks);
152
+ MaterialHelper.PrepareAttributesForInstances(attribs, defines);
153
+ // Legacy browser patch
154
+ var shaderName = "terrain";
155
+ var join = defines.toString();
156
+ var uniforms = [
157
+ "world",
158
+ "view",
159
+ "viewProjection",
160
+ "vEyePosition",
161
+ "vLightsType",
162
+ "vDiffuseColor",
163
+ "vSpecularColor",
164
+ "vFogInfos",
165
+ "vFogColor",
166
+ "pointSize",
167
+ "vTextureInfos",
168
+ "mBones",
169
+ "vClipPlane",
170
+ "vClipPlane2",
171
+ "vClipPlane3",
172
+ "vClipPlane4",
173
+ "vClipPlane5",
174
+ "vClipPlane6",
175
+ "textureMatrix",
176
+ "diffuse1Infos",
177
+ "diffuse2Infos",
178
+ "diffuse3Infos",
179
+ ];
180
+ var samplers = ["textureSampler", "diffuse1Sampler", "diffuse2Sampler", "diffuse3Sampler", "bump1Sampler", "bump2Sampler", "bump3Sampler"];
181
+ var uniformBuffers = new Array();
182
+ MaterialHelper.PrepareUniformsAndSamplersList({
183
+ uniformsNames: uniforms,
184
+ uniformBuffersNames: uniformBuffers,
185
+ samplers: samplers,
186
+ defines: defines,
187
+ maxSimultaneousLights: this.maxSimultaneousLights,
188
+ });
189
+ subMesh.setEffect(scene.getEngine().createEffect(shaderName, {
190
+ attributes: attribs,
191
+ uniformsNames: uniforms,
192
+ uniformBuffersNames: uniformBuffers,
193
+ samplers: samplers,
194
+ defines: join,
195
+ fallbacks: fallbacks,
196
+ onCompiled: this.onCompiled,
197
+ onError: this.onError,
198
+ indexParameters: { maxSimultaneousLights: this.maxSimultaneousLights },
199
+ }, engine), defines, this._materialContext);
200
+ }
201
+ if (!subMesh.effect || !subMesh.effect.isReady()) {
202
+ return false;
203
+ }
204
+ defines._renderId = scene.getRenderId();
205
+ subMesh.effect._wasPreviouslyReady = true;
206
+ return true;
207
+ };
208
+ TerrainMaterial.prototype.bindForSubMesh = function (world, mesh, subMesh) {
209
+ var scene = this.getScene();
210
+ var defines = subMesh.materialDefines;
211
+ if (!defines) {
212
+ return;
213
+ }
214
+ var effect = subMesh.effect;
215
+ if (!effect) {
216
+ return;
217
+ }
218
+ this._activeEffect = effect;
219
+ // Matrices
220
+ this.bindOnlyWorldMatrix(world);
221
+ this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());
222
+ // Bones
223
+ MaterialHelper.BindBonesParameters(mesh, this._activeEffect);
224
+ if (this._mustRebind(scene, effect)) {
225
+ // Textures
226
+ if (this.mixTexture) {
227
+ this._activeEffect.setTexture("textureSampler", this._mixTexture);
228
+ this._activeEffect.setFloat2("vTextureInfos", this._mixTexture.coordinatesIndex, this._mixTexture.level);
229
+ this._activeEffect.setMatrix("textureMatrix", this._mixTexture.getTextureMatrix());
230
+ if (MaterialFlags.DiffuseTextureEnabled) {
231
+ if (this._diffuseTexture1) {
232
+ this._activeEffect.setTexture("diffuse1Sampler", this._diffuseTexture1);
233
+ this._activeEffect.setFloat2("diffuse1Infos", this._diffuseTexture1.uScale, this._diffuseTexture1.vScale);
234
+ }
235
+ if (this._diffuseTexture2) {
236
+ this._activeEffect.setTexture("diffuse2Sampler", this._diffuseTexture2);
237
+ this._activeEffect.setFloat2("diffuse2Infos", this._diffuseTexture2.uScale, this._diffuseTexture2.vScale);
238
+ }
239
+ if (this._diffuseTexture3) {
240
+ this._activeEffect.setTexture("diffuse3Sampler", this._diffuseTexture3);
241
+ this._activeEffect.setFloat2("diffuse3Infos", this._diffuseTexture3.uScale, this._diffuseTexture3.vScale);
242
+ }
243
+ }
244
+ if (MaterialFlags.BumpTextureEnabled && scene.getEngine().getCaps().standardDerivatives) {
245
+ if (this._bumpTexture1) {
246
+ this._activeEffect.setTexture("bump1Sampler", this._bumpTexture1);
247
+ }
248
+ if (this._bumpTexture2) {
249
+ this._activeEffect.setTexture("bump2Sampler", this._bumpTexture2);
250
+ }
251
+ if (this._bumpTexture3) {
252
+ this._activeEffect.setTexture("bump3Sampler", this._bumpTexture3);
253
+ }
254
+ }
255
+ }
256
+ // Clip plane
257
+ MaterialHelper.BindClipPlane(this._activeEffect, scene);
258
+ // Point size
259
+ if (this.pointsCloud) {
260
+ this._activeEffect.setFloat("pointSize", this.pointSize);
261
+ }
262
+ scene.bindEyePosition(effect);
263
+ }
264
+ this._activeEffect.setColor4("vDiffuseColor", this.diffuseColor, this.alpha * mesh.visibility);
265
+ if (defines.SPECULARTERM) {
266
+ this._activeEffect.setColor4("vSpecularColor", this.specularColor, this.specularPower);
267
+ }
268
+ if (scene.lightsEnabled && !this.disableLighting) {
269
+ MaterialHelper.BindLights(scene, mesh, this._activeEffect, defines, this.maxSimultaneousLights);
270
+ }
271
+ // View
272
+ if (scene.fogEnabled && mesh.applyFog && scene.fogMode !== Scene.FOGMODE_NONE) {
273
+ this._activeEffect.setMatrix("view", scene.getViewMatrix());
274
+ }
275
+ // Fog
276
+ MaterialHelper.BindFogParameters(scene, mesh, this._activeEffect);
277
+ this._afterBind(mesh, this._activeEffect);
278
+ };
279
+ TerrainMaterial.prototype.getAnimatables = function () {
280
+ var results = [];
281
+ if (this.mixTexture && this.mixTexture.animations && this.mixTexture.animations.length > 0) {
282
+ results.push(this.mixTexture);
283
+ }
284
+ return results;
285
+ };
286
+ TerrainMaterial.prototype.getActiveTextures = function () {
287
+ var activeTextures = _super.prototype.getActiveTextures.call(this);
288
+ if (this._mixTexture) {
289
+ activeTextures.push(this._mixTexture);
290
+ }
291
+ if (this._diffuseTexture1) {
292
+ activeTextures.push(this._diffuseTexture1);
293
+ }
294
+ if (this._diffuseTexture2) {
295
+ activeTextures.push(this._diffuseTexture2);
296
+ }
297
+ if (this._diffuseTexture3) {
298
+ activeTextures.push(this._diffuseTexture3);
299
+ }
300
+ if (this._bumpTexture1) {
301
+ activeTextures.push(this._bumpTexture1);
302
+ }
303
+ if (this._bumpTexture2) {
304
+ activeTextures.push(this._bumpTexture2);
305
+ }
306
+ if (this._bumpTexture3) {
307
+ activeTextures.push(this._bumpTexture3);
308
+ }
309
+ return activeTextures;
310
+ };
311
+ TerrainMaterial.prototype.hasTexture = function (texture) {
312
+ if (_super.prototype.hasTexture.call(this, texture)) {
313
+ return true;
314
+ }
315
+ if (this._mixTexture === texture) {
316
+ return true;
317
+ }
318
+ if (this._diffuseTexture1 === texture) {
319
+ return true;
320
+ }
321
+ if (this._diffuseTexture2 === texture) {
322
+ return true;
323
+ }
324
+ if (this._diffuseTexture3 === texture) {
325
+ return true;
326
+ }
327
+ if (this._bumpTexture1 === texture) {
328
+ return true;
329
+ }
330
+ if (this._bumpTexture2 === texture) {
331
+ return true;
332
+ }
333
+ if (this._bumpTexture3 === texture) {
334
+ return true;
335
+ }
336
+ return false;
337
+ };
338
+ TerrainMaterial.prototype.dispose = function (forceDisposeEffect) {
339
+ if (this.mixTexture) {
340
+ this.mixTexture.dispose();
341
+ }
342
+ _super.prototype.dispose.call(this, forceDisposeEffect);
343
+ };
344
+ TerrainMaterial.prototype.clone = function (name) {
345
+ var _this = this;
346
+ return SerializationHelper.Clone(function () { return new TerrainMaterial(name, _this.getScene()); }, this);
347
+ };
348
+ TerrainMaterial.prototype.serialize = function () {
349
+ var serializationObject = _super.prototype.serialize.call(this);
350
+ serializationObject.customType = "BABYLON.TerrainMaterial";
351
+ return serializationObject;
352
+ };
353
+ TerrainMaterial.prototype.getClassName = function () {
354
+ return "TerrainMaterial";
355
+ };
356
+ // Statics
357
+ TerrainMaterial.Parse = function (source, scene, rootUrl) {
358
+ return SerializationHelper.Parse(function () { return new TerrainMaterial(source.name, scene); }, source, scene, rootUrl);
359
+ };
360
+ __decorate([
361
+ serializeAsTexture("mixTexture")
362
+ ], TerrainMaterial.prototype, "_mixTexture", void 0);
363
+ __decorate([
364
+ expandToProperty("_markAllSubMeshesAsTexturesDirty")
365
+ ], TerrainMaterial.prototype, "mixTexture", void 0);
366
+ __decorate([
367
+ serializeAsTexture("diffuseTexture1")
368
+ ], TerrainMaterial.prototype, "_diffuseTexture1", void 0);
369
+ __decorate([
370
+ expandToProperty("_markAllSubMeshesAsTexturesDirty")
371
+ ], TerrainMaterial.prototype, "diffuseTexture1", void 0);
372
+ __decorate([
373
+ serializeAsTexture("diffuseTexture2")
374
+ ], TerrainMaterial.prototype, "_diffuseTexture2", void 0);
375
+ __decorate([
376
+ expandToProperty("_markAllSubMeshesAsTexturesDirty")
377
+ ], TerrainMaterial.prototype, "diffuseTexture2", void 0);
378
+ __decorate([
379
+ serializeAsTexture("diffuseTexture3")
380
+ ], TerrainMaterial.prototype, "_diffuseTexture3", void 0);
381
+ __decorate([
382
+ expandToProperty("_markAllSubMeshesAsTexturesDirty")
383
+ ], TerrainMaterial.prototype, "diffuseTexture3", void 0);
384
+ __decorate([
385
+ serializeAsTexture("bumpTexture1")
386
+ ], TerrainMaterial.prototype, "_bumpTexture1", void 0);
387
+ __decorate([
388
+ expandToProperty("_markAllSubMeshesAsTexturesDirty")
389
+ ], TerrainMaterial.prototype, "bumpTexture1", void 0);
390
+ __decorate([
391
+ serializeAsTexture("bumpTexture2")
392
+ ], TerrainMaterial.prototype, "_bumpTexture2", void 0);
393
+ __decorate([
394
+ expandToProperty("_markAllSubMeshesAsTexturesDirty")
395
+ ], TerrainMaterial.prototype, "bumpTexture2", void 0);
396
+ __decorate([
397
+ serializeAsTexture("bumpTexture3")
398
+ ], TerrainMaterial.prototype, "_bumpTexture3", void 0);
399
+ __decorate([
400
+ expandToProperty("_markAllSubMeshesAsTexturesDirty")
401
+ ], TerrainMaterial.prototype, "bumpTexture3", void 0);
402
+ __decorate([
403
+ serializeAsColor3()
404
+ ], TerrainMaterial.prototype, "diffuseColor", void 0);
405
+ __decorate([
406
+ serializeAsColor3()
407
+ ], TerrainMaterial.prototype, "specularColor", void 0);
408
+ __decorate([
409
+ serialize()
410
+ ], TerrainMaterial.prototype, "specularPower", void 0);
411
+ __decorate([
412
+ serialize("disableLighting")
413
+ ], TerrainMaterial.prototype, "_disableLighting", void 0);
414
+ __decorate([
415
+ expandToProperty("_markAllSubMeshesAsLightsDirty")
416
+ ], TerrainMaterial.prototype, "disableLighting", void 0);
417
+ __decorate([
418
+ serialize("maxSimultaneousLights")
419
+ ], TerrainMaterial.prototype, "_maxSimultaneousLights", void 0);
420
+ __decorate([
421
+ expandToProperty("_markAllSubMeshesAsLightsDirty")
422
+ ], TerrainMaterial.prototype, "maxSimultaneousLights", void 0);
423
+ return TerrainMaterial;
424
+ }(PushMaterial));
425
+ export { TerrainMaterial };
426
+ RegisterClass("BABYLON.TerrainMaterial", TerrainMaterial);
412
427
  //# sourceMappingURL=terrainMaterial.js.map