@babylonjs/procedural-textures 5.19.0 → 5.22.0

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 (63) hide show
  1. package/brick/brickProceduralTexture.fragment.js +16 -3
  2. package/brick/brickProceduralTexture.fragment.js.map +1 -1
  3. package/brick/brickProceduralTexture.js +58 -79
  4. package/brick/brickProceduralTexture.js.map +1 -1
  5. package/cloud/cloudProceduralTexture.fragment.js +14 -3
  6. package/cloud/cloudProceduralTexture.fragment.js.map +1 -1
  7. package/cloud/cloudProceduralTexture.js +58 -79
  8. package/cloud/cloudProceduralTexture.js.map +1 -1
  9. package/fire/fireProceduralTexture.fragment.js +7 -3
  10. package/fire/fireProceduralTexture.fragment.js.map +1 -1
  11. package/fire/fireProceduralTexture.js +85 -126
  12. package/fire/fireProceduralTexture.js.map +1 -1
  13. package/grass/grassProceduralTexture.fragment.js +12 -3
  14. package/grass/grassProceduralTexture.fragment.js.map +1 -1
  15. package/grass/grassProceduralTexture.js +36 -49
  16. package/grass/grassProceduralTexture.js.map +1 -1
  17. package/legacy/legacy-brick.js +2 -2
  18. package/legacy/legacy-brick.js.map +1 -1
  19. package/legacy/legacy-cloud.js +2 -2
  20. package/legacy/legacy-cloud.js.map +1 -1
  21. package/legacy/legacy-fire.js +2 -2
  22. package/legacy/legacy-fire.js.map +1 -1
  23. package/legacy/legacy-grass.js +2 -2
  24. package/legacy/legacy-grass.js.map +1 -1
  25. package/legacy/legacy-marble.js +2 -2
  26. package/legacy/legacy-marble.js.map +1 -1
  27. package/legacy/legacy-normalMap.js +2 -2
  28. package/legacy/legacy-normalMap.js.map +1 -1
  29. package/legacy/legacy-perlinNoise.js +2 -2
  30. package/legacy/legacy-perlinNoise.js.map +1 -1
  31. package/legacy/legacy-road.js +2 -2
  32. package/legacy/legacy-road.js.map +1 -1
  33. package/legacy/legacy-starfield.js +2 -2
  34. package/legacy/legacy-starfield.js.map +1 -1
  35. package/legacy/legacy-wood.js +2 -2
  36. package/legacy/legacy-wood.js.map +1 -1
  37. package/legacy/legacy.js +2 -2
  38. package/legacy/legacy.js.map +1 -1
  39. package/marble/marbleProceduralTexture.fragment.js +3 -3
  40. package/marble/marbleProceduralTexture.fragment.js.map +1 -1
  41. package/marble/marbleProceduralTexture.js +58 -79
  42. package/marble/marbleProceduralTexture.js.map +1 -1
  43. package/normalMap/normalMapProceduralTexture.fragment.js +7 -3
  44. package/normalMap/normalMapProceduralTexture.fragment.js.map +1 -1
  45. package/normalMap/normalMapProceduralTexture.js +33 -42
  46. package/normalMap/normalMapProceduralTexture.js.map +1 -1
  47. package/package.json +2 -5
  48. package/perlinNoise/perlinNoiseProceduralTexture.fragment.js +41 -3
  49. package/perlinNoise/perlinNoiseProceduralTexture.fragment.js.map +1 -1
  50. package/perlinNoise/perlinNoiseProceduralTexture.js +35 -40
  51. package/perlinNoise/perlinNoiseProceduralTexture.js.map +1 -1
  52. package/road/roadProceduralTexture.fragment.js +13 -3
  53. package/road/roadProceduralTexture.fragment.js.map +1 -1
  54. package/road/roadProceduralTexture.js +25 -34
  55. package/road/roadProceduralTexture.js.map +1 -1
  56. package/starfield/starfieldProceduralTexture.fragment.js +18 -3
  57. package/starfield/starfieldProceduralTexture.fragment.js.map +1 -1
  58. package/starfield/starfieldProceduralTexture.js +136 -185
  59. package/starfield/starfieldProceduralTexture.js.map +1 -1
  60. package/wood/woodProceduralTexture.fragment.js +12 -3
  61. package/wood/woodProceduralTexture.fragment.js.map +1 -1
  62. package/wood/woodProceduralTexture.js +36 -49
  63. package/wood/woodProceduralTexture.js.map +1 -1
@@ -4,9 +4,9 @@ import * as proceduralTexture from "../normalMap/index.js";
4
4
  * This is the entry point for the UMD module.
5
5
  * The entry point for a future ESM package should be index.ts
6
6
  */
7
- var globalObject = typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : undefined;
7
+ const globalObject = typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : undefined;
8
8
  if (typeof globalObject !== "undefined") {
9
- for (var key in proceduralTexture) {
9
+ for (const key in proceduralTexture) {
10
10
  globalObject.BABYLON[key] = proceduralTexture[key];
11
11
  }
12
12
  }
@@ -1 +1 @@
1
- {"version":3,"file":"legacy-normalMap.js","sourceRoot":"","sources":["../../../../../lts/proceduralTextures/generated/legacy/legacy-normalMap.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,OAAO,KAAK,iBAAiB,MAAM,oBAAoB,CAAC;AACxD;;;GAGG;AACH,IAAM,YAAY,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;AACjH,IAAI,OAAO,YAAY,KAAK,WAAW,EAAE;IACrC,KAAK,IAAM,GAAG,IAAI,iBAAiB,EAAE;QAC3B,YAAa,CAAC,OAAO,CAAC,GAAG,CAAC,GAAS,iBAAkB,CAAC,GAAG,CAAC,CAAC;KACpE;CACJ;AACD,cAAc,oBAAoB,CAAC","sourcesContent":["/* eslint-disable import/no-internal-modules */\nimport * as proceduralTexture from \"../normalMap/index\";\n/**\n * This is the entry point for the UMD module.\n * The entry point for a future ESM package should be index.ts\n */\nconst globalObject = typeof global !== \"undefined\" ? global : typeof window !== \"undefined\" ? window : undefined;\nif (typeof globalObject !== \"undefined\") {\n for (const key in proceduralTexture) {\n (<any>globalObject).BABYLON[key] = (<any>proceduralTexture)[key];\n }\n}\nexport * from \"../normalMap/index\";\n"]}
1
+ {"version":3,"file":"legacy-normalMap.js","sourceRoot":"","sources":["../../../../../lts/proceduralTextures/generated/legacy/legacy-normalMap.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,OAAO,KAAK,iBAAiB,MAAM,oBAAoB,CAAC;AACxD;;;GAGG;AACH,MAAM,YAAY,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;AACjH,IAAI,OAAO,YAAY,KAAK,WAAW,EAAE;IACrC,KAAK,MAAM,GAAG,IAAI,iBAAiB,EAAE;QAC3B,YAAa,CAAC,OAAO,CAAC,GAAG,CAAC,GAAS,iBAAkB,CAAC,GAAG,CAAC,CAAC;KACpE;CACJ;AACD,cAAc,oBAAoB,CAAC","sourcesContent":["/* eslint-disable import/no-internal-modules */\nimport * as proceduralTexture from \"../normalMap/index\";\n/**\n * This is the entry point for the UMD module.\n * The entry point for a future ESM package should be index.ts\n */\nconst globalObject = typeof global !== \"undefined\" ? global : typeof window !== \"undefined\" ? window : undefined;\nif (typeof globalObject !== \"undefined\") {\n for (const key in proceduralTexture) {\n (<any>globalObject).BABYLON[key] = (<any>proceduralTexture)[key];\n }\n}\nexport * from \"../normalMap/index\";\n"]}
@@ -4,9 +4,9 @@ import * as proceduralTexture from "../perlinNoise/index.js";
4
4
  * This is the entry point for the UMD module.
5
5
  * The entry point for a future ESM package should be index.ts
6
6
  */
7
- var globalObject = typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : undefined;
7
+ const globalObject = typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : undefined;
8
8
  if (typeof globalObject !== "undefined") {
9
- for (var key in proceduralTexture) {
9
+ for (const key in proceduralTexture) {
10
10
  globalObject.BABYLON[key] = proceduralTexture[key];
11
11
  }
12
12
  }
@@ -1 +1 @@
1
- {"version":3,"file":"legacy-perlinNoise.js","sourceRoot":"","sources":["../../../../../lts/proceduralTextures/generated/legacy/legacy-perlinNoise.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,OAAO,KAAK,iBAAiB,MAAM,sBAAsB,CAAC;AAC1D;;;GAGG;AACH,IAAM,YAAY,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;AACjH,IAAI,OAAO,YAAY,KAAK,WAAW,EAAE;IACrC,KAAK,IAAM,GAAG,IAAI,iBAAiB,EAAE;QAC3B,YAAa,CAAC,OAAO,CAAC,GAAG,CAAC,GAAS,iBAAkB,CAAC,GAAG,CAAC,CAAC;KACpE;CACJ;AACD,cAAc,sBAAsB,CAAC","sourcesContent":["/* eslint-disable import/no-internal-modules */\nimport * as proceduralTexture from \"../perlinNoise/index\";\n/**\n * This is the entry point for the UMD module.\n * The entry point for a future ESM package should be index.ts\n */\nconst globalObject = typeof global !== \"undefined\" ? global : typeof window !== \"undefined\" ? window : undefined;\nif (typeof globalObject !== \"undefined\") {\n for (const key in proceduralTexture) {\n (<any>globalObject).BABYLON[key] = (<any>proceduralTexture)[key];\n }\n}\nexport * from \"../perlinNoise/index\";\n"]}
1
+ {"version":3,"file":"legacy-perlinNoise.js","sourceRoot":"","sources":["../../../../../lts/proceduralTextures/generated/legacy/legacy-perlinNoise.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,OAAO,KAAK,iBAAiB,MAAM,sBAAsB,CAAC;AAC1D;;;GAGG;AACH,MAAM,YAAY,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;AACjH,IAAI,OAAO,YAAY,KAAK,WAAW,EAAE;IACrC,KAAK,MAAM,GAAG,IAAI,iBAAiB,EAAE;QAC3B,YAAa,CAAC,OAAO,CAAC,GAAG,CAAC,GAAS,iBAAkB,CAAC,GAAG,CAAC,CAAC;KACpE;CACJ;AACD,cAAc,sBAAsB,CAAC","sourcesContent":["/* eslint-disable import/no-internal-modules */\nimport * as proceduralTexture from \"../perlinNoise/index\";\n/**\n * This is the entry point for the UMD module.\n * The entry point for a future ESM package should be index.ts\n */\nconst globalObject = typeof global !== \"undefined\" ? global : typeof window !== \"undefined\" ? window : undefined;\nif (typeof globalObject !== \"undefined\") {\n for (const key in proceduralTexture) {\n (<any>globalObject).BABYLON[key] = (<any>proceduralTexture)[key];\n }\n}\nexport * from \"../perlinNoise/index\";\n"]}
@@ -4,9 +4,9 @@ import * as proceduralTexture from "../road/index.js";
4
4
  * This is the entry point for the UMD module.
5
5
  * The entry point for a future ESM package should be index.ts
6
6
  */
7
- var globalObject = typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : undefined;
7
+ const globalObject = typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : undefined;
8
8
  if (typeof globalObject !== "undefined") {
9
- for (var key in proceduralTexture) {
9
+ for (const key in proceduralTexture) {
10
10
  globalObject.BABYLON[key] = proceduralTexture[key];
11
11
  }
12
12
  }
@@ -1 +1 @@
1
- {"version":3,"file":"legacy-road.js","sourceRoot":"","sources":["../../../../../lts/proceduralTextures/generated/legacy/legacy-road.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,OAAO,KAAK,iBAAiB,MAAM,eAAe,CAAC;AACnD;;;GAGG;AACH,IAAM,YAAY,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;AACjH,IAAI,OAAO,YAAY,KAAK,WAAW,EAAE;IACrC,KAAK,IAAM,GAAG,IAAI,iBAAiB,EAAE;QAC3B,YAAa,CAAC,OAAO,CAAC,GAAG,CAAC,GAAS,iBAAkB,CAAC,GAAG,CAAC,CAAC;KACpE;CACJ;AACD,cAAc,eAAe,CAAC","sourcesContent":["/* eslint-disable import/no-internal-modules */\nimport * as proceduralTexture from \"../road/index\";\n/**\n * This is the entry point for the UMD module.\n * The entry point for a future ESM package should be index.ts\n */\nconst globalObject = typeof global !== \"undefined\" ? global : typeof window !== \"undefined\" ? window : undefined;\nif (typeof globalObject !== \"undefined\") {\n for (const key in proceduralTexture) {\n (<any>globalObject).BABYLON[key] = (<any>proceduralTexture)[key];\n }\n}\nexport * from \"../road/index\";\n"]}
1
+ {"version":3,"file":"legacy-road.js","sourceRoot":"","sources":["../../../../../lts/proceduralTextures/generated/legacy/legacy-road.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,OAAO,KAAK,iBAAiB,MAAM,eAAe,CAAC;AACnD;;;GAGG;AACH,MAAM,YAAY,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;AACjH,IAAI,OAAO,YAAY,KAAK,WAAW,EAAE;IACrC,KAAK,MAAM,GAAG,IAAI,iBAAiB,EAAE;QAC3B,YAAa,CAAC,OAAO,CAAC,GAAG,CAAC,GAAS,iBAAkB,CAAC,GAAG,CAAC,CAAC;KACpE;CACJ;AACD,cAAc,eAAe,CAAC","sourcesContent":["/* eslint-disable import/no-internal-modules */\nimport * as proceduralTexture from \"../road/index\";\n/**\n * This is the entry point for the UMD module.\n * The entry point for a future ESM package should be index.ts\n */\nconst globalObject = typeof global !== \"undefined\" ? global : typeof window !== \"undefined\" ? window : undefined;\nif (typeof globalObject !== \"undefined\") {\n for (const key in proceduralTexture) {\n (<any>globalObject).BABYLON[key] = (<any>proceduralTexture)[key];\n }\n}\nexport * from \"../road/index\";\n"]}
@@ -4,9 +4,9 @@ import * as proceduralTexture from "../starfield/index.js";
4
4
  * This is the entry point for the UMD module.
5
5
  * The entry point for a future ESM package should be index.ts
6
6
  */
7
- var globalObject = typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : undefined;
7
+ const globalObject = typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : undefined;
8
8
  if (typeof globalObject !== "undefined") {
9
- for (var key in proceduralTexture) {
9
+ for (const key in proceduralTexture) {
10
10
  globalObject.BABYLON[key] = proceduralTexture[key];
11
11
  }
12
12
  }
@@ -1 +1 @@
1
- {"version":3,"file":"legacy-starfield.js","sourceRoot":"","sources":["../../../../../lts/proceduralTextures/generated/legacy/legacy-starfield.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,OAAO,KAAK,iBAAiB,MAAM,oBAAoB,CAAC;AACxD;;;GAGG;AACH,IAAM,YAAY,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;AACjH,IAAI,OAAO,YAAY,KAAK,WAAW,EAAE;IACrC,KAAK,IAAM,GAAG,IAAI,iBAAiB,EAAE;QAC3B,YAAa,CAAC,OAAO,CAAC,GAAG,CAAC,GAAS,iBAAkB,CAAC,GAAG,CAAC,CAAC;KACpE;CACJ;AACD,cAAc,oBAAoB,CAAC","sourcesContent":["/* eslint-disable import/no-internal-modules */\nimport * as proceduralTexture from \"../starfield/index\";\n/**\n * This is the entry point for the UMD module.\n * The entry point for a future ESM package should be index.ts\n */\nconst globalObject = typeof global !== \"undefined\" ? global : typeof window !== \"undefined\" ? window : undefined;\nif (typeof globalObject !== \"undefined\") {\n for (const key in proceduralTexture) {\n (<any>globalObject).BABYLON[key] = (<any>proceduralTexture)[key];\n }\n}\nexport * from \"../starfield/index\";\n"]}
1
+ {"version":3,"file":"legacy-starfield.js","sourceRoot":"","sources":["../../../../../lts/proceduralTextures/generated/legacy/legacy-starfield.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,OAAO,KAAK,iBAAiB,MAAM,oBAAoB,CAAC;AACxD;;;GAGG;AACH,MAAM,YAAY,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;AACjH,IAAI,OAAO,YAAY,KAAK,WAAW,EAAE;IACrC,KAAK,MAAM,GAAG,IAAI,iBAAiB,EAAE;QAC3B,YAAa,CAAC,OAAO,CAAC,GAAG,CAAC,GAAS,iBAAkB,CAAC,GAAG,CAAC,CAAC;KACpE;CACJ;AACD,cAAc,oBAAoB,CAAC","sourcesContent":["/* eslint-disable import/no-internal-modules */\nimport * as proceduralTexture from \"../starfield/index\";\n/**\n * This is the entry point for the UMD module.\n * The entry point for a future ESM package should be index.ts\n */\nconst globalObject = typeof global !== \"undefined\" ? global : typeof window !== \"undefined\" ? window : undefined;\nif (typeof globalObject !== \"undefined\") {\n for (const key in proceduralTexture) {\n (<any>globalObject).BABYLON[key] = (<any>proceduralTexture)[key];\n }\n}\nexport * from \"../starfield/index\";\n"]}
@@ -4,9 +4,9 @@ import * as proceduralTexture from "../wood/index.js";
4
4
  * This is the entry point for the UMD module.
5
5
  * The entry point for a future ESM package should be index.ts
6
6
  */
7
- var globalObject = typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : undefined;
7
+ const globalObject = typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : undefined;
8
8
  if (typeof globalObject !== "undefined") {
9
- for (var key in proceduralTexture) {
9
+ for (const key in proceduralTexture) {
10
10
  globalObject.BABYLON[key] = proceduralTexture[key];
11
11
  }
12
12
  }
@@ -1 +1 @@
1
- {"version":3,"file":"legacy-wood.js","sourceRoot":"","sources":["../../../../../lts/proceduralTextures/generated/legacy/legacy-wood.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,OAAO,KAAK,iBAAiB,MAAM,eAAe,CAAC;AACnD;;;GAGG;AACH,IAAM,YAAY,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;AACjH,IAAI,OAAO,YAAY,KAAK,WAAW,EAAE;IACrC,KAAK,IAAM,GAAG,IAAI,iBAAiB,EAAE;QAC3B,YAAa,CAAC,OAAO,CAAC,GAAG,CAAC,GAAS,iBAAkB,CAAC,GAAG,CAAC,CAAC;KACpE;CACJ;AACD,cAAc,eAAe,CAAC","sourcesContent":["/* eslint-disable import/no-internal-modules */\nimport * as proceduralTexture from \"../wood/index\";\n/**\n * This is the entry point for the UMD module.\n * The entry point for a future ESM package should be index.ts\n */\nconst globalObject = typeof global !== \"undefined\" ? global : typeof window !== \"undefined\" ? window : undefined;\nif (typeof globalObject !== \"undefined\") {\n for (const key in proceduralTexture) {\n (<any>globalObject).BABYLON[key] = (<any>proceduralTexture)[key];\n }\n}\nexport * from \"../wood/index\";\n"]}
1
+ {"version":3,"file":"legacy-wood.js","sourceRoot":"","sources":["../../../../../lts/proceduralTextures/generated/legacy/legacy-wood.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,OAAO,KAAK,iBAAiB,MAAM,eAAe,CAAC;AACnD;;;GAGG;AACH,MAAM,YAAY,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;AACjH,IAAI,OAAO,YAAY,KAAK,WAAW,EAAE;IACrC,KAAK,MAAM,GAAG,IAAI,iBAAiB,EAAE;QAC3B,YAAa,CAAC,OAAO,CAAC,GAAG,CAAC,GAAS,iBAAkB,CAAC,GAAG,CAAC,CAAC;KACpE;CACJ;AACD,cAAc,eAAe,CAAC","sourcesContent":["/* eslint-disable import/no-internal-modules */\nimport * as proceduralTexture from \"../wood/index\";\n/**\n * This is the entry point for the UMD module.\n * The entry point for a future ESM package should be index.ts\n */\nconst globalObject = typeof global !== \"undefined\" ? global : typeof window !== \"undefined\" ? window : undefined;\nif (typeof globalObject !== \"undefined\") {\n for (const key in proceduralTexture) {\n (<any>globalObject).BABYLON[key] = (<any>proceduralTexture)[key];\n }\n}\nexport * from \"../wood/index\";\n"]}
package/legacy/legacy.js CHANGED
@@ -6,10 +6,10 @@ import * as ProceduralTexturesLib from "../index.js";
6
6
  * This is the entry point for the UMD module.
7
7
  * The entry point for a future ESM package should be index.ts
8
8
  */
9
- var globalObject = typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : undefined;
9
+ const globalObject = typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : undefined;
10
10
  if (typeof globalObject !== "undefined") {
11
11
  globalObject.BABYLON = globalObject.BABYLON || {};
12
- for (var mat in ProceduralTexturesLib) {
12
+ for (const mat in ProceduralTexturesLib) {
13
13
  globalObject.BABYLON[mat] = ProceduralTexturesLib[mat];
14
14
  }
15
15
  }
@@ -1 +1 @@
1
- {"version":3,"file":"legacy.js","sourceRoot":"","sources":["../../../../../lts/proceduralTextures/generated/legacy/legacy.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,OAAO,KAAK,qBAAqB,MAAM,UAAU,CAAC;AAClD;;;;;GAKG;AACH,IAAM,YAAY,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;AACjH,IAAI,OAAO,YAAY,KAAK,WAAW,EAAE;IAC/B,YAAa,CAAC,OAAO,GAAS,YAAa,CAAC,OAAO,IAAI,EAAE,CAAC;IAChE,KAAK,IAAM,GAAG,IAAI,qBAAqB,EAAE;QAC/B,YAAa,CAAC,OAAO,CAAC,GAAG,CAAC,GAAS,qBAAsB,CAAC,GAAG,CAAC,CAAC;KACxE;CACJ;AACD,cAAc,UAAU,CAAC","sourcesContent":["/* eslint-disable import/no-internal-modules */\nimport * as ProceduralTexturesLib from \"../index\";\n/**\n * Legacy support, defining window.BABYLON.GridMaterial... (global variable).\n *\n * This is the entry point for the UMD module.\n * The entry point for a future ESM package should be index.ts\n */\nconst globalObject = typeof global !== \"undefined\" ? global : typeof window !== \"undefined\" ? window : undefined;\nif (typeof globalObject !== \"undefined\") {\n (<any>globalObject).BABYLON = (<any>globalObject).BABYLON || {};\n for (const mat in ProceduralTexturesLib) {\n (<any>globalObject).BABYLON[mat] = (<any>ProceduralTexturesLib)[mat];\n }\n}\nexport * from \"../index\";\n"]}
1
+ {"version":3,"file":"legacy.js","sourceRoot":"","sources":["../../../../../lts/proceduralTextures/generated/legacy/legacy.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,OAAO,KAAK,qBAAqB,MAAM,UAAU,CAAC;AAClD;;;;;GAKG;AACH,MAAM,YAAY,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;AACjH,IAAI,OAAO,YAAY,KAAK,WAAW,EAAE;IAC/B,YAAa,CAAC,OAAO,GAAS,YAAa,CAAC,OAAO,IAAI,EAAE,CAAC;IAChE,KAAK,MAAM,GAAG,IAAI,qBAAqB,EAAE;QAC/B,YAAa,CAAC,OAAO,CAAC,GAAG,CAAC,GAAS,qBAAsB,CAAC,GAAG,CAAC,CAAC;KACxE;CACJ;AACD,cAAc,UAAU,CAAC","sourcesContent":["/* eslint-disable import/no-internal-modules */\nimport * as ProceduralTexturesLib from \"../index\";\n/**\n * Legacy support, defining window.BABYLON.GridMaterial... (global variable).\n *\n * This is the entry point for the UMD module.\n * The entry point for a future ESM package should be index.ts\n */\nconst globalObject = typeof global !== \"undefined\" ? global : typeof window !== \"undefined\" ? window : undefined;\nif (typeof globalObject !== \"undefined\") {\n (<any>globalObject).BABYLON = (<any>globalObject).BABYLON || {};\n for (const mat in ProceduralTexturesLib) {\n (<any>globalObject).BABYLON[mat] = (<any>ProceduralTexturesLib)[mat];\n }\n}\nexport * from \"../index\";\n"]}
@@ -1,9 +1,9 @@
1
1
  // Do not edit.
2
2
  import { ShaderStore } from "@babylonjs/core/Engines/shaderStore.js";
3
- var name = "marbleProceduralTexturePixelShader";
4
- var shader = "precision highp float;\nvarying vec2 vPosition;\nvarying vec2 vUV;\nuniform float numberOfTilesHeight;\nuniform float numberOfTilesWidth;\nuniform float amplitude;\nuniform vec3 marbleColor;\nuniform vec3 jointColor;\nconst vec3 tileSize=vec3(1.1,1.0,1.1);\nconst vec3 tilePct=vec3(0.98,1.0,0.98);\nfloat rand(vec2 n) {\nreturn fract(cos(dot(n,vec2(12.9898,4.1414)))*43758.5453);\n}\nfloat noise(vec2 n) {\nconst vec2 d=vec2(0.0,1.0);\nvec2 b=floor(n),f=smoothstep(vec2(0.0),vec2(1.0),fract(n));\nreturn mix(mix(rand(b),rand(b+d.yx),f.x),mix(rand(b+d.xy),rand(b+d.yy),f.x),f.y);\n}\nfloat turbulence(vec2 P)\n{\nfloat val=0.0;\nfloat freq=1.0;\nfor (int i=0; i<4; i++)\n{\nval+=abs(noise(P*freq)/freq);\nfreq*=2.07;\n}\nreturn val;\n}\nfloat roundF(float number){\nreturn sign(number)*floor(abs(number)+0.5);\n}\nvec3 marble_color(float x)\n{\nvec3 col;\nx=0.5*(x+1.);\nx=sqrt(x); \nx=sqrt(x);\nx=sqrt(x);\ncol=vec3(.2+.75*x); \ncol.b*=0.95; \nreturn col;\n}\nvoid main()\n{\nfloat brickW=1.0/numberOfTilesWidth;\nfloat brickH=1.0/numberOfTilesHeight;\nfloat jointWPercentage=0.01;\nfloat jointHPercentage=0.01;\nvec3 color=marbleColor;\nfloat yi=vUV.y/brickH;\nfloat nyi=roundF(yi);\nfloat xi=vUV.x/brickW;\nif (mod(floor(yi),2.0)==0.0){\nxi=xi-0.5;\n}\nfloat nxi=roundF(xi);\nvec2 brickvUV=vec2((xi-floor(xi))/brickH,(yi-floor(yi))/brickW);\nif (yi<nyi+jointHPercentage && yi>nyi-jointHPercentage){\ncolor=mix(jointColor,vec3(0.37,0.25,0.25),(yi-nyi)/jointHPercentage+0.2);\n}\nelse if (xi<nxi+jointWPercentage && xi>nxi-jointWPercentage){\ncolor=mix(jointColor,vec3(0.44,0.44,0.44),(xi-nxi)/jointWPercentage+0.2);\n}\nelse {\nfloat t=6.28*brickvUV.x/(tileSize.x+noise(vec2(vUV)*6.0));\nt+=amplitude*turbulence(brickvUV.xy);\nt=sin(t);\ncolor=marble_color(t);\n}\ngl_FragColor=vec4(color,0.0);\n}";
3
+ const name = "marbleProceduralTexturePixelShader";
4
+ const shader = `precision highp float;
5
5
  // Sideeffect
6
6
  ShaderStore.ShadersStore[name] = shader;
7
7
  /** @hidden */
8
- export var marbleProceduralTexturePixelShader = { name: name, shader: shader };
8
+ export const marbleProceduralTexturePixelShader = { name, shader };
9
9
  //# sourceMappingURL=marbleProceduralTexture.fragment.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"marbleProceduralTexture.fragment.js","sourceRoot":"","sources":["../../../../../lts/proceduralTextures/generated/marble/marbleProceduralTexture.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,+CAAiC;AAEvD,IAAM,IAAI,GAAG,oCAAoC,CAAC;AAClD,IAAM,MAAM,GAAG,wwDAuEb,CAAC;AACH,aAAa;AACb,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACxC,cAAc;AACd,MAAM,CAAC,IAAM,kCAAkC,GAAG,EAAE,IAAI,MAAA,EAAE,MAAM,QAAA,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"core/Engines/shaderStore\";\n\nconst name = \"marbleProceduralTexturePixelShader\";\nconst shader = `precision highp float;\rvarying vec2 vPosition;\rvarying vec2 vUV;\runiform float numberOfTilesHeight;\runiform float numberOfTilesWidth;\runiform float amplitude;\runiform vec3 marbleColor;\runiform vec3 jointColor;\rconst vec3 tileSize=vec3(1.1,1.0,1.1);\rconst vec3 tilePct=vec3(0.98,1.0,0.98);\rfloat rand(vec2 n) {\rreturn fract(cos(dot(n,vec2(12.9898,4.1414)))*43758.5453);\r}\rfloat noise(vec2 n) {\rconst vec2 d=vec2(0.0,1.0);\rvec2 b=floor(n),f=smoothstep(vec2(0.0),vec2(1.0),fract(n));\rreturn mix(mix(rand(b),rand(b+d.yx),f.x),mix(rand(b+d.xy),rand(b+d.yy),f.x),f.y);\r}\rfloat turbulence(vec2 P)\r{\rfloat val=0.0;\rfloat freq=1.0;\rfor (int i=0; i<4; i++)\r{\rval+=abs(noise(P*freq)/freq);\rfreq*=2.07;\r}\rreturn val;\r}\rfloat roundF(float number){\rreturn sign(number)*floor(abs(number)+0.5);\r}\rvec3 marble_color(float x)\r{\rvec3 col;\rx=0.5*(x+1.);\rx=sqrt(x); \rx=sqrt(x);\rx=sqrt(x);\rcol=vec3(.2+.75*x); \rcol.b*=0.95; \rreturn col;\r}\rvoid main()\r{\rfloat brickW=1.0/numberOfTilesWidth;\rfloat brickH=1.0/numberOfTilesHeight;\rfloat jointWPercentage=0.01;\rfloat jointHPercentage=0.01;\rvec3 color=marbleColor;\rfloat yi=vUV.y/brickH;\rfloat nyi=roundF(yi);\rfloat xi=vUV.x/brickW;\rif (mod(floor(yi),2.0)==0.0){\rxi=xi-0.5;\r}\rfloat nxi=roundF(xi);\rvec2 brickvUV=vec2((xi-floor(xi))/brickH,(yi-floor(yi))/brickW);\rif (yi<nyi+jointHPercentage && yi>nyi-jointHPercentage){\rcolor=mix(jointColor,vec3(0.37,0.25,0.25),(yi-nyi)/jointHPercentage+0.2);\r}\relse if (xi<nxi+jointWPercentage && xi>nxi-jointWPercentage){\rcolor=mix(jointColor,vec3(0.44,0.44,0.44),(xi-nxi)/jointWPercentage+0.2);\r}\relse {\rfloat t=6.28*brickvUV.x/(tileSize.x+noise(vec2(vUV)*6.0));\rt+=amplitude*turbulence(brickvUV.xy);\rt=sin(t);\rcolor=marble_color(t);\r}\rgl_FragColor=vec4(color,0.0);\r}`;\n// Sideeffect\nShaderStore.ShadersStore[name] = shader;\n/** @hidden */\nexport const marbleProceduralTexturePixelShader = { name, shader };\n"]}
1
+ {"version":3,"file":"marbleProceduralTexture.fragment.js","sourceRoot":"","sources":["../../../../../lts/proceduralTextures/generated/marble/marbleProceduralTexture.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,+CAAiC;AAEvD,MAAM,IAAI,GAAG,oCAAoC,CAAC;AAClD,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuEb,CAAC;AACH,aAAa;AACb,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACxC,cAAc;AACd,MAAM,CAAC,MAAM,kCAAkC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"core/Engines/shaderStore\";\n\nconst name = \"marbleProceduralTexturePixelShader\";\nconst shader = `precision highp float;\rvarying vec2 vPosition;\rvarying vec2 vUV;\runiform float numberOfTilesHeight;\runiform float numberOfTilesWidth;\runiform float amplitude;\runiform vec3 marbleColor;\runiform vec3 jointColor;\rconst vec3 tileSize=vec3(1.1,1.0,1.1);\rconst vec3 tilePct=vec3(0.98,1.0,0.98);\rfloat rand(vec2 n) {\rreturn fract(cos(dot(n,vec2(12.9898,4.1414)))*43758.5453);\r}\rfloat noise(vec2 n) {\rconst vec2 d=vec2(0.0,1.0);\rvec2 b=floor(n),f=smoothstep(vec2(0.0),vec2(1.0),fract(n));\rreturn mix(mix(rand(b),rand(b+d.yx),f.x),mix(rand(b+d.xy),rand(b+d.yy),f.x),f.y);\r}\rfloat turbulence(vec2 P)\r{\rfloat val=0.0;\rfloat freq=1.0;\rfor (int i=0; i<4; i++)\r{\rval+=abs(noise(P*freq)/freq);\rfreq*=2.07;\r}\rreturn val;\r}\rfloat roundF(float number){\rreturn sign(number)*floor(abs(number)+0.5);\r}\rvec3 marble_color(float x)\r{\rvec3 col;\rx=0.5*(x+1.);\rx=sqrt(x); \rx=sqrt(x);\rx=sqrt(x);\rcol=vec3(.2+.75*x); \rcol.b*=0.95; \rreturn col;\r}\rvoid main()\r{\rfloat brickW=1.0/numberOfTilesWidth;\rfloat brickH=1.0/numberOfTilesHeight;\rfloat jointWPercentage=0.01;\rfloat jointHPercentage=0.01;\rvec3 color=marbleColor;\rfloat yi=vUV.y/brickH;\rfloat nyi=roundF(yi);\rfloat xi=vUV.x/brickW;\rif (mod(floor(yi),2.0)==0.0){\rxi=xi-0.5;\r}\rfloat nxi=roundF(xi);\rvec2 brickvUV=vec2((xi-floor(xi))/brickH,(yi-floor(yi))/brickW);\rif (yi<nyi+jointHPercentage && yi>nyi-jointHPercentage){\rcolor=mix(jointColor,vec3(0.37,0.25,0.25),(yi-nyi)/jointHPercentage+0.2);\r}\relse if (xi<nxi+jointWPercentage && xi>nxi-jointWPercentage){\rcolor=mix(jointColor,vec3(0.44,0.44,0.44),(xi-nxi)/jointWPercentage+0.2);\r}\relse {\rfloat t=6.28*brickvUV.x/(tileSize.x+noise(vec2(vUV)*6.0));\rt+=amplitude*turbulence(brickvUV.xy);\rt=sin(t);\rcolor=marble_color(t);\r}\rgl_FragColor=vec4(color,0.0);\r}`;\n// Sideeffect\nShaderStore.ShadersStore[name] = shader;\n/** @hidden */\nexport const marbleProceduralTexturePixelShader = { name, shader };\n"]}
@@ -1,80 +1,61 @@
1
- import { __decorate, __extends } from "tslib";
1
+ import { __decorate } from "@babylonjs/core/tslib.es6.js";
2
2
  import { serialize, SerializationHelper } from "@babylonjs/core/Misc/decorators.js";
3
3
  import { Color3 } from "@babylonjs/core/Maths/math.color.js";
4
4
  import { ProceduralTexture } from "@babylonjs/core/Materials/Textures/Procedurals/proceduralTexture.js";
5
5
  import { RegisterClass } from "@babylonjs/core/Misc/typeStore.js";
6
6
  import "./marbleProceduralTexture.fragment.js";
7
- var MarbleProceduralTexture = /** @class */ (function (_super) {
8
- __extends(MarbleProceduralTexture, _super);
9
- function MarbleProceduralTexture(name, size, scene, fallbackTexture, generateMipMaps) {
10
- if (scene === void 0) { scene = null; }
11
- var _this = _super.call(this, name, size, "marbleProceduralTexture", scene, fallbackTexture, generateMipMaps) || this;
12
- _this._numberOfTilesHeight = 3;
13
- _this._numberOfTilesWidth = 3;
14
- _this._amplitude = 9.0;
15
- _this._jointColor = new Color3(0.72, 0.72, 0.72);
16
- _this.updateShaderUniforms();
17
- return _this;
7
+ export class MarbleProceduralTexture extends ProceduralTexture {
8
+ constructor(name, size, scene = null, fallbackTexture, generateMipMaps) {
9
+ super(name, size, "marbleProceduralTexture", scene, fallbackTexture, generateMipMaps);
10
+ this._numberOfTilesHeight = 3;
11
+ this._numberOfTilesWidth = 3;
12
+ this._amplitude = 9.0;
13
+ this._jointColor = new Color3(0.72, 0.72, 0.72);
14
+ this.updateShaderUniforms();
18
15
  }
19
- MarbleProceduralTexture.prototype.updateShaderUniforms = function () {
16
+ updateShaderUniforms() {
20
17
  this.setFloat("numberOfTilesHeight", this._numberOfTilesHeight);
21
18
  this.setFloat("numberOfTilesWidth", this._numberOfTilesWidth);
22
19
  this.setFloat("amplitude", this._amplitude);
23
20
  this.setColor3("jointColor", this._jointColor);
24
- };
25
- Object.defineProperty(MarbleProceduralTexture.prototype, "numberOfTilesHeight", {
26
- get: function () {
27
- return this._numberOfTilesHeight;
28
- },
29
- set: function (value) {
30
- this._numberOfTilesHeight = value;
31
- this.updateShaderUniforms();
32
- },
33
- enumerable: false,
34
- configurable: true
35
- });
36
- Object.defineProperty(MarbleProceduralTexture.prototype, "amplitude", {
37
- get: function () {
38
- return this._amplitude;
39
- },
40
- set: function (value) {
41
- this._amplitude = value;
42
- this.updateShaderUniforms();
43
- },
44
- enumerable: false,
45
- configurable: true
46
- });
47
- Object.defineProperty(MarbleProceduralTexture.prototype, "numberOfTilesWidth", {
48
- get: function () {
49
- return this._numberOfTilesWidth;
50
- },
51
- set: function (value) {
52
- this._numberOfTilesWidth = value;
53
- this.updateShaderUniforms();
54
- },
55
- enumerable: false,
56
- configurable: true
57
- });
58
- Object.defineProperty(MarbleProceduralTexture.prototype, "jointColor", {
59
- get: function () {
60
- return this._jointColor;
61
- },
62
- set: function (value) {
63
- this._jointColor = value;
64
- this.updateShaderUniforms();
65
- },
66
- enumerable: false,
67
- configurable: true
68
- });
21
+ }
22
+ get numberOfTilesHeight() {
23
+ return this._numberOfTilesHeight;
24
+ }
25
+ set numberOfTilesHeight(value) {
26
+ this._numberOfTilesHeight = value;
27
+ this.updateShaderUniforms();
28
+ }
29
+ get amplitude() {
30
+ return this._amplitude;
31
+ }
32
+ set amplitude(value) {
33
+ this._amplitude = value;
34
+ this.updateShaderUniforms();
35
+ }
36
+ get numberOfTilesWidth() {
37
+ return this._numberOfTilesWidth;
38
+ }
39
+ set numberOfTilesWidth(value) {
40
+ this._numberOfTilesWidth = value;
41
+ this.updateShaderUniforms();
42
+ }
43
+ get jointColor() {
44
+ return this._jointColor;
45
+ }
46
+ set jointColor(value) {
47
+ this._jointColor = value;
48
+ this.updateShaderUniforms();
49
+ }
69
50
  /**
70
51
  * Serializes this marble procedural texture
71
52
  * @returns a serialized marble procedural texture object
72
53
  */
73
- MarbleProceduralTexture.prototype.serialize = function () {
74
- var serializationObject = SerializationHelper.Serialize(this, _super.prototype.serialize.call(this));
54
+ serialize() {
55
+ const serializationObject = SerializationHelper.Serialize(this, super.serialize());
75
56
  serializationObject.customType = "BABYLON.MarbleProceduralTexture";
76
57
  return serializationObject;
77
- };
58
+ }
78
59
  /**
79
60
  * Creates a Marble Procedural Texture from parsed marble procedural texture data
80
61
  * @param parsedTexture defines parsed texture data
@@ -82,24 +63,22 @@ var MarbleProceduralTexture = /** @class */ (function (_super) {
82
63
  * @param rootUrl defines the root URL containing marble procedural texture information
83
64
  * @returns a parsed Marble Procedural Texture
84
65
  */
85
- MarbleProceduralTexture.Parse = function (parsedTexture, scene, rootUrl) {
86
- var texture = SerializationHelper.Parse(function () { return new MarbleProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps); }, parsedTexture, scene, rootUrl);
66
+ static Parse(parsedTexture, scene, rootUrl) {
67
+ const texture = SerializationHelper.Parse(() => new MarbleProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps), parsedTexture, scene, rootUrl);
87
68
  return texture;
88
- };
89
- __decorate([
90
- serialize()
91
- ], MarbleProceduralTexture.prototype, "numberOfTilesHeight", null);
92
- __decorate([
93
- serialize()
94
- ], MarbleProceduralTexture.prototype, "amplitude", null);
95
- __decorate([
96
- serialize()
97
- ], MarbleProceduralTexture.prototype, "numberOfTilesWidth", null);
98
- __decorate([
99
- serialize()
100
- ], MarbleProceduralTexture.prototype, "jointColor", null);
101
- return MarbleProceduralTexture;
102
- }(ProceduralTexture));
103
- export { MarbleProceduralTexture };
69
+ }
70
+ }
71
+ __decorate([
72
+ serialize()
73
+ ], MarbleProceduralTexture.prototype, "numberOfTilesHeight", null);
74
+ __decorate([
75
+ serialize()
76
+ ], MarbleProceduralTexture.prototype, "amplitude", null);
77
+ __decorate([
78
+ serialize()
79
+ ], MarbleProceduralTexture.prototype, "numberOfTilesWidth", null);
80
+ __decorate([
81
+ serialize()
82
+ ], MarbleProceduralTexture.prototype, "jointColor", null);
104
83
  RegisterClass("BABYLON.MarbleProceduralTexture", MarbleProceduralTexture);
105
84
  //# sourceMappingURL=marbleProceduralTexture.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"marbleProceduralTexture.js","sourceRoot":"","sources":["../../../../../lts/proceduralTextures/generated/marble/marbleProceduralTexture.ts"],"names":[],"mappings":"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","sourcesContent":["import { serialize, SerializationHelper } from \"core/Misc/decorators\";\r\nimport { Color3 } from \"core/Maths/math.color\";\r\nimport type { Texture } from \"core/Materials/Textures/texture\";\r\nimport { ProceduralTexture } from \"core/Materials/Textures/Procedurals/proceduralTexture\";\r\nimport type { Scene } from \"core/scene\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport type { Nullable } from \"core/types\";\r\n\r\nimport \"./marbleProceduralTexture.fragment\";\r\n\r\nexport class MarbleProceduralTexture extends ProceduralTexture {\r\n private _numberOfTilesHeight: number = 3;\r\n private _numberOfTilesWidth: number = 3;\r\n private _amplitude: number = 9.0;\r\n private _jointColor = new Color3(0.72, 0.72, 0.72);\r\n\r\n constructor(name: string, size: number, scene: Nullable<Scene> = null, fallbackTexture?: Texture, generateMipMaps?: boolean) {\r\n super(name, size, \"marbleProceduralTexture\", scene, fallbackTexture, generateMipMaps);\r\n this.updateShaderUniforms();\r\n }\r\n\r\n public updateShaderUniforms() {\r\n this.setFloat(\"numberOfTilesHeight\", this._numberOfTilesHeight);\r\n this.setFloat(\"numberOfTilesWidth\", this._numberOfTilesWidth);\r\n this.setFloat(\"amplitude\", this._amplitude);\r\n this.setColor3(\"jointColor\", this._jointColor);\r\n }\r\n\r\n @serialize()\r\n public get numberOfTilesHeight(): number {\r\n return this._numberOfTilesHeight;\r\n }\r\n\r\n public set numberOfTilesHeight(value: number) {\r\n this._numberOfTilesHeight = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n @serialize()\r\n public get amplitude(): number {\r\n return this._amplitude;\r\n }\r\n\r\n public set amplitude(value: number) {\r\n this._amplitude = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n @serialize()\r\n public get numberOfTilesWidth(): number {\r\n return this._numberOfTilesWidth;\r\n }\r\n\r\n public set numberOfTilesWidth(value: number) {\r\n this._numberOfTilesWidth = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n @serialize()\r\n public get jointColor(): Color3 {\r\n return this._jointColor;\r\n }\r\n\r\n public set jointColor(value: Color3) {\r\n this._jointColor = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n /**\r\n * Serializes this marble procedural texture\r\n * @returns a serialized marble procedural texture object\r\n */\r\n public serialize(): any {\r\n const serializationObject = SerializationHelper.Serialize(this, super.serialize());\r\n serializationObject.customType = \"BABYLON.MarbleProceduralTexture\";\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Creates a Marble Procedural Texture from parsed marble procedural texture data\r\n * @param parsedTexture defines parsed texture data\r\n * @param scene defines the current scene\r\n * @param rootUrl defines the root URL containing marble procedural texture information\r\n * @returns a parsed Marble Procedural Texture\r\n */\r\n public static Parse(parsedTexture: any, scene: Scene, rootUrl: string): MarbleProceduralTexture {\r\n const texture = SerializationHelper.Parse(\r\n () => new MarbleProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps),\r\n parsedTexture,\r\n scene,\r\n rootUrl\r\n );\r\n\r\n return texture;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.MarbleProceduralTexture\", MarbleProceduralTexture);\r\n"]}
1
+ {"version":3,"file":"marbleProceduralTexture.js","sourceRoot":"","sources":["../../../../../lts/proceduralTextures/generated/marble/marbleProceduralTexture.ts"],"names":[],"mappings":"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","sourcesContent":["import { serialize, SerializationHelper } from \"core/Misc/decorators\";\r\nimport { Color3 } from \"core/Maths/math.color\";\r\nimport type { Texture } from \"core/Materials/Textures/texture\";\r\nimport { ProceduralTexture } from \"core/Materials/Textures/Procedurals/proceduralTexture\";\r\nimport type { Scene } from \"core/scene\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport type { Nullable } from \"core/types\";\r\n\r\nimport \"./marbleProceduralTexture.fragment\";\r\n\r\nexport class MarbleProceduralTexture extends ProceduralTexture {\r\n private _numberOfTilesHeight: number = 3;\r\n private _numberOfTilesWidth: number = 3;\r\n private _amplitude: number = 9.0;\r\n private _jointColor = new Color3(0.72, 0.72, 0.72);\r\n\r\n constructor(name: string, size: number, scene: Nullable<Scene> = null, fallbackTexture?: Texture, generateMipMaps?: boolean) {\r\n super(name, size, \"marbleProceduralTexture\", scene, fallbackTexture, generateMipMaps);\r\n this.updateShaderUniforms();\r\n }\r\n\r\n public updateShaderUniforms() {\r\n this.setFloat(\"numberOfTilesHeight\", this._numberOfTilesHeight);\r\n this.setFloat(\"numberOfTilesWidth\", this._numberOfTilesWidth);\r\n this.setFloat(\"amplitude\", this._amplitude);\r\n this.setColor3(\"jointColor\", this._jointColor);\r\n }\r\n\r\n @serialize()\r\n public get numberOfTilesHeight(): number {\r\n return this._numberOfTilesHeight;\r\n }\r\n\r\n public set numberOfTilesHeight(value: number) {\r\n this._numberOfTilesHeight = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n @serialize()\r\n public get amplitude(): number {\r\n return this._amplitude;\r\n }\r\n\r\n public set amplitude(value: number) {\r\n this._amplitude = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n @serialize()\r\n public get numberOfTilesWidth(): number {\r\n return this._numberOfTilesWidth;\r\n }\r\n\r\n public set numberOfTilesWidth(value: number) {\r\n this._numberOfTilesWidth = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n @serialize()\r\n public get jointColor(): Color3 {\r\n return this._jointColor;\r\n }\r\n\r\n public set jointColor(value: Color3) {\r\n this._jointColor = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n /**\r\n * Serializes this marble procedural texture\r\n * @returns a serialized marble procedural texture object\r\n */\r\n public serialize(): any {\r\n const serializationObject = SerializationHelper.Serialize(this, super.serialize());\r\n serializationObject.customType = \"BABYLON.MarbleProceduralTexture\";\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Creates a Marble Procedural Texture from parsed marble procedural texture data\r\n * @param parsedTexture defines parsed texture data\r\n * @param scene defines the current scene\r\n * @param rootUrl defines the root URL containing marble procedural texture information\r\n * @returns a parsed Marble Procedural Texture\r\n */\r\n public static Parse(parsedTexture: any, scene: Scene, rootUrl: string): MarbleProceduralTexture {\r\n const texture = SerializationHelper.Parse(\r\n () => new MarbleProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps),\r\n parsedTexture,\r\n scene,\r\n rootUrl\r\n );\r\n\r\n return texture;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.MarbleProceduralTexture\", MarbleProceduralTexture);\r\n"]}
@@ -1,9 +1,13 @@
1
1
  // Do not edit.
2
2
  import { ShaderStore } from "@babylonjs/core/Engines/shaderStore.js";
3
- var name = "normalMapProceduralTexturePixelShader";
4
- var shader = "precision highp float;uniform sampler2D baseSampler;uniform float size;varying vec2 vUV;const vec3 LUMA_COEFFICIENT=vec3(0.2126,0.7152,0.0722);float lumaAtCoord(vec2 coord)\n{vec3 pixel=texture2D(baseSampler,coord).rgb;float luma=dot(pixel,LUMA_COEFFICIENT);return luma;}\nvoid main()\n{float lumaU0=lumaAtCoord(vUV+vec2(-1.0, 0.0)/size);float lumaU1=lumaAtCoord(vUV+vec2( 1.0, 0.0)/size);float lumaV0=lumaAtCoord(vUV+vec2( 0.0,-1.0)/size);float lumaV1=lumaAtCoord(vUV+vec2( 0.0, 1.0)/size);vec2 slope=(vec2(lumaU0-lumaU1,lumaV0-lumaV1)+1.0)*0.5;gl_FragColor=vec4(slope,1.0,1.0);}\n";
3
+ const name = "normalMapProceduralTexturePixelShader";
4
+ const shader = `precision highp float;uniform sampler2D baseSampler;uniform float size;varying vec2 vUV;const vec3 LUMA_COEFFICIENT=vec3(0.2126,0.7152,0.0722);float lumaAtCoord(vec2 coord)
5
+ {vec3 pixel=texture2D(baseSampler,coord).rgb;float luma=dot(pixel,LUMA_COEFFICIENT);return luma;}
6
+ void main()
7
+ {float lumaU0=lumaAtCoord(vUV+vec2(-1.0, 0.0)/size);float lumaU1=lumaAtCoord(vUV+vec2( 1.0, 0.0)/size);float lumaV0=lumaAtCoord(vUV+vec2( 0.0,-1.0)/size);float lumaV1=lumaAtCoord(vUV+vec2( 0.0, 1.0)/size);vec2 slope=(vec2(lumaU0-lumaU1,lumaV0-lumaV1)+1.0)*0.5;gl_FragColor=vec4(slope,1.0,1.0);}
8
+ `;
5
9
  // Sideeffect
6
10
  ShaderStore.ShadersStore[name] = shader;
7
11
  /** @hidden */
8
- export var normalMapProceduralTexturePixelShader = { name: name, shader: shader };
12
+ export const normalMapProceduralTexturePixelShader = { name, shader };
9
13
  //# sourceMappingURL=normalMapProceduralTexture.fragment.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"normalMapProceduralTexture.fragment.js","sourceRoot":"","sources":["../../../../../lts/proceduralTextures/generated/normalMap/normalMapProceduralTexture.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,+CAAiC;AAEvD,IAAM,IAAI,GAAG,uCAAuC,CAAC;AACrD,IAAM,MAAM,GAAG,wkBAId,CAAC;AACF,aAAa;AACb,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACxC,cAAc;AACd,MAAM,CAAC,IAAM,qCAAqC,GAAG,EAAE,IAAI,MAAA,EAAE,MAAM,QAAA,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"core/Engines/shaderStore\";\n\nconst name = \"normalMapProceduralTexturePixelShader\";\nconst shader = `precision highp float;uniform sampler2D baseSampler;uniform float size;varying vec2 vUV;const vec3 LUMA_COEFFICIENT=vec3(0.2126,0.7152,0.0722);float lumaAtCoord(vec2 coord)\n{vec3 pixel=texture2D(baseSampler,coord).rgb;float luma=dot(pixel,LUMA_COEFFICIENT);return luma;}\nvoid main()\n{float lumaU0=lumaAtCoord(vUV+vec2(-1.0, 0.0)/size);float lumaU1=lumaAtCoord(vUV+vec2( 1.0, 0.0)/size);float lumaV0=lumaAtCoord(vUV+vec2( 0.0,-1.0)/size);float lumaV1=lumaAtCoord(vUV+vec2( 0.0, 1.0)/size);vec2 slope=(vec2(lumaU0-lumaU1,lumaV0-lumaV1)+1.0)*0.5;gl_FragColor=vec4(slope,1.0,1.0);}\n`;\n// Sideeffect\nShaderStore.ShadersStore[name] = shader;\n/** @hidden */\nexport const normalMapProceduralTexturePixelShader = { name, shader };\n"]}
1
+ {"version":3,"file":"normalMapProceduralTexture.fragment.js","sourceRoot":"","sources":["../../../../../lts/proceduralTextures/generated/normalMap/normalMapProceduralTexture.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,+CAAiC;AAEvD,MAAM,IAAI,GAAG,uCAAuC,CAAC;AACrD,MAAM,MAAM,GAAG;;;;CAId,CAAC;AACF,aAAa;AACb,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACxC,cAAc;AACd,MAAM,CAAC,MAAM,qCAAqC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"core/Engines/shaderStore\";\n\nconst name = \"normalMapProceduralTexturePixelShader\";\nconst shader = `precision highp float;uniform sampler2D baseSampler;uniform float size;varying vec2 vUV;const vec3 LUMA_COEFFICIENT=vec3(0.2126,0.7152,0.0722);float lumaAtCoord(vec2 coord)\n{vec3 pixel=texture2D(baseSampler,coord).rgb;float luma=dot(pixel,LUMA_COEFFICIENT);return luma;}\nvoid main()\n{float lumaU0=lumaAtCoord(vUV+vec2(-1.0, 0.0)/size);float lumaU1=lumaAtCoord(vUV+vec2( 1.0, 0.0)/size);float lumaV0=lumaAtCoord(vUV+vec2( 0.0,-1.0)/size);float lumaV1=lumaAtCoord(vUV+vec2( 0.0, 1.0)/size);vec2 slope=(vec2(lumaU0-lumaU1,lumaV0-lumaV1)+1.0)*0.5;gl_FragColor=vec4(slope,1.0,1.0);}\n`;\n// Sideeffect\nShaderStore.ShadersStore[name] = shader;\n/** @hidden */\nexport const normalMapProceduralTexturePixelShader = { name, shader };\n"]}
@@ -1,54 +1,47 @@
1
- import { __decorate, __extends } from "tslib";
1
+ import { __decorate } from "@babylonjs/core/tslib.es6.js";
2
2
  import { serializeAsTexture, SerializationHelper } from "@babylonjs/core/Misc/decorators.js";
3
3
  import { ProceduralTexture } from "@babylonjs/core/Materials/Textures/Procedurals/proceduralTexture.js";
4
4
  import { RegisterClass } from "@babylonjs/core/Misc/typeStore.js";
5
5
  import "./normalMapProceduralTexture.fragment.js";
6
- var NormalMapProceduralTexture = /** @class */ (function (_super) {
7
- __extends(NormalMapProceduralTexture, _super);
8
- function NormalMapProceduralTexture(name, size, scene, fallbackTexture, generateMipMaps) {
9
- if (scene === void 0) { scene = null; }
10
- var _this = _super.call(this, name, size, "normalMapProceduralTexture", scene, fallbackTexture, generateMipMaps) || this;
11
- _this.updateShaderUniforms();
12
- return _this;
6
+ export class NormalMapProceduralTexture extends ProceduralTexture {
7
+ constructor(name, size, scene = null, fallbackTexture, generateMipMaps) {
8
+ super(name, size, "normalMapProceduralTexture", scene, fallbackTexture, generateMipMaps);
9
+ this.updateShaderUniforms();
13
10
  }
14
- NormalMapProceduralTexture.prototype.updateShaderUniforms = function () {
11
+ updateShaderUniforms() {
15
12
  this.setTexture("baseSampler", this._baseTexture);
16
13
  this.setFloat("size", this.getRenderSize());
17
- };
18
- NormalMapProceduralTexture.prototype.render = function (useCameraPostProcess) {
19
- _super.prototype.render.call(this, useCameraPostProcess);
20
- };
21
- NormalMapProceduralTexture.prototype.resize = function (size, generateMipMaps) {
22
- _super.prototype.resize.call(this, size, generateMipMaps);
14
+ }
15
+ render(useCameraPostProcess) {
16
+ super.render(useCameraPostProcess);
17
+ }
18
+ resize(size, generateMipMaps) {
19
+ super.resize(size, generateMipMaps);
23
20
  // We need to update the "size" uniform
24
21
  this.updateShaderUniforms();
25
- };
26
- NormalMapProceduralTexture.prototype.isReady = function () {
22
+ }
23
+ isReady() {
27
24
  if (!this._baseTexture || !this._baseTexture.isReady()) {
28
25
  return false;
29
26
  }
30
- return _super.prototype.isReady.call(this);
31
- };
32
- Object.defineProperty(NormalMapProceduralTexture.prototype, "baseTexture", {
33
- get: function () {
34
- return this._baseTexture;
35
- },
36
- set: function (texture) {
37
- this._baseTexture = texture;
38
- this.updateShaderUniforms();
39
- },
40
- enumerable: false,
41
- configurable: true
42
- });
27
+ return super.isReady();
28
+ }
29
+ get baseTexture() {
30
+ return this._baseTexture;
31
+ }
32
+ set baseTexture(texture) {
33
+ this._baseTexture = texture;
34
+ this.updateShaderUniforms();
35
+ }
43
36
  /**
44
37
  * Serializes this normal map procedural texture
45
38
  * @returns a serialized normal map procedural texture object
46
39
  */
47
- NormalMapProceduralTexture.prototype.serialize = function () {
48
- var serializationObject = SerializationHelper.Serialize(this, _super.prototype.serialize.call(this));
40
+ serialize() {
41
+ const serializationObject = SerializationHelper.Serialize(this, super.serialize());
49
42
  serializationObject.customType = "BABYLON.NormalMapProceduralTexture";
50
43
  return serializationObject;
51
- };
44
+ }
52
45
  /**
53
46
  * Creates a Normal Map Procedural Texture from parsed normal map procedural texture data
54
47
  * @param parsedTexture defines parsed texture data
@@ -56,15 +49,13 @@ var NormalMapProceduralTexture = /** @class */ (function (_super) {
56
49
  * @param rootUrl defines the root URL containing normal map procedural texture information
57
50
  * @returns a parsed Normal Map Procedural Texture
58
51
  */
59
- NormalMapProceduralTexture.Parse = function (parsedTexture, scene, rootUrl) {
60
- var texture = SerializationHelper.Parse(function () { return new NormalMapProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps); }, parsedTexture, scene, rootUrl);
52
+ static Parse(parsedTexture, scene, rootUrl) {
53
+ const texture = SerializationHelper.Parse(() => new NormalMapProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps), parsedTexture, scene, rootUrl);
61
54
  return texture;
62
- };
63
- __decorate([
64
- serializeAsTexture()
65
- ], NormalMapProceduralTexture.prototype, "baseTexture", null);
66
- return NormalMapProceduralTexture;
67
- }(ProceduralTexture));
68
- export { NormalMapProceduralTexture };
55
+ }
56
+ }
57
+ __decorate([
58
+ serializeAsTexture()
59
+ ], NormalMapProceduralTexture.prototype, "baseTexture", null);
69
60
  RegisterClass("BABYLON.NormalMapProceduralTexture", NormalMapProceduralTexture);
70
61
  //# sourceMappingURL=normalMapProceduralTexture.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"normalMapProceduralTexture.js","sourceRoot":"","sources":["../../../../../lts/proceduralTextures/generated/normalMap/normalMapProceduralTexture.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,2CAA6B;AAE/E,OAAO,EAAE,iBAAiB,EAAE,4EAA8D;AAE1F,OAAO,EAAE,aAAa,EAAE,0CAA4B;AAEpD,OAAO,uCAAuC,CAAC;AAE/C;IAAgD,8CAAiB;IAG7D,oCAAY,IAAY,EAAE,IAAY,EAAE,KAA6B,EAAE,eAAyB,EAAE,eAAyB;QAAnF,sBAAA,EAAA,YAA6B;QAArE,YACI,kBAAM,IAAI,EAAE,IAAI,EAAE,4BAA4B,EAAE,KAAK,EAAE,eAAe,EAAE,eAAe,CAAC,SAE3F;QADG,KAAI,CAAC,oBAAoB,EAAE,CAAC;;IAChC,CAAC;IAEM,yDAAoB,GAA3B;QACI,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QAClD,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,aAAa,EAAY,CAAC,CAAC;IAC1D,CAAC;IAEM,2CAAM,GAAb,UAAc,oBAA8B;QACxC,iBAAM,MAAM,YAAC,oBAAoB,CAAC,CAAC;IACvC,CAAC;IAEM,2CAAM,GAAb,UAAc,IAAS,EAAE,eAAoB;QACzC,iBAAM,MAAM,YAAC,IAAI,EAAE,eAAe,CAAC,CAAC;QAEpC,uCAAuC;QACvC,IAAI,CAAC,oBAAoB,EAAE,CAAC;IAChC,CAAC;IAEM,4CAAO,GAAd;QACI,IAAI,CAAC,IAAI,CAAC,YAAY,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,EAAE;YACpD,OAAO,KAAK,CAAC;SAChB;QAED,OAAO,iBAAM,OAAO,WAAE,CAAC;IAC3B,CAAC;IAGD,sBAAW,mDAAW;aAAtB;YACI,OAAO,IAAI,CAAC,YAAY,CAAC;QAC7B,CAAC;aAED,UAAuB,OAAgB;YACnC,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC;YAC5B,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAChC,CAAC;;;OALA;IAOD;;;OAGG;IACI,8CAAS,GAAhB;QACI,IAAM,mBAAmB,GAAG,mBAAmB,CAAC,SAAS,CAAC,IAAI,EAAE,iBAAM,SAAS,WAAE,CAAC,CAAC;QACnF,mBAAmB,CAAC,UAAU,GAAG,oCAAoC,CAAC;QAEtE,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAED;;;;;;OAMG;IACW,gCAAK,GAAnB,UAAoB,aAAkB,EAAE,KAAY,EAAE,OAAe;QACjE,IAAM,OAAO,GAAG,mBAAmB,CAAC,KAAK,CACrC,cAAM,OAAA,IAAI,0BAA0B,CAAC,aAAa,CAAC,IAAI,EAAE,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,aAAa,CAAC,gBAAgB,CAAC,EAAzH,CAAyH,EAC/H,aAAa,EACb,KAAK,EACL,OAAO,CACV,CAAC;QAEF,OAAO,OAAO,CAAC;IACnB,CAAC;IApCD;QADC,kBAAkB,EAAE;iEAGpB;IAmCL,iCAAC;CAAA,AAtED,CAAgD,iBAAiB,GAsEhE;SAtEY,0BAA0B;AAwEvC,aAAa,CAAC,oCAAoC,EAAE,0BAA0B,CAAC,CAAC","sourcesContent":["import { serializeAsTexture, SerializationHelper } from \"core/Misc/decorators\";\r\nimport type { Texture } from \"core/Materials/Textures/texture\";\r\nimport { ProceduralTexture } from \"core/Materials/Textures/Procedurals/proceduralTexture\";\r\nimport type { Scene } from \"core/scene\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport type { Nullable } from \"core/types\";\r\nimport \"./normalMapProceduralTexture.fragment\";\r\n\r\nexport class NormalMapProceduralTexture extends ProceduralTexture {\r\n private _baseTexture: Texture;\r\n\r\n constructor(name: string, size: number, scene: Nullable<Scene> = null, fallbackTexture?: Texture, generateMipMaps?: boolean) {\r\n super(name, size, \"normalMapProceduralTexture\", scene, fallbackTexture, generateMipMaps);\r\n this.updateShaderUniforms();\r\n }\r\n\r\n public updateShaderUniforms() {\r\n this.setTexture(\"baseSampler\", this._baseTexture);\r\n this.setFloat(\"size\", this.getRenderSize() as number);\r\n }\r\n\r\n public render(useCameraPostProcess?: boolean) {\r\n super.render(useCameraPostProcess);\r\n }\r\n\r\n public resize(size: any, generateMipMaps: any): void {\r\n super.resize(size, generateMipMaps);\r\n\r\n // We need to update the \"size\" uniform\r\n this.updateShaderUniforms();\r\n }\r\n\r\n public isReady(): boolean {\r\n if (!this._baseTexture || !this._baseTexture.isReady()) {\r\n return false;\r\n }\r\n\r\n return super.isReady();\r\n }\r\n\r\n @serializeAsTexture()\r\n public get baseTexture(): Texture {\r\n return this._baseTexture;\r\n }\r\n\r\n public set baseTexture(texture: Texture) {\r\n this._baseTexture = texture;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n /**\r\n * Serializes this normal map procedural texture\r\n * @returns a serialized normal map procedural texture object\r\n */\r\n public serialize(): any {\r\n const serializationObject = SerializationHelper.Serialize(this, super.serialize());\r\n serializationObject.customType = \"BABYLON.NormalMapProceduralTexture\";\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Creates a Normal Map Procedural Texture from parsed normal map procedural texture data\r\n * @param parsedTexture defines parsed texture data\r\n * @param scene defines the current scene\r\n * @param rootUrl defines the root URL containing normal map procedural texture information\r\n * @returns a parsed Normal Map Procedural Texture\r\n */\r\n public static Parse(parsedTexture: any, scene: Scene, rootUrl: string): NormalMapProceduralTexture {\r\n const texture = SerializationHelper.Parse(\r\n () => new NormalMapProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps),\r\n parsedTexture,\r\n scene,\r\n rootUrl\r\n );\r\n\r\n return texture;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NormalMapProceduralTexture\", NormalMapProceduralTexture);\r\n"]}
1
+ {"version":3,"file":"normalMapProceduralTexture.js","sourceRoot":"","sources":["../../../../../lts/proceduralTextures/generated/normalMap/normalMapProceduralTexture.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,2CAA6B;AAE/E,OAAO,EAAE,iBAAiB,EAAE,4EAA8D;AAE1F,OAAO,EAAE,aAAa,EAAE,0CAA4B;AAEpD,OAAO,uCAAuC,CAAC;AAE/C,MAAM,OAAO,0BAA2B,SAAQ,iBAAiB;IAG7D,YAAY,IAAY,EAAE,IAAY,EAAE,QAAyB,IAAI,EAAE,eAAyB,EAAE,eAAyB;QACvH,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,4BAA4B,EAAE,KAAK,EAAE,eAAe,EAAE,eAAe,CAAC,CAAC;QACzF,IAAI,CAAC,oBAAoB,EAAE,CAAC;IAChC,CAAC;IAEM,oBAAoB;QACvB,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QAClD,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,aAAa,EAAY,CAAC,CAAC;IAC1D,CAAC;IAEM,MAAM,CAAC,oBAA8B;QACxC,KAAK,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC;IACvC,CAAC;IAEM,MAAM,CAAC,IAAS,EAAE,eAAoB;QACzC,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;QAEpC,uCAAuC;QACvC,IAAI,CAAC,oBAAoB,EAAE,CAAC;IAChC,CAAC;IAEM,OAAO;QACV,IAAI,CAAC,IAAI,CAAC,YAAY,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,EAAE;YACpD,OAAO,KAAK,CAAC;SAChB;QAED,OAAO,KAAK,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAGD,IAAW,WAAW;QAClB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC7B,CAAC;IAED,IAAW,WAAW,CAAC,OAAgB;QACnC,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC;QAC5B,IAAI,CAAC,oBAAoB,EAAE,CAAC;IAChC,CAAC;IAED;;;OAGG;IACI,SAAS;QACZ,MAAM,mBAAmB,GAAG,mBAAmB,CAAC,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC;QACnF,mBAAmB,CAAC,UAAU,GAAG,oCAAoC,CAAC;QAEtE,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAED;;;;;;OAMG;IACI,MAAM,CAAC,KAAK,CAAC,aAAkB,EAAE,KAAY,EAAE,OAAe;QACjE,MAAM,OAAO,GAAG,mBAAmB,CAAC,KAAK,CACrC,GAAG,EAAE,CAAC,IAAI,0BAA0B,CAAC,aAAa,CAAC,IAAI,EAAE,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,aAAa,CAAC,gBAAgB,CAAC,EAC/H,aAAa,EACb,KAAK,EACL,OAAO,CACV,CAAC;QAEF,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ;AArCG;IADC,kBAAkB,EAAE;6DAGpB;AAqCL,aAAa,CAAC,oCAAoC,EAAE,0BAA0B,CAAC,CAAC","sourcesContent":["import { serializeAsTexture, SerializationHelper } from \"core/Misc/decorators\";\r\nimport type { Texture } from \"core/Materials/Textures/texture\";\r\nimport { ProceduralTexture } from \"core/Materials/Textures/Procedurals/proceduralTexture\";\r\nimport type { Scene } from \"core/scene\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport type { Nullable } from \"core/types\";\r\nimport \"./normalMapProceduralTexture.fragment\";\r\n\r\nexport class NormalMapProceduralTexture extends ProceduralTexture {\r\n private _baseTexture: Texture;\r\n\r\n constructor(name: string, size: number, scene: Nullable<Scene> = null, fallbackTexture?: Texture, generateMipMaps?: boolean) {\r\n super(name, size, \"normalMapProceduralTexture\", scene, fallbackTexture, generateMipMaps);\r\n this.updateShaderUniforms();\r\n }\r\n\r\n public updateShaderUniforms() {\r\n this.setTexture(\"baseSampler\", this._baseTexture);\r\n this.setFloat(\"size\", this.getRenderSize() as number);\r\n }\r\n\r\n public render(useCameraPostProcess?: boolean) {\r\n super.render(useCameraPostProcess);\r\n }\r\n\r\n public resize(size: any, generateMipMaps: any): void {\r\n super.resize(size, generateMipMaps);\r\n\r\n // We need to update the \"size\" uniform\r\n this.updateShaderUniforms();\r\n }\r\n\r\n public isReady(): boolean {\r\n if (!this._baseTexture || !this._baseTexture.isReady()) {\r\n return false;\r\n }\r\n\r\n return super.isReady();\r\n }\r\n\r\n @serializeAsTexture()\r\n public get baseTexture(): Texture {\r\n return this._baseTexture;\r\n }\r\n\r\n public set baseTexture(texture: Texture) {\r\n this._baseTexture = texture;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n /**\r\n * Serializes this normal map procedural texture\r\n * @returns a serialized normal map procedural texture object\r\n */\r\n public serialize(): any {\r\n const serializationObject = SerializationHelper.Serialize(this, super.serialize());\r\n serializationObject.customType = \"BABYLON.NormalMapProceduralTexture\";\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Creates a Normal Map Procedural Texture from parsed normal map procedural texture data\r\n * @param parsedTexture defines parsed texture data\r\n * @param scene defines the current scene\r\n * @param rootUrl defines the root URL containing normal map procedural texture information\r\n * @returns a parsed Normal Map Procedural Texture\r\n */\r\n public static Parse(parsedTexture: any, scene: Scene, rootUrl: string): NormalMapProceduralTexture {\r\n const texture = SerializationHelper.Parse(\r\n () => new NormalMapProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps),\r\n parsedTexture,\r\n scene,\r\n rootUrl\r\n );\r\n\r\n return texture;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NormalMapProceduralTexture\", NormalMapProceduralTexture);\r\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babylonjs/procedural-textures",
3
- "version": "5.19.0",
3
+ "version": "5.22.0",
4
4
  "main": "index.js",
5
5
  "module": "index.js",
6
6
  "types": "index.d.ts",
@@ -18,11 +18,8 @@
18
18
  "postcompile": "build-tools -c add-js-to-es6",
19
19
  "prepublishOnly": "build-tools -c prepare-es6-build"
20
20
  },
21
- "dependencies": {
22
- "tslib": "^2.4.0"
23
- },
24
21
  "devDependencies": {
25
- "@babylonjs/core": "^5.19.0",
22
+ "@babylonjs/core": "^5.22.0",
26
23
  "@dev/build-tools": "^1.0.0",
27
24
  "@lts/procedural-textures": "^1.0.0",
28
25
  "rimraf": "^3.0.2",
@@ -1,9 +1,47 @@
1
1
  // Do not edit.
2
2
  import { ShaderStore } from "@babylonjs/core/Engines/shaderStore.js";
3
- var name = "perlinNoiseProceduralTexturePixelShader";
4
- var shader = "precision highp float;uniform float size;uniform float time;uniform float translationSpeed;varying vec2 vUV;float r(float n)\n{return fract(cos(n*89.42)*343.42);}\nvec2 r(vec2 n)\n{return vec2(r(n.x*23.62-300.0+n.y*34.35),r(n.x*45.13+256.0+n.y*38.89)); }\nfloat worley(vec2 n,float s)\n{float dis=1.0;for(int x=-1; x<=1; x++)\n{for(int y=-1; y<=1; y++)\n{vec2 p=floor(n/s)+vec2(x,y);float d=length(r(p)+vec2(x,y)-fract(n/s));if (dis>d)\ndis=d;}}\nreturn 1.0-dis;}\nvec3 hash33(vec3 p3)\n{p3=fract(p3*vec3(0.1031,0.11369,0.13787));p3+=dot(p3,p3.yxz+19.19);return -1.0+2.0*fract(vec3((p3.x+p3.y)*p3.z,(p3.x+p3.z)*p3.y,(p3.y+p3.z)*p3.x));}\nfloat perlinNoise(vec3 p)\n{vec3 pi=floor(p);vec3 pf=p-pi;vec3 w=pf*pf*(3.0-2.0*pf);return mix(\nmix(\nmix(\ndot(pf-vec3(0,0,0),hash33(pi+vec3(0,0,0))),\ndot(pf-vec3(1,0,0),hash33(pi+vec3(1,0,0))),w.x\n),mix(\ndot(pf-vec3(0,0,1),hash33(pi+vec3(0,0,1))),\ndot(pf-vec3(1,0,1),hash33(pi+vec3(1,0,1))),w.x\n),w.z\n),mix(\nmix(\ndot(pf-vec3(0,1,0),hash33(pi+vec3(0,1,0))),\ndot(pf-vec3(1,1,0),hash33(pi+vec3(1,1,0))),w.x\n),mix(\ndot(pf-vec3(0,1,1),hash33(pi+vec3(0,1,1))),\ndot(pf-vec3(1,1,1),hash33(pi+vec3(1,1,1))),w.x\n),w.z\n),w.y\n);}\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void)\n{vec2 uv=gl_FragCoord.xy+translationSpeed;float dis=(\n1.0+perlinNoise(vec3(uv/vec2(size,size),time*0.05)*8.0))\n* (1.0+(worley(uv,32.0)+ 0.5*worley(2.0*uv,32.0)+0.25*worley(4.0*uv,32.0))\n);gl_FragColor=vec4(vec3(dis/4.0),1.0);}\n";
3
+ const name = "perlinNoiseProceduralTexturePixelShader";
4
+ const shader = `precision highp float;uniform float size;uniform float time;uniform float translationSpeed;varying vec2 vUV;float r(float n)
5
+ {return fract(cos(n*89.42)*343.42);}
6
+ vec2 r(vec2 n)
7
+ {return vec2(r(n.x*23.62-300.0+n.y*34.35),r(n.x*45.13+256.0+n.y*38.89)); }
8
+ float worley(vec2 n,float s)
9
+ {float dis=1.0;for(int x=-1; x<=1; x++)
10
+ {for(int y=-1; y<=1; y++)
11
+ {vec2 p=floor(n/s)+vec2(x,y);float d=length(r(p)+vec2(x,y)-fract(n/s));if (dis>d)
12
+ dis=d;}}
13
+ return 1.0-dis;}
14
+ vec3 hash33(vec3 p3)
15
+ {p3=fract(p3*vec3(0.1031,0.11369,0.13787));p3+=dot(p3,p3.yxz+19.19);return -1.0+2.0*fract(vec3((p3.x+p3.y)*p3.z,(p3.x+p3.z)*p3.y,(p3.y+p3.z)*p3.x));}
16
+ float perlinNoise(vec3 p)
17
+ {vec3 pi=floor(p);vec3 pf=p-pi;vec3 w=pf*pf*(3.0-2.0*pf);return mix(
18
+ mix(
19
+ mix(
20
+ dot(pf-vec3(0,0,0),hash33(pi+vec3(0,0,0))),
21
+ dot(pf-vec3(1,0,0),hash33(pi+vec3(1,0,0))),w.x
22
+ ),mix(
23
+ dot(pf-vec3(0,0,1),hash33(pi+vec3(0,0,1))),
24
+ dot(pf-vec3(1,0,1),hash33(pi+vec3(1,0,1))),w.x
25
+ ),w.z
26
+ ),mix(
27
+ mix(
28
+ dot(pf-vec3(0,1,0),hash33(pi+vec3(0,1,0))),
29
+ dot(pf-vec3(1,1,0),hash33(pi+vec3(1,1,0))),w.x
30
+ ),mix(
31
+ dot(pf-vec3(0,1,1),hash33(pi+vec3(0,1,1))),
32
+ dot(pf-vec3(1,1,1),hash33(pi+vec3(1,1,1))),w.x
33
+ ),w.z
34
+ ),w.y
35
+ );}
36
+ #define CUSTOM_FRAGMENT_DEFINITIONS
37
+ void main(void)
38
+ {vec2 uv=gl_FragCoord.xy+translationSpeed;float dis=(
39
+ 1.0+perlinNoise(vec3(uv/vec2(size,size),time*0.05)*8.0))
40
+ * (1.0+(worley(uv,32.0)+ 0.5*worley(2.0*uv,32.0)+0.25*worley(4.0*uv,32.0))
41
+ );gl_FragColor=vec4(vec3(dis/4.0),1.0);}
42
+ `;
5
43
  // Sideeffect
6
44
  ShaderStore.ShadersStore[name] = shader;
7
45
  /** @hidden */
8
- export var perlinNoiseProceduralTexturePixelShader = { name: name, shader: shader };
46
+ export const perlinNoiseProceduralTexturePixelShader = { name, shader };
9
47
  //# sourceMappingURL=perlinNoiseProceduralTexture.fragment.js.map