@babylonjs/procedural-textures 5.0.0-beta.9 → 5.0.0-rc.10

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 (128) hide show
  1. package/brick/brickProceduralTexture.d.ts +35 -35
  2. package/brick/brickProceduralTexture.fragment.d.ts +5 -5
  3. package/brick/brickProceduralTexture.fragment.js +8 -6
  4. package/brick/brickProceduralTexture.fragment.js.map +1 -1
  5. package/brick/brickProceduralTexture.js +104 -104
  6. package/brick/brickProceduralTexture.js.map +1 -1
  7. package/brick/index.d.ts +1 -1
  8. package/brick/index.js +1 -1
  9. package/brick/index.js.map +1 -1
  10. package/cloud/cloudProceduralTexture.d.ts +35 -35
  11. package/cloud/cloudProceduralTexture.fragment.d.ts +5 -5
  12. package/cloud/cloudProceduralTexture.fragment.js +8 -6
  13. package/cloud/cloudProceduralTexture.fragment.js.map +1 -1
  14. package/cloud/cloudProceduralTexture.js +104 -104
  15. package/cloud/cloudProceduralTexture.js.map +1 -1
  16. package/cloud/index.d.ts +1 -1
  17. package/cloud/index.js +1 -1
  18. package/cloud/index.js.map +1 -1
  19. package/fire/fireProceduralTexture.d.ts +44 -44
  20. package/fire/fireProceduralTexture.fragment.d.ts +5 -5
  21. package/fire/fireProceduralTexture.fragment.js +8 -6
  22. package/fire/fireProceduralTexture.fragment.js.map +1 -1
  23. package/fire/fireProceduralTexture.js +166 -194
  24. package/fire/fireProceduralTexture.js.map +1 -1
  25. package/fire/index.d.ts +1 -1
  26. package/fire/index.js +1 -1
  27. package/fire/index.js.map +1 -1
  28. package/grass/grassProceduralTexture.d.ts +29 -29
  29. package/grass/grassProceduralTexture.fragment.d.ts +5 -5
  30. package/grass/grassProceduralTexture.fragment.js +8 -6
  31. package/grass/grassProceduralTexture.fragment.js.map +1 -1
  32. package/grass/grassProceduralTexture.js +80 -84
  33. package/grass/grassProceduralTexture.js.map +1 -1
  34. package/grass/index.d.ts +1 -1
  35. package/grass/index.js +1 -1
  36. package/grass/index.js.map +1 -1
  37. package/index.d.ts +10 -10
  38. package/index.js +11 -10
  39. package/index.js.map +1 -1
  40. package/legacy/legacy-brick.d.ts +1 -1
  41. package/legacy/legacy-brick.js +13 -12
  42. package/legacy/legacy-brick.js.map +1 -1
  43. package/legacy/legacy-cloud.d.ts +1 -1
  44. package/legacy/legacy-cloud.js +13 -12
  45. package/legacy/legacy-cloud.js.map +1 -1
  46. package/legacy/legacy-fire.d.ts +1 -1
  47. package/legacy/legacy-fire.js +13 -12
  48. package/legacy/legacy-fire.js.map +1 -1
  49. package/legacy/legacy-grass.d.ts +1 -1
  50. package/legacy/legacy-grass.js +13 -12
  51. package/legacy/legacy-grass.js.map +1 -1
  52. package/legacy/legacy-marble.d.ts +1 -1
  53. package/legacy/legacy-marble.js +13 -12
  54. package/legacy/legacy-marble.js.map +1 -1
  55. package/legacy/legacy-normalMap.d.ts +1 -1
  56. package/legacy/legacy-normalMap.js +13 -12
  57. package/legacy/legacy-normalMap.js.map +1 -1
  58. package/legacy/legacy-perlinNoise.d.ts +1 -1
  59. package/legacy/legacy-perlinNoise.js +13 -12
  60. package/legacy/legacy-perlinNoise.js.map +1 -1
  61. package/legacy/legacy-road.d.ts +1 -1
  62. package/legacy/legacy-road.js +13 -12
  63. package/legacy/legacy-road.js.map +1 -1
  64. package/legacy/legacy-starfield.d.ts +1 -1
  65. package/legacy/legacy-starfield.js +13 -12
  66. package/legacy/legacy-starfield.js.map +1 -1
  67. package/legacy/legacy-wood.d.ts +1 -1
  68. package/legacy/legacy-wood.js +13 -12
  69. package/legacy/legacy-wood.js.map +1 -1
  70. package/legacy/legacy.d.ts +1 -1
  71. package/legacy/legacy.js +16 -15
  72. package/legacy/legacy.js.map +1 -1
  73. package/marble/index.d.ts +1 -1
  74. package/marble/index.js +1 -1
  75. package/marble/index.js.map +1 -1
  76. package/marble/marbleProceduralTexture.d.ts +35 -35
  77. package/marble/marbleProceduralTexture.fragment.d.ts +5 -5
  78. package/marble/marbleProceduralTexture.fragment.js +8 -6
  79. package/marble/marbleProceduralTexture.fragment.js.map +1 -1
  80. package/marble/marbleProceduralTexture.js +104 -104
  81. package/marble/marbleProceduralTexture.js.map +1 -1
  82. package/normalMap/index.d.ts +1 -1
  83. package/normalMap/index.js +1 -1
  84. package/normalMap/index.js.map +1 -1
  85. package/normalMap/normalMapProceduralTexture.d.ts +28 -28
  86. package/normalMap/normalMapProceduralTexture.fragment.d.ts +5 -5
  87. package/normalMap/normalMapProceduralTexture.fragment.js +8 -6
  88. package/normalMap/normalMapProceduralTexture.fragment.js.map +1 -1
  89. package/normalMap/normalMapProceduralTexture.js +69 -69
  90. package/normalMap/normalMapProceduralTexture.js.map +1 -1
  91. package/package.json +22 -152
  92. package/perlinNoise/index.d.ts +1 -1
  93. package/perlinNoise/index.js +1 -1
  94. package/perlinNoise/index.js.map +1 -1
  95. package/perlinNoise/perlinNoiseProceduralTexture.d.ts +28 -28
  96. package/perlinNoise/perlinNoiseProceduralTexture.fragment.d.ts +5 -5
  97. package/perlinNoise/perlinNoiseProceduralTexture.fragment.js +8 -6
  98. package/perlinNoise/perlinNoiseProceduralTexture.fragment.js.map +1 -1
  99. package/perlinNoise/perlinNoiseProceduralTexture.js +69 -69
  100. package/perlinNoise/perlinNoiseProceduralTexture.js.map +1 -1
  101. package/readme.md +2 -2
  102. package/road/index.d.ts +1 -1
  103. package/road/index.js +1 -1
  104. package/road/index.js.map +1 -1
  105. package/road/roadProceduralTexture.d.ts +26 -26
  106. package/road/roadProceduralTexture.fragment.d.ts +5 -5
  107. package/road/roadProceduralTexture.fragment.js +8 -6
  108. package/road/roadProceduralTexture.fragment.js.map +1 -1
  109. package/road/roadProceduralTexture.js +56 -56
  110. package/road/roadProceduralTexture.js.map +1 -1
  111. package/starfield/index.d.ts +1 -1
  112. package/starfield/index.js +1 -1
  113. package/starfield/index.js.map +1 -1
  114. package/starfield/starfieldProceduralTexture.d.ts +55 -55
  115. package/starfield/starfieldProceduralTexture.fragment.d.ts +5 -5
  116. package/starfield/starfieldProceduralTexture.fragment.js +8 -6
  117. package/starfield/starfieldProceduralTexture.fragment.js.map +1 -1
  118. package/starfield/starfieldProceduralTexture.js +215 -215
  119. package/starfield/starfieldProceduralTexture.js.map +1 -1
  120. package/wood/index.d.ts +1 -1
  121. package/wood/index.js +1 -1
  122. package/wood/index.js.map +1 -1
  123. package/wood/woodProceduralTexture.d.ts +29 -29
  124. package/wood/woodProceduralTexture.fragment.d.ts +5 -5
  125. package/wood/woodProceduralTexture.fragment.js +8 -6
  126. package/wood/woodProceduralTexture.fragment.js.map +1 -1
  127. package/wood/woodProceduralTexture.js +72 -72
  128. package/wood/woodProceduralTexture.js.map +1 -1
@@ -1,70 +1,70 @@
1
- import { __decorate, __extends } from "tslib";
2
- import { serialize, SerializationHelper } from "@babylonjs/core/Misc/decorators.js";
3
- import { ProceduralTexture } from "@babylonjs/core/Materials/Textures/Procedurals/proceduralTexture.js";
4
- import { RegisterClass } from '@babylonjs/core/Misc/typeStore.js';
5
- import "./perlinNoiseProceduralTexture.fragment.js";
6
- var PerlinNoiseProceduralTexture = /** @class */ (function (_super) {
7
- __extends(PerlinNoiseProceduralTexture, _super);
8
- function PerlinNoiseProceduralTexture(name, size, scene, fallbackTexture, generateMipMaps) {
9
- if (scene === void 0) { scene = null; }
10
- var _this = _super.call(this, name, size, "perlinNoiseProceduralTexture", scene, fallbackTexture, generateMipMaps) || this;
11
- _this.time = 0.0;
12
- _this.timeScale = 1.0;
13
- _this.translationSpeed = 1.0;
14
- _this._currentTranslation = 0;
15
- _this.updateShaderUniforms();
16
- return _this;
17
- }
18
- PerlinNoiseProceduralTexture.prototype.updateShaderUniforms = function () {
19
- this.setFloat("size", this.getRenderSize());
20
- var scene = this.getScene();
21
- if (!scene) {
22
- return;
23
- }
24
- var deltaTime = scene.getEngine().getDeltaTime();
25
- this.time += deltaTime;
26
- this.setFloat("time", this.time * this.timeScale / 1000);
27
- this._currentTranslation += deltaTime * this.translationSpeed / 1000.0;
28
- this.setFloat("translationSpeed", this._currentTranslation);
29
- };
30
- PerlinNoiseProceduralTexture.prototype.render = function (useCameraPostProcess) {
31
- this.updateShaderUniforms();
32
- _super.prototype.render.call(this, useCameraPostProcess);
33
- };
34
- PerlinNoiseProceduralTexture.prototype.resize = function (size, generateMipMaps) {
35
- _super.prototype.resize.call(this, size, generateMipMaps);
36
- };
37
- /**
38
- * Serializes this perlin noise procedural texture
39
- * @returns a serialized perlin noise procedural texture object
40
- */
41
- PerlinNoiseProceduralTexture.prototype.serialize = function () {
42
- var serializationObject = SerializationHelper.Serialize(this, _super.prototype.serialize.call(this));
43
- serializationObject.customType = "BABYLON.PerlinNoiseProceduralTexture";
44
- return serializationObject;
45
- };
46
- /**
47
- * Creates a Perlin Noise Procedural Texture from parsed perlin noise procedural texture data
48
- * @param parsedTexture defines parsed texture data
49
- * @param scene defines the current scene
50
- * @param rootUrl defines the root URL containing perlin noise procedural texture information
51
- * @returns a parsed Perlin Noise Procedural Texture
52
- */
53
- PerlinNoiseProceduralTexture.Parse = function (parsedTexture, scene, rootUrl) {
54
- var texture = SerializationHelper.Parse(function () { return new PerlinNoiseProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps); }, parsedTexture, scene, rootUrl);
55
- return texture;
56
- };
57
- __decorate([
58
- serialize()
59
- ], PerlinNoiseProceduralTexture.prototype, "time", void 0);
60
- __decorate([
61
- serialize()
62
- ], PerlinNoiseProceduralTexture.prototype, "timeScale", void 0);
63
- __decorate([
64
- serialize()
65
- ], PerlinNoiseProceduralTexture.prototype, "translationSpeed", void 0);
66
- return PerlinNoiseProceduralTexture;
67
- }(ProceduralTexture));
68
- export { PerlinNoiseProceduralTexture };
69
- RegisterClass("BABYLON.PerlinNoiseProceduralTexture", PerlinNoiseProceduralTexture);
1
+ import { __decorate, __extends } from "tslib";
2
+ import { serialize, SerializationHelper } from "@babylonjs/core/Misc/decorators.js";
3
+ import { ProceduralTexture } from "@babylonjs/core/Materials/Textures/Procedurals/proceduralTexture.js";
4
+ import { RegisterClass } from "@babylonjs/core/Misc/typeStore.js";
5
+ import "./perlinNoiseProceduralTexture.fragment";
6
+ var PerlinNoiseProceduralTexture = /** @class */ (function (_super) {
7
+ __extends(PerlinNoiseProceduralTexture, _super);
8
+ function PerlinNoiseProceduralTexture(name, size, scene, fallbackTexture, generateMipMaps) {
9
+ if (scene === void 0) { scene = null; }
10
+ var _this = _super.call(this, name, size, "perlinNoiseProceduralTexture", scene, fallbackTexture, generateMipMaps) || this;
11
+ _this.time = 0.0;
12
+ _this.timeScale = 1.0;
13
+ _this.translationSpeed = 1.0;
14
+ _this._currentTranslation = 0;
15
+ _this.updateShaderUniforms();
16
+ return _this;
17
+ }
18
+ PerlinNoiseProceduralTexture.prototype.updateShaderUniforms = function () {
19
+ this.setFloat("size", this.getRenderSize());
20
+ var scene = this.getScene();
21
+ if (!scene) {
22
+ return;
23
+ }
24
+ var deltaTime = scene.getEngine().getDeltaTime();
25
+ this.time += deltaTime;
26
+ this.setFloat("time", (this.time * this.timeScale) / 1000);
27
+ this._currentTranslation += (deltaTime * this.translationSpeed) / 1000.0;
28
+ this.setFloat("translationSpeed", this._currentTranslation);
29
+ };
30
+ PerlinNoiseProceduralTexture.prototype.render = function (useCameraPostProcess) {
31
+ this.updateShaderUniforms();
32
+ _super.prototype.render.call(this, useCameraPostProcess);
33
+ };
34
+ PerlinNoiseProceduralTexture.prototype.resize = function (size, generateMipMaps) {
35
+ _super.prototype.resize.call(this, size, generateMipMaps);
36
+ };
37
+ /**
38
+ * Serializes this perlin noise procedural texture
39
+ * @returns a serialized perlin noise procedural texture object
40
+ */
41
+ PerlinNoiseProceduralTexture.prototype.serialize = function () {
42
+ var serializationObject = SerializationHelper.Serialize(this, _super.prototype.serialize.call(this));
43
+ serializationObject.customType = "BABYLON.PerlinNoiseProceduralTexture";
44
+ return serializationObject;
45
+ };
46
+ /**
47
+ * Creates a Perlin Noise Procedural Texture from parsed perlin noise procedural texture data
48
+ * @param parsedTexture defines parsed texture data
49
+ * @param scene defines the current scene
50
+ * @param rootUrl defines the root URL containing perlin noise procedural texture information
51
+ * @returns a parsed Perlin Noise Procedural Texture
52
+ */
53
+ PerlinNoiseProceduralTexture.Parse = function (parsedTexture, scene, rootUrl) {
54
+ var texture = SerializationHelper.Parse(function () { return new PerlinNoiseProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps); }, parsedTexture, scene, rootUrl);
55
+ return texture;
56
+ };
57
+ __decorate([
58
+ serialize()
59
+ ], PerlinNoiseProceduralTexture.prototype, "time", void 0);
60
+ __decorate([
61
+ serialize()
62
+ ], PerlinNoiseProceduralTexture.prototype, "timeScale", void 0);
63
+ __decorate([
64
+ serialize()
65
+ ], PerlinNoiseProceduralTexture.prototype, "translationSpeed", void 0);
66
+ return PerlinNoiseProceduralTexture;
67
+ }(ProceduralTexture));
68
+ export { PerlinNoiseProceduralTexture };
69
+ RegisterClass("BABYLON.PerlinNoiseProceduralTexture", PerlinNoiseProceduralTexture);
70
70
  //# sourceMappingURL=perlinNoiseProceduralTexture.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"perlinNoiseProceduralTexture.js","sourceRoot":"","sources":["../../../sourceES6/proceduralTexturesLibrary/src/perlinNoise/perlinNoiseProceduralTexture.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAEjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,kEAAkE,CAAC;AAErG,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAE/D,OAAO,yCAAyC,CAAC;AAEjD;IAAkD,gDAAiB;IAY/D,sCAAY,IAAY,EAAE,IAAY,EAAE,KAA6B,EAAE,eAAyB,EAAE,eAAyB;QAAnF,sBAAA,EAAA,YAA6B;QAArE,YACI,kBAAM,IAAI,EAAE,IAAI,EAAE,8BAA8B,EAAE,KAAK,EAAE,eAAe,EAAE,eAAe,CAAC,SAE7F;QAbM,UAAI,GAAW,GAAG,CAAC;QAGnB,eAAS,GAAW,GAAG,CAAC;QAGxB,sBAAgB,GAAW,GAAG,CAAC;QAE9B,yBAAmB,GAAW,CAAC,CAAC;QAIpC,KAAI,CAAC,oBAAoB,EAAE,CAAC;;IAChC,CAAC;IAEM,2DAAoB,GAA3B;QACI,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,aAAa,EAAY,CAAC,CAAC;QAEtD,IAAI,KAAK,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;QAE5B,IAAI,CAAC,KAAK,EAAE;YACR,OAAO;SACV;QACD,IAAI,SAAS,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC,YAAY,EAAE,CAAC;QAEjD,IAAI,CAAC,IAAI,IAAI,SAAS,CAAC;QACvB,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC;QAEzD,IAAI,CAAC,mBAAmB,IAAI,SAAS,GAAG,IAAI,CAAC,gBAAgB,GAAG,MAAM,CAAC;QACvE,IAAI,CAAC,QAAQ,CAAC,kBAAkB,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;IAChE,CAAC;IAEM,6CAAM,GAAb,UAAc,oBAA8B;QACxC,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAC5B,iBAAM,MAAM,YAAC,oBAAoB,CAAC,CAAC;IACvC,CAAC;IAEM,6CAAM,GAAb,UAAc,IAAS,EAAE,eAAoB;QACzC,iBAAM,MAAM,YAAC,IAAI,EAAE,eAAe,CAAC,CAAC;IACxC,CAAC;IAED;;;OAGG;IACI,gDAAS,GAAhB;QACI,IAAI,mBAAmB,GAAG,mBAAmB,CAAC,SAAS,CAAC,IAAI,EAAE,iBAAM,SAAS,WAAE,CAAC,CAAC;QACjF,mBAAmB,CAAC,UAAU,GAAG,sCAAsC,CAAC;QAExE,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAED;;;;;;OAMG;IACW,kCAAK,GAAnB,UAAoB,aAAkB,EAAE,KAAY,EAAE,OAAe;QACjE,IAAI,OAAO,GAAG,mBAAmB,CAAC,KAAK,CAAC,cAAM,OAAA,IAAI,4BAA4B,CAAC,aAAa,CAAC,IAAI,EAAE,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,aAAa,CAAC,gBAAgB,CAAC,EAA3H,CAA2H,EAAE,aAAa,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;QAE1M,OAAO,OAAO,CAAC;IACnB,CAAC;IA/DD;QADC,SAAS,EAAE;8DACc;IAG1B;QADC,SAAS,EAAE;mEACmB;IAG/B;QADC,SAAS,EAAE;0EAC0B;IA0D1C,mCAAC;CAAA,AAlED,CAAkD,iBAAiB,GAkElE;SAlEY,4BAA4B;AAoEzC,aAAa,CAAC,sCAAsC,EAAE,4BAA4B,CAAC,CAAC","sourcesContent":["import { serialize, SerializationHelper } from \"@babylonjs/core/Misc/decorators\";\nimport { Texture } from \"@babylonjs/core/Materials/Textures/texture\";\nimport { ProceduralTexture } from \"@babylonjs/core/Materials/Textures/Procedurals/proceduralTexture\";\nimport { Scene } from \"@babylonjs/core/scene\";\nimport { RegisterClass } from '@babylonjs/core/Misc/typeStore';\nimport { Nullable } from \"@babylonjs/core/types\";\nimport \"./perlinNoiseProceduralTexture.fragment\";\n\nexport class PerlinNoiseProceduralTexture extends ProceduralTexture {\n @serialize()\n public time: number = 0.0;\n\n @serialize()\n public timeScale: number = 1.0;\n\n @serialize()\n public translationSpeed: number = 1.0;\n\n private _currentTranslation: number = 0;\n\n constructor(name: string, size: number, scene: Nullable<Scene> = null, fallbackTexture?: Texture, generateMipMaps?: boolean) {\n super(name, size, \"perlinNoiseProceduralTexture\", scene, fallbackTexture, generateMipMaps);\n this.updateShaderUniforms();\n }\n\n public updateShaderUniforms() {\n this.setFloat(\"size\", this.getRenderSize() as number);\n\n let scene = this.getScene();\n\n if (!scene) {\n return;\n }\n var deltaTime = scene.getEngine().getDeltaTime();\n\n this.time += deltaTime;\n this.setFloat(\"time\", this.time * this.timeScale / 1000);\n\n this._currentTranslation += deltaTime * this.translationSpeed / 1000.0;\n this.setFloat(\"translationSpeed\", this._currentTranslation);\n }\n\n public render(useCameraPostProcess?: boolean) {\n this.updateShaderUniforms();\n super.render(useCameraPostProcess);\n }\n\n public resize(size: any, generateMipMaps: any): void {\n super.resize(size, generateMipMaps);\n }\n\n /**\n * Serializes this perlin noise procedural texture\n * @returns a serialized perlin noise procedural texture object\n */\n public serialize(): any {\n var serializationObject = SerializationHelper.Serialize(this, super.serialize());\n serializationObject.customType = \"BABYLON.PerlinNoiseProceduralTexture\";\n\n return serializationObject;\n }\n\n /**\n * Creates a Perlin Noise Procedural Texture from parsed perlin noise procedural texture data\n * @param parsedTexture defines parsed texture data\n * @param scene defines the current scene\n * @param rootUrl defines the root URL containing perlin noise procedural texture information\n * @returns a parsed Perlin Noise Procedural Texture\n */\n public static Parse(parsedTexture: any, scene: Scene, rootUrl: string): PerlinNoiseProceduralTexture {\n var texture = SerializationHelper.Parse(() => new PerlinNoiseProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps), parsedTexture, scene, rootUrl);\n\n return texture;\n }\n}\n\nRegisterClass(\"BABYLON.PerlinNoiseProceduralTexture\", PerlinNoiseProceduralTexture);"]}
1
+ {"version":3,"file":"perlinNoiseProceduralTexture.js","sourceRoot":"","sources":["../../../../../lts/proceduralTextures/generated/perlinNoise/perlinNoiseProceduralTexture.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,2CAA6B;AAEtE,OAAO,EAAE,iBAAiB,EAAE,4EAA8D;AAE1F,OAAO,EAAE,aAAa,EAAE,0CAA4B;AAEpD,OAAO,yCAAyC,CAAC;AAEjD;IAAkD,gDAAiB;IAY/D,sCAAY,IAAY,EAAE,IAAY,EAAE,KAA6B,EAAE,eAAyB,EAAE,eAAyB;QAAnF,sBAAA,EAAA,YAA6B;QAArE,YACI,kBAAM,IAAI,EAAE,IAAI,EAAE,8BAA8B,EAAE,KAAK,EAAE,eAAe,EAAE,eAAe,CAAC,SAE7F;QAbM,UAAI,GAAW,GAAG,CAAC;QAGnB,eAAS,GAAW,GAAG,CAAC;QAGxB,sBAAgB,GAAW,GAAG,CAAC;QAE9B,yBAAmB,GAAW,CAAC,CAAC;QAIpC,KAAI,CAAC,oBAAoB,EAAE,CAAC;;IAChC,CAAC;IAEM,2DAAoB,GAA3B;QACI,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,aAAa,EAAY,CAAC,CAAC;QAEtD,IAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;QAE9B,IAAI,CAAC,KAAK,EAAE;YACR,OAAO;SACV;QACD,IAAM,SAAS,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC,YAAY,EAAE,CAAC;QAEnD,IAAI,CAAC,IAAI,IAAI,SAAS,CAAC;QACvB,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,CAAC;QAE3D,IAAI,CAAC,mBAAmB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC,GAAG,MAAM,CAAC;QACzE,IAAI,CAAC,QAAQ,CAAC,kBAAkB,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;IAChE,CAAC;IAEM,6CAAM,GAAb,UAAc,oBAA8B;QACxC,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAC5B,iBAAM,MAAM,YAAC,oBAAoB,CAAC,CAAC;IACvC,CAAC;IAEM,6CAAM,GAAb,UAAc,IAAS,EAAE,eAAoB;QACzC,iBAAM,MAAM,YAAC,IAAI,EAAE,eAAe,CAAC,CAAC;IACxC,CAAC;IAED;;;OAGG;IACI,gDAAS,GAAhB;QACI,IAAM,mBAAmB,GAAG,mBAAmB,CAAC,SAAS,CAAC,IAAI,EAAE,iBAAM,SAAS,WAAE,CAAC,CAAC;QACnF,mBAAmB,CAAC,UAAU,GAAG,sCAAsC,CAAC;QAExE,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAED;;;;;;OAMG;IACW,kCAAK,GAAnB,UAAoB,aAAkB,EAAE,KAAY,EAAE,OAAe;QACjE,IAAM,OAAO,GAAG,mBAAmB,CAAC,KAAK,CACrC,cAAM,OAAA,IAAI,4BAA4B,CAAC,aAAa,CAAC,IAAI,EAAE,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,aAAa,CAAC,gBAAgB,CAAC,EAA3H,CAA2H,EACjI,aAAa,EACb,KAAK,EACL,OAAO,CACV,CAAC;QAEF,OAAO,OAAO,CAAC;IACnB,CAAC;IApED;QADC,SAAS,EAAE;8DACc;IAG1B;QADC,SAAS,EAAE;mEACmB;IAG/B;QADC,SAAS,EAAE;0EAC0B;IA+D1C,mCAAC;CAAA,AAvED,CAAkD,iBAAiB,GAuElE;SAvEY,4BAA4B;AAyEzC,aAAa,CAAC,sCAAsC,EAAE,4BAA4B,CAAC,CAAC","sourcesContent":["import { serialize, 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 \"./perlinNoiseProceduralTexture.fragment\";\r\n\r\nexport class PerlinNoiseProceduralTexture extends ProceduralTexture {\r\n @serialize()\r\n public time: number = 0.0;\r\n\r\n @serialize()\r\n public timeScale: number = 1.0;\r\n\r\n @serialize()\r\n public translationSpeed: number = 1.0;\r\n\r\n private _currentTranslation: number = 0;\r\n\r\n constructor(name: string, size: number, scene: Nullable<Scene> = null, fallbackTexture?: Texture, generateMipMaps?: boolean) {\r\n super(name, size, \"perlinNoiseProceduralTexture\", scene, fallbackTexture, generateMipMaps);\r\n this.updateShaderUniforms();\r\n }\r\n\r\n public updateShaderUniforms() {\r\n this.setFloat(\"size\", this.getRenderSize() as number);\r\n\r\n const scene = this.getScene();\r\n\r\n if (!scene) {\r\n return;\r\n }\r\n const deltaTime = scene.getEngine().getDeltaTime();\r\n\r\n this.time += deltaTime;\r\n this.setFloat(\"time\", (this.time * this.timeScale) / 1000);\r\n\r\n this._currentTranslation += (deltaTime * this.translationSpeed) / 1000.0;\r\n this.setFloat(\"translationSpeed\", this._currentTranslation);\r\n }\r\n\r\n public render(useCameraPostProcess?: boolean) {\r\n this.updateShaderUniforms();\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\r\n /**\r\n * Serializes this perlin noise procedural texture\r\n * @returns a serialized perlin noise procedural texture object\r\n */\r\n public serialize(): any {\r\n const serializationObject = SerializationHelper.Serialize(this, super.serialize());\r\n serializationObject.customType = \"BABYLON.PerlinNoiseProceduralTexture\";\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Creates a Perlin Noise Procedural Texture from parsed perlin noise 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 perlin noise procedural texture information\r\n * @returns a parsed Perlin Noise Procedural Texture\r\n */\r\n public static Parse(parsedTexture: any, scene: Scene, rootUrl: string): PerlinNoiseProceduralTexture {\r\n const texture = SerializationHelper.Parse(\r\n () => new PerlinNoiseProceduralTexture(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.PerlinNoiseProceduralTexture\", PerlinNoiseProceduralTexture);\r\n"]}
package/readme.md CHANGED
@@ -13,7 +13,7 @@ npm install --save @babylonjs/core @babylonjs/procedural-textures
13
13
 
14
14
  # How to use
15
15
 
16
- Afterwards it can be imported to the your project using:
16
+ Afterwards it can be imported to your project using:
17
17
 
18
18
  ```
19
19
  import { StandardMaterial } from '@babylonjs/core/Materials/standardMaterial';
@@ -31,4 +31,4 @@ fireMaterial.opacityTexture = fireTexture;
31
31
  // Some more awesome code
32
32
  ```
33
33
 
34
- For more information you can have a look at our [our ES6 dedicated documentation](https://doc.babylonjs.com/features/es6_support).
34
+ For more information you can have a look at our [ES6 dedicated documentation](https://doc.babylonjs.com/features/es6_support).
package/road/index.d.ts CHANGED
@@ -1 +1 @@
1
- export * from "./roadProceduralTexture";
1
+ export * from "./roadProceduralTexture";
package/road/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export * from "./roadProceduralTexture.js";
1
+ export * from "./roadProceduralTexture";
2
2
  //# sourceMappingURL=index.js.map
package/road/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../sourceES6/proceduralTexturesLibrary/src/road/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC","sourcesContent":["export * from \"./roadProceduralTexture\";"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../lts/proceduralTextures/generated/road/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC","sourcesContent":["export * from \"./roadProceduralTexture\";\r\n"]}
@@ -1,26 +1,26 @@
1
- import { Color3 } from "@babylonjs/core/Maths/math.color";
2
- import { Texture } from "@babylonjs/core/Materials/Textures/texture";
3
- import { ProceduralTexture } from "@babylonjs/core/Materials/Textures/Procedurals/proceduralTexture";
4
- import { Scene } from "@babylonjs/core/scene";
5
- import { Nullable } from "@babylonjs/core/types";
6
- import "./roadProceduralTexture.fragment";
7
- export declare class RoadProceduralTexture extends ProceduralTexture {
8
- private _roadColor;
9
- constructor(name: string, size: number, scene?: Nullable<Scene>, fallbackTexture?: Texture, generateMipMaps?: boolean);
10
- updateShaderUniforms(): void;
11
- get roadColor(): Color3;
12
- set roadColor(value: Color3);
13
- /**
14
- * Serializes this road procedural texture
15
- * @returns a serialized road procedural texture object
16
- */
17
- serialize(): any;
18
- /**
19
- * Creates a Road Procedural Texture from parsed road procedural texture data
20
- * @param parsedTexture defines parsed texture data
21
- * @param scene defines the current scene
22
- * @param rootUrl defines the root URL containing road procedural texture information
23
- * @returns a parsed Road Procedural Texture
24
- */
25
- static Parse(parsedTexture: any, scene: Scene, rootUrl: string): RoadProceduralTexture;
26
- }
1
+ import { Color3 } from "@babylonjs/core/Maths/math.color.js";
2
+ import type { Texture } from "@babylonjs/core/Materials/Textures/texture.js";
3
+ import { ProceduralTexture } from "@babylonjs/core/Materials/Textures/Procedurals/proceduralTexture.js";
4
+ import type { Scene } from "@babylonjs/core/scene.js";
5
+ import type { Nullable } from "@babylonjs/core/types.js";
6
+ import "./roadProceduralTexture.fragment";
7
+ export declare class RoadProceduralTexture extends ProceduralTexture {
8
+ private _roadColor;
9
+ constructor(name: string, size: number, scene?: Nullable<Scene>, fallbackTexture?: Texture, generateMipMaps?: boolean);
10
+ updateShaderUniforms(): void;
11
+ get roadColor(): Color3;
12
+ set roadColor(value: Color3);
13
+ /**
14
+ * Serializes this road procedural texture
15
+ * @returns a serialized road procedural texture object
16
+ */
17
+ serialize(): any;
18
+ /**
19
+ * Creates a Road Procedural Texture from parsed road procedural texture data
20
+ * @param parsedTexture defines parsed texture data
21
+ * @param scene defines the current scene
22
+ * @param rootUrl defines the root URL containing road procedural texture information
23
+ * @returns a parsed Road Procedural Texture
24
+ */
25
+ static Parse(parsedTexture: any, scene: Scene, rootUrl: string): RoadProceduralTexture;
26
+ }
@@ -1,5 +1,5 @@
1
- /** @hidden */
2
- export declare var roadProceduralTexturePixelShader: {
3
- name: string;
4
- shader: string;
5
- };
1
+ /** @hidden */
2
+ export declare const roadProceduralTexturePixelShader: {
3
+ name: string;
4
+ shader: string;
5
+ };
@@ -1,7 +1,9 @@
1
- import { ShaderStore } from "@babylonjs/core/Engines/shaderStore.js";
2
- var name = 'roadProceduralTexturePixelShader';
3
- var shader = "precision highp float;\nvarying vec2 vUV;\nuniform vec3 roadColor;\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 fbm(vec2 n) {\nfloat total=0.0,amplitude=1.0;\nfor (int i=0; i<4; i++) {\ntotal+=noise(n)*amplitude;\nn+=n;\namplitude*=0.5;\n}\nreturn total;\n}\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\nfloat ratioy=mod(gl_FragCoord.y*100.0 ,fbm(vUV*2.0));\nvec3 color=roadColor*ratioy;\ngl_FragColor=vec4(color,1.0);\n#define CUSTOM_FRAGMENT_MAIN_END\n}";
4
- ShaderStore.ShadersStore[name] = shader;
5
- /** @hidden */
6
- export var roadProceduralTexturePixelShader = { name: name, shader: shader };
1
+ // Do not edit.
2
+ import { ShaderStore } from "@babylonjs/core/Engines/shaderStore.js";
3
+ var name = "roadProceduralTexturePixelShader";
4
+ var shader = "precision highp float;varying vec2 vUV; \nuniform vec3 roadColor;float rand(vec2 n) {return fract(cos(dot(n,vec2(12.9898,4.1414)))*43758.5453);}\nfloat noise(vec2 n) {const vec2 d=vec2(0.0,1.0);vec2 b=floor(n),f=smoothstep(vec2(0.0),vec2(1.0),fract(n));return mix(mix(rand(b),rand(b+d.yx),f.x),mix(rand(b+d.xy),rand(b+d.yy),f.x),f.y);}\nfloat fbm(vec2 n) {float total=0.0,amplitude=1.0;for (int i=0; i<4; i++) {total+=noise(n)*amplitude;n+=n;amplitude*=0.5;}\nreturn total;}\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\nfloat ratioy=mod(gl_FragCoord.y*100.0 ,fbm(vUV*2.0));vec3 color=roadColor*ratioy;gl_FragColor=vec4(color,1.0);\n#define CUSTOM_FRAGMENT_MAIN_END\n}";
5
+ // Sideeffect
6
+ ShaderStore.ShadersStore[name] = shader;
7
+ /** @hidden */
8
+ export var roadProceduralTexturePixelShader = { name: name, shader: shader };
7
9
  //# sourceMappingURL=roadProceduralTexture.fragment.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"roadProceduralTexture.fragment.js","sourceRoot":"","sources":["../../../sourceES6/proceduralTexturesLibrary/src/road/roadProceduralTexture.fragment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAElE,IAAI,IAAI,GAAG,kCAAkC,CAAC;AAC9C,IAAI,MAAM,GAAG,8uBA2BX,CAAC;AAEH,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACxC,cAAc;AACd,MAAM,CAAC,IAAI,gCAAgC,GAAG,EAAE,IAAI,MAAA,EAAE,MAAM,QAAA,EAAE,CAAC","sourcesContent":["import { ShaderStore } from \"@babylonjs/core/Engines/shaderStore\";\n\nlet name = 'roadProceduralTexturePixelShader';\nlet shader = `precision highp float;\nvarying vec2 vUV;\nuniform vec3 roadColor;\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 fbm(vec2 n) {\nfloat total=0.0,amplitude=1.0;\nfor (int i=0; i<4; i++) {\ntotal+=noise(n)*amplitude;\nn+=n;\namplitude*=0.5;\n}\nreturn total;\n}\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\nfloat ratioy=mod(gl_FragCoord.y*100.0 ,fbm(vUV*2.0));\nvec3 color=roadColor*ratioy;\ngl_FragColor=vec4(color,1.0);\n#define CUSTOM_FRAGMENT_MAIN_END\n}`;\n\nShaderStore.ShadersStore[name] = shader;\n/** @hidden */\nexport var roadProceduralTexturePixelShader = { name, shader };\n"]}
1
+ {"version":3,"file":"roadProceduralTexture.fragment.js","sourceRoot":"","sources":["../../../../../lts/proceduralTextures/generated/road/roadProceduralTexture.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,+CAAiC;AAEvD,IAAM,IAAI,GAAG,kCAAkC,CAAC;AAChD,IAAM,MAAM,GAAG,6sBAUb,CAAC;AACH,aAAa;AACb,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACxC,cAAc;AACd,MAAM,CAAC,IAAM,gCAAgC,GAAG,EAAE,IAAI,MAAA,EAAE,MAAM,QAAA,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"core/Engines/shaderStore\";\n\nconst name = \"roadProceduralTexturePixelShader\";\nconst shader = `precision highp float;varying vec2 vUV; \nuniform vec3 roadColor;float rand(vec2 n) {return fract(cos(dot(n,vec2(12.9898,4.1414)))*43758.5453);}\nfloat noise(vec2 n) {const vec2 d=vec2(0.0,1.0);vec2 b=floor(n),f=smoothstep(vec2(0.0),vec2(1.0),fract(n));return mix(mix(rand(b),rand(b+d.yx),f.x),mix(rand(b+d.xy),rand(b+d.yy),f.x),f.y);}\nfloat fbm(vec2 n) {float total=0.0,amplitude=1.0;for (int i=0; i<4; i++) {total+=noise(n)*amplitude;n+=n;amplitude*=0.5;}\nreturn total;}\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\nfloat ratioy=mod(gl_FragCoord.y*100.0 ,fbm(vUV*2.0));vec3 color=roadColor*ratioy;gl_FragColor=vec4(color,1.0);\n#define CUSTOM_FRAGMENT_MAIN_END\n}`;\n// Sideeffect\nShaderStore.ShadersStore[name] = shader;\n/** @hidden */\nexport const roadProceduralTexturePixelShader = { name, shader };\n"]}
@@ -1,57 +1,57 @@
1
- import { __decorate, __extends } from "tslib";
2
- import { serializeAsColor3, SerializationHelper } from "@babylonjs/core/Misc/decorators.js";
3
- import { Color3 } from "@babylonjs/core/Maths/math.color.js";
4
- import { ProceduralTexture } from "@babylonjs/core/Materials/Textures/Procedurals/proceduralTexture.js";
5
- import { RegisterClass } from '@babylonjs/core/Misc/typeStore.js';
6
- import "./roadProceduralTexture.fragment.js";
7
- var RoadProceduralTexture = /** @class */ (function (_super) {
8
- __extends(RoadProceduralTexture, _super);
9
- function RoadProceduralTexture(name, size, scene, fallbackTexture, generateMipMaps) {
10
- if (scene === void 0) { scene = null; }
11
- var _this = _super.call(this, name, size, "roadProceduralTexture", scene, fallbackTexture, generateMipMaps) || this;
12
- _this._roadColor = new Color3(0.53, 0.53, 0.53);
13
- _this.updateShaderUniforms();
14
- return _this;
15
- }
16
- RoadProceduralTexture.prototype.updateShaderUniforms = function () {
17
- this.setColor3("roadColor", this._roadColor);
18
- };
19
- Object.defineProperty(RoadProceduralTexture.prototype, "roadColor", {
20
- get: function () {
21
- return this._roadColor;
22
- },
23
- set: function (value) {
24
- this._roadColor = value;
25
- this.updateShaderUniforms();
26
- },
27
- enumerable: false,
28
- configurable: true
29
- });
30
- /**
31
- * Serializes this road procedural texture
32
- * @returns a serialized road procedural texture object
33
- */
34
- RoadProceduralTexture.prototype.serialize = function () {
35
- var serializationObject = SerializationHelper.Serialize(this, _super.prototype.serialize.call(this));
36
- serializationObject.customType = "BABYLON.RoadProceduralTexture";
37
- return serializationObject;
38
- };
39
- /**
40
- * Creates a Road Procedural Texture from parsed road procedural texture data
41
- * @param parsedTexture defines parsed texture data
42
- * @param scene defines the current scene
43
- * @param rootUrl defines the root URL containing road procedural texture information
44
- * @returns a parsed Road Procedural Texture
45
- */
46
- RoadProceduralTexture.Parse = function (parsedTexture, scene, rootUrl) {
47
- var texture = SerializationHelper.Parse(function () { return new RoadProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps); }, parsedTexture, scene, rootUrl);
48
- return texture;
49
- };
50
- __decorate([
51
- serializeAsColor3()
52
- ], RoadProceduralTexture.prototype, "roadColor", null);
53
- return RoadProceduralTexture;
54
- }(ProceduralTexture));
55
- export { RoadProceduralTexture };
56
- RegisterClass("BABYLON.RoadProceduralTexture", RoadProceduralTexture);
1
+ import { __decorate, __extends } from "tslib";
2
+ import { serializeAsColor3, SerializationHelper } from "@babylonjs/core/Misc/decorators.js";
3
+ import { Color3 } from "@babylonjs/core/Maths/math.color.js";
4
+ import { ProceduralTexture } from "@babylonjs/core/Materials/Textures/Procedurals/proceduralTexture.js";
5
+ import { RegisterClass } from "@babylonjs/core/Misc/typeStore.js";
6
+ import "./roadProceduralTexture.fragment";
7
+ var RoadProceduralTexture = /** @class */ (function (_super) {
8
+ __extends(RoadProceduralTexture, _super);
9
+ function RoadProceduralTexture(name, size, scene, fallbackTexture, generateMipMaps) {
10
+ if (scene === void 0) { scene = null; }
11
+ var _this = _super.call(this, name, size, "roadProceduralTexture", scene, fallbackTexture, generateMipMaps) || this;
12
+ _this._roadColor = new Color3(0.53, 0.53, 0.53);
13
+ _this.updateShaderUniforms();
14
+ return _this;
15
+ }
16
+ RoadProceduralTexture.prototype.updateShaderUniforms = function () {
17
+ this.setColor3("roadColor", this._roadColor);
18
+ };
19
+ Object.defineProperty(RoadProceduralTexture.prototype, "roadColor", {
20
+ get: function () {
21
+ return this._roadColor;
22
+ },
23
+ set: function (value) {
24
+ this._roadColor = value;
25
+ this.updateShaderUniforms();
26
+ },
27
+ enumerable: false,
28
+ configurable: true
29
+ });
30
+ /**
31
+ * Serializes this road procedural texture
32
+ * @returns a serialized road procedural texture object
33
+ */
34
+ RoadProceduralTexture.prototype.serialize = function () {
35
+ var serializationObject = SerializationHelper.Serialize(this, _super.prototype.serialize.call(this));
36
+ serializationObject.customType = "BABYLON.RoadProceduralTexture";
37
+ return serializationObject;
38
+ };
39
+ /**
40
+ * Creates a Road Procedural Texture from parsed road procedural texture data
41
+ * @param parsedTexture defines parsed texture data
42
+ * @param scene defines the current scene
43
+ * @param rootUrl defines the root URL containing road procedural texture information
44
+ * @returns a parsed Road Procedural Texture
45
+ */
46
+ RoadProceduralTexture.Parse = function (parsedTexture, scene, rootUrl) {
47
+ var texture = SerializationHelper.Parse(function () { return new RoadProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps); }, parsedTexture, scene, rootUrl);
48
+ return texture;
49
+ };
50
+ __decorate([
51
+ serializeAsColor3()
52
+ ], RoadProceduralTexture.prototype, "roadColor", null);
53
+ return RoadProceduralTexture;
54
+ }(ProceduralTexture));
55
+ export { RoadProceduralTexture };
56
+ RegisterClass("BABYLON.RoadProceduralTexture", RoadProceduralTexture);
57
57
  //# sourceMappingURL=roadProceduralTexture.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"roadProceduralTexture.js","sourceRoot":"","sources":["../../../sourceES6/proceduralTexturesLibrary/src/road/roadProceduralTexture.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACzF,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAE1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kEAAkE,CAAC;AAErG,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAE/D,OAAO,kCAAkC,CAAC;AAE1C;IAA2C,yCAAiB;IAGxD,+BAAY,IAAY,EAAE,IAAY,EAAE,KAA6B,EAAE,eAAyB,EAAE,eAAyB;QAAnF,sBAAA,EAAA,YAA6B;QAArE,YACI,kBAAM,IAAI,EAAE,IAAI,EAAE,uBAAuB,EAAE,KAAK,EAAE,eAAe,EAAE,eAAe,CAAC,SAEtF;QALO,gBAAU,GAAG,IAAI,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QAI9C,KAAI,CAAC,oBAAoB,EAAE,CAAC;;IAChC,CAAC;IAEM,oDAAoB,GAA3B;QACI,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IACjD,CAAC;IAGD,sBAAW,4CAAS;aAApB;YACI,OAAO,IAAI,CAAC,UAAU,CAAC;QAC3B,CAAC;aAED,UAAqB,KAAa;YAC9B,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;YACxB,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAChC,CAAC;;;OALA;IAOD;;;OAGG;IACI,yCAAS,GAAhB;QACI,IAAI,mBAAmB,GAAG,mBAAmB,CAAC,SAAS,CAAC,IAAI,EAAE,iBAAM,SAAS,WAAE,CAAC,CAAC;QACjF,mBAAmB,CAAC,UAAU,GAAG,+BAA+B,CAAC;QAEjE,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAED;;;;;;OAMG;IACW,2BAAK,GAAnB,UAAoB,aAAkB,EAAE,KAAY,EAAE,OAAe;QACjE,IAAI,OAAO,GAAG,mBAAmB,CAAC,KAAK,CAAC,cAAM,OAAA,IAAI,qBAAqB,CAAC,aAAa,CAAC,IAAI,EAAE,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,aAAa,CAAC,gBAAgB,CAAC,EAApH,CAAoH,EAAE,aAAa,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;QAEnM,OAAO,OAAO,CAAC;IACnB,CAAC;IA/BD;QADC,iBAAiB,EAAE;0DAGnB;IA8BL,4BAAC;CAAA,AA7CD,CAA2C,iBAAiB,GA6C3D;SA7CY,qBAAqB;AA+ClC,aAAa,CAAC,+BAA+B,EAAE,qBAAqB,CAAC,CAAC","sourcesContent":["import { serializeAsColor3, SerializationHelper } from \"@babylonjs/core/Misc/decorators\";\r\nimport { Color3 } from \"@babylonjs/core/Maths/math.color\";\r\nimport { Texture } from \"@babylonjs/core/Materials/Textures/texture\";\r\nimport { ProceduralTexture } from \"@babylonjs/core/Materials/Textures/Procedurals/proceduralTexture\";\r\nimport { Scene } from \"@babylonjs/core/scene\";\r\nimport { RegisterClass } from '@babylonjs/core/Misc/typeStore';\r\nimport { Nullable } from \"@babylonjs/core/types\";\r\nimport \"./roadProceduralTexture.fragment\";\r\n\r\nexport class RoadProceduralTexture extends ProceduralTexture {\r\n private _roadColor = new Color3(0.53, 0.53, 0.53);\r\n\r\n constructor(name: string, size: number, scene: Nullable<Scene> = null, fallbackTexture?: Texture, generateMipMaps?: boolean) {\r\n super(name, size, \"roadProceduralTexture\", scene, fallbackTexture, generateMipMaps);\r\n this.updateShaderUniforms();\r\n }\r\n\r\n public updateShaderUniforms() {\r\n this.setColor3(\"roadColor\", this._roadColor);\r\n }\r\n\r\n @serializeAsColor3()\r\n public get roadColor(): Color3 {\r\n return this._roadColor;\r\n }\r\n\r\n public set roadColor(value: Color3) {\r\n this._roadColor = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n /**\r\n * Serializes this road procedural texture\r\n * @returns a serialized road procedural texture object\r\n */\r\n public serialize(): any {\r\n var serializationObject = SerializationHelper.Serialize(this, super.serialize());\r\n serializationObject.customType = \"BABYLON.RoadProceduralTexture\";\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Creates a Road Procedural Texture from parsed road 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 road procedural texture information\r\n * @returns a parsed Road Procedural Texture\r\n */\r\n public static Parse(parsedTexture: any, scene: Scene, rootUrl: string): RoadProceduralTexture {\r\n var texture = SerializationHelper.Parse(() => new RoadProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps), parsedTexture, scene, rootUrl);\r\n\r\n return texture;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.RoadProceduralTexture\", RoadProceduralTexture);"]}
1
+ {"version":3,"file":"roadProceduralTexture.js","sourceRoot":"","sources":["../../../../../lts/proceduralTextures/generated/road/roadProceduralTexture.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,2CAA6B;AAC9E,OAAO,EAAE,MAAM,EAAE,4CAA8B;AAE/C,OAAO,EAAE,iBAAiB,EAAE,4EAA8D;AAE1F,OAAO,EAAE,aAAa,EAAE,0CAA4B;AAEpD,OAAO,kCAAkC,CAAC;AAE1C;IAA2C,yCAAiB;IAGxD,+BAAY,IAAY,EAAE,IAAY,EAAE,KAA6B,EAAE,eAAyB,EAAE,eAAyB;QAAnF,sBAAA,EAAA,YAA6B;QAArE,YACI,kBAAM,IAAI,EAAE,IAAI,EAAE,uBAAuB,EAAE,KAAK,EAAE,eAAe,EAAE,eAAe,CAAC,SAEtF;QALO,gBAAU,GAAG,IAAI,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QAI9C,KAAI,CAAC,oBAAoB,EAAE,CAAC;;IAChC,CAAC;IAEM,oDAAoB,GAA3B;QACI,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IACjD,CAAC;IAGD,sBAAW,4CAAS;aAApB;YACI,OAAO,IAAI,CAAC,UAAU,CAAC;QAC3B,CAAC;aAED,UAAqB,KAAa;YAC9B,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;YACxB,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAChC,CAAC;;;OALA;IAOD;;;OAGG;IACI,yCAAS,GAAhB;QACI,IAAM,mBAAmB,GAAG,mBAAmB,CAAC,SAAS,CAAC,IAAI,EAAE,iBAAM,SAAS,WAAE,CAAC,CAAC;QACnF,mBAAmB,CAAC,UAAU,GAAG,+BAA+B,CAAC;QAEjE,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAED;;;;;;OAMG;IACW,2BAAK,GAAnB,UAAoB,aAAkB,EAAE,KAAY,EAAE,OAAe;QACjE,IAAM,OAAO,GAAG,mBAAmB,CAAC,KAAK,CACrC,cAAM,OAAA,IAAI,qBAAqB,CAAC,aAAa,CAAC,IAAI,EAAE,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,aAAa,CAAC,gBAAgB,CAAC,EAApH,CAAoH,EAC1H,aAAa,EACb,KAAK,EACL,OAAO,CACV,CAAC;QAEF,OAAO,OAAO,CAAC;IACnB,CAAC;IApCD;QADC,iBAAiB,EAAE;0DAGnB;IAmCL,4BAAC;CAAA,AAlDD,CAA2C,iBAAiB,GAkD3D;SAlDY,qBAAqB;AAoDlC,aAAa,CAAC,+BAA+B,EAAE,qBAAqB,CAAC,CAAC","sourcesContent":["import { serializeAsColor3, 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\nimport \"./roadProceduralTexture.fragment\";\r\n\r\nexport class RoadProceduralTexture extends ProceduralTexture {\r\n private _roadColor = new Color3(0.53, 0.53, 0.53);\r\n\r\n constructor(name: string, size: number, scene: Nullable<Scene> = null, fallbackTexture?: Texture, generateMipMaps?: boolean) {\r\n super(name, size, \"roadProceduralTexture\", scene, fallbackTexture, generateMipMaps);\r\n this.updateShaderUniforms();\r\n }\r\n\r\n public updateShaderUniforms() {\r\n this.setColor3(\"roadColor\", this._roadColor);\r\n }\r\n\r\n @serializeAsColor3()\r\n public get roadColor(): Color3 {\r\n return this._roadColor;\r\n }\r\n\r\n public set roadColor(value: Color3) {\r\n this._roadColor = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n /**\r\n * Serializes this road procedural texture\r\n * @returns a serialized road procedural texture object\r\n */\r\n public serialize(): any {\r\n const serializationObject = SerializationHelper.Serialize(this, super.serialize());\r\n serializationObject.customType = \"BABYLON.RoadProceduralTexture\";\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Creates a Road Procedural Texture from parsed road 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 road procedural texture information\r\n * @returns a parsed Road Procedural Texture\r\n */\r\n public static Parse(parsedTexture: any, scene: Scene, rootUrl: string): RoadProceduralTexture {\r\n const texture = SerializationHelper.Parse(\r\n () => new RoadProceduralTexture(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.RoadProceduralTexture\", RoadProceduralTexture);\r\n"]}
@@ -1 +1 @@
1
- export * from "./starfieldProceduralTexture";
1
+ export * from "./starfieldProceduralTexture";
@@ -1,2 +1,2 @@
1
- export * from "./starfieldProceduralTexture.js";
1
+ export * from "./starfieldProceduralTexture";
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../sourceES6/proceduralTexturesLibrary/src/starfield/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC","sourcesContent":["export * from \"./starfieldProceduralTexture\";"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../lts/proceduralTextures/generated/starfield/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC","sourcesContent":["export * from \"./starfieldProceduralTexture\";\r\n"]}
@@ -1,55 +1,55 @@
1
- import { Texture } from "@babylonjs/core/Materials/Textures/texture";
2
- import { ProceduralTexture } from "@babylonjs/core/Materials/Textures/Procedurals/proceduralTexture";
3
- import { Scene } from "@babylonjs/core/scene";
4
- import { Nullable } from "@babylonjs/core/types";
5
- import "./starfieldProceduralTexture.fragment";
6
- export declare class StarfieldProceduralTexture extends ProceduralTexture {
7
- private _time;
8
- private _alpha;
9
- private _beta;
10
- private _zoom;
11
- private _formuparam;
12
- private _stepsize;
13
- private _tile;
14
- private _brightness;
15
- private _darkmatter;
16
- private _distfading;
17
- private _saturation;
18
- constructor(name: string, size: number, scene?: Nullable<Scene>, fallbackTexture?: Texture, generateMipMaps?: boolean);
19
- updateShaderUniforms(): void;
20
- get time(): number;
21
- set time(value: number);
22
- get alpha(): number;
23
- set alpha(value: number);
24
- get beta(): number;
25
- set beta(value: number);
26
- get formuparam(): number;
27
- set formuparam(value: number);
28
- get stepsize(): number;
29
- set stepsize(value: number);
30
- get zoom(): number;
31
- set zoom(value: number);
32
- get tile(): number;
33
- set tile(value: number);
34
- get brightness(): number;
35
- set brightness(value: number);
36
- get darkmatter(): number;
37
- set darkmatter(value: number);
38
- get distfading(): number;
39
- set distfading(value: number);
40
- get saturation(): number;
41
- set saturation(value: number);
42
- /**
43
- * Serializes this starfield procedural texture
44
- * @returns a serialized starfield procedural texture object
45
- */
46
- serialize(): any;
47
- /**
48
- * Creates a Starfield Procedural Texture from parsed startfield procedural texture data
49
- * @param parsedTexture defines parsed texture data
50
- * @param scene defines the current scene
51
- * @param rootUrl defines the root URL containing startfield procedural texture information
52
- * @returns a parsed Starfield Procedural Texture
53
- */
54
- static Parse(parsedTexture: any, scene: Scene, rootUrl: string): StarfieldProceduralTexture;
55
- }
1
+ import type { Texture } from "@babylonjs/core/Materials/Textures/texture.js";
2
+ import { ProceduralTexture } from "@babylonjs/core/Materials/Textures/Procedurals/proceduralTexture.js";
3
+ import type { Scene } from "@babylonjs/core/scene.js";
4
+ import type { Nullable } from "@babylonjs/core/types.js";
5
+ import "./starfieldProceduralTexture.fragment";
6
+ export declare class StarfieldProceduralTexture extends ProceduralTexture {
7
+ private _time;
8
+ private _alpha;
9
+ private _beta;
10
+ private _zoom;
11
+ private _formuparam;
12
+ private _stepsize;
13
+ private _tile;
14
+ private _brightness;
15
+ private _darkmatter;
16
+ private _distfading;
17
+ private _saturation;
18
+ constructor(name: string, size: number, scene?: Nullable<Scene>, fallbackTexture?: Texture, generateMipMaps?: boolean);
19
+ updateShaderUniforms(): void;
20
+ get time(): number;
21
+ set time(value: number);
22
+ get alpha(): number;
23
+ set alpha(value: number);
24
+ get beta(): number;
25
+ set beta(value: number);
26
+ get formuparam(): number;
27
+ set formuparam(value: number);
28
+ get stepsize(): number;
29
+ set stepsize(value: number);
30
+ get zoom(): number;
31
+ set zoom(value: number);
32
+ get tile(): number;
33
+ set tile(value: number);
34
+ get brightness(): number;
35
+ set brightness(value: number);
36
+ get darkmatter(): number;
37
+ set darkmatter(value: number);
38
+ get distfading(): number;
39
+ set distfading(value: number);
40
+ get saturation(): number;
41
+ set saturation(value: number);
42
+ /**
43
+ * Serializes this starfield procedural texture
44
+ * @returns a serialized starfield procedural texture object
45
+ */
46
+ serialize(): any;
47
+ /**
48
+ * Creates a Starfield Procedural Texture from parsed startfield procedural texture data
49
+ * @param parsedTexture defines parsed texture data
50
+ * @param scene defines the current scene
51
+ * @param rootUrl defines the root URL containing startfield procedural texture information
52
+ * @returns a parsed Starfield Procedural Texture
53
+ */
54
+ static Parse(parsedTexture: any, scene: Scene, rootUrl: string): StarfieldProceduralTexture;
55
+ }
@@ -1,5 +1,5 @@
1
- /** @hidden */
2
- export declare var starfieldProceduralTexturePixelShader: {
3
- name: string;
4
- shader: string;
5
- };
1
+ /** @hidden */
2
+ export declare const starfieldProceduralTexturePixelShader: {
3
+ name: string;
4
+ shader: string;
5
+ };
@@ -1,7 +1,9 @@
1
- import { ShaderStore } from "@babylonjs/core/Engines/shaderStore.js";
2
- var name = 'starfieldProceduralTexturePixelShader';
3
- var shader = "precision highp float;\n\n#define volsteps 20\n#define iterations 15\nvarying vec2 vPosition;\nvarying vec2 vUV;\nuniform float time;\nuniform float alpha;\nuniform float beta;\nuniform float zoom;\nuniform float formuparam;\nuniform float stepsize;\nuniform float tile;\nuniform float brightness;\nuniform float darkmatter;\nuniform float distfading;\nuniform float saturation;\nvoid main()\n{\nvec3 dir=vec3(vUV*zoom,1.);\nfloat localTime=time*0.0001;\n\nmat2 rot1=mat2(cos(alpha),sin(alpha),-sin(alpha),cos(alpha));\nmat2 rot2=mat2(cos(beta),sin(beta),-sin(beta),cos(beta));\ndir.xz*=rot1;\ndir.xy*=rot2;\nvec3 from=vec3(1.,.5,0.5);\nfrom+=vec3(-2.,localTime*2.,localTime);\nfrom.xz*=rot1;\nfrom.xy*=rot2;\n\nfloat s=0.1,fade=1.;\nvec3 v=vec3(0.);\nfor (int r=0; r<volsteps; r++) {\nvec3 p=from+s*dir*.5;\np=abs(vec3(tile)-mod(p,vec3(tile*2.)));\nfloat pa,a=pa=0.;\nfor (int i=0; i<iterations; i++) {\np=abs(p)/dot(p,p)-formuparam;\na+=abs(length(p)-pa);\npa=length(p);\n}\nfloat dm=max(0.,darkmatter-a*a*.001);\na*=a*a;\nif (r>6) fade*=1.-dm;\n\nv+=fade;\nv+=vec3(s,s*s,s*s*s*s)*a*brightness*fade;\nfade*=distfading;\ns+=stepsize;\n}\nv=mix(vec3(length(v)),v,saturation);\ngl_FragColor=vec4(v*.01,1.);\n}";
4
- ShaderStore.ShadersStore[name] = shader;
5
- /** @hidden */
6
- export var starfieldProceduralTexturePixelShader = { name: name, shader: shader };
1
+ // Do not edit.
2
+ import { ShaderStore } from "@babylonjs/core/Engines/shaderStore.js";
3
+ var name = "starfieldProceduralTexturePixelShader";
4
+ var shader = "precision highp float;\n#define volsteps 20\n#define iterations 15\nvarying vec2 vPosition;varying vec2 vUV;uniform float time;uniform float alpha;uniform float beta;uniform float zoom;uniform float formuparam;uniform float stepsize;uniform float tile;uniform float brightness;uniform float darkmatter;uniform float distfading;uniform float saturation;void main()\n{vec3 dir=vec3(vUV*zoom,1.);float localTime=time*0.0001;mat2 rot1=mat2(cos(alpha),sin(alpha),-sin(alpha),cos(alpha));mat2 rot2=mat2(cos(beta),sin(beta),-sin(beta),cos(beta));dir.xz*=rot1;dir.xy*=rot2;vec3 from=vec3(1.,.5,0.5);from+=vec3(-2.,localTime*2.,localTime);from.xz*=rot1;from.xy*=rot2;float s=0.1,fade=1.;vec3 v=vec3(0.);for (int r=0; r<volsteps; r++) {vec3 p=from+s*dir*.5;p=abs(vec3(tile)-mod(p,vec3(tile*2.))); \nfloat pa,a=pa=0.;for (int i=0; i<iterations; i++) {p=abs(p)/dot(p,p)-formuparam; \na+=abs(length(p)-pa); \npa=length(p);}\nfloat dm=max(0.,darkmatter-a*a*.001); \na*=a*a; \nif (r>6) fade*=1.-dm; \nv+=fade;v+=vec3(s,s*s,s*s*s*s)*a*brightness*fade; \nfade*=distfading; \ns+=stepsize;}\nv=mix(vec3(length(v)),v,saturation); \ngl_FragColor=vec4(v*.01,1.);}";
5
+ // Sideeffect
6
+ ShaderStore.ShadersStore[name] = shader;
7
+ /** @hidden */
8
+ export var starfieldProceduralTexturePixelShader = { name: name, shader: shader };
7
9
  //# sourceMappingURL=starfieldProceduralTexture.fragment.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"starfieldProceduralTexture.fragment.js","sourceRoot":"","sources":["../../../sourceES6/proceduralTexturesLibrary/src/starfield/starfieldProceduralTexture.fragment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAElE,IAAI,IAAI,GAAG,uCAAuC,CAAC;AACnD,IAAI,MAAM,GAAG,0rCAqDX,CAAC;AAEH,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACxC,cAAc;AACd,MAAM,CAAC,IAAI,qCAAqC,GAAG,EAAE,IAAI,MAAA,EAAE,MAAM,QAAA,EAAE,CAAC","sourcesContent":["import { ShaderStore } from \"@babylonjs/core/Engines/shaderStore\";\n\nlet name = 'starfieldProceduralTexturePixelShader';\nlet shader = `precision highp float;\n\n#define volsteps 20\n#define iterations 15\nvarying vec2 vPosition;\nvarying vec2 vUV;\nuniform float time;\nuniform float alpha;\nuniform float beta;\nuniform float zoom;\nuniform float formuparam;\nuniform float stepsize;\nuniform float tile;\nuniform float brightness;\nuniform float darkmatter;\nuniform float distfading;\nuniform float saturation;\nvoid main()\n{\nvec3 dir=vec3(vUV*zoom,1.);\nfloat localTime=time*0.0001;\n\nmat2 rot1=mat2(cos(alpha),sin(alpha),-sin(alpha),cos(alpha));\nmat2 rot2=mat2(cos(beta),sin(beta),-sin(beta),cos(beta));\ndir.xz*=rot1;\ndir.xy*=rot2;\nvec3 from=vec3(1.,.5,0.5);\nfrom+=vec3(-2.,localTime*2.,localTime);\nfrom.xz*=rot1;\nfrom.xy*=rot2;\n\nfloat s=0.1,fade=1.;\nvec3 v=vec3(0.);\nfor (int r=0; r<volsteps; r++) {\nvec3 p=from+s*dir*.5;\np=abs(vec3(tile)-mod(p,vec3(tile*2.)));\nfloat pa,a=pa=0.;\nfor (int i=0; i<iterations; i++) {\np=abs(p)/dot(p,p)-formuparam;\na+=abs(length(p)-pa);\npa=length(p);\n}\nfloat dm=max(0.,darkmatter-a*a*.001);\na*=a*a;\nif (r>6) fade*=1.-dm;\n\nv+=fade;\nv+=vec3(s,s*s,s*s*s*s)*a*brightness*fade;\nfade*=distfading;\ns+=stepsize;\n}\nv=mix(vec3(length(v)),v,saturation);\ngl_FragColor=vec4(v*.01,1.);\n}`;\n\nShaderStore.ShadersStore[name] = shader;\n/** @hidden */\nexport var starfieldProceduralTexturePixelShader = { name, shader };\n"]}
1
+ {"version":3,"file":"starfieldProceduralTexture.fragment.js","sourceRoot":"","sources":["../../../../../lts/proceduralTextures/generated/starfield/starfieldProceduralTexture.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,+CAAiC;AAEvD,IAAM,IAAI,GAAG,uCAAuC,CAAC;AACrD,IAAM,MAAM,GAAG,unCAee,CAAC;AAC/B,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 = \"starfieldProceduralTexturePixelShader\";\nconst shader = `precision highp float;\n#define volsteps 20\n#define iterations 15\nvarying vec2 vPosition;varying vec2 vUV;uniform float time;uniform float alpha;uniform float beta;uniform float zoom;uniform float formuparam;uniform float stepsize;uniform float tile;uniform float brightness;uniform float darkmatter;uniform float distfading;uniform float saturation;void main()\n{vec3 dir=vec3(vUV*zoom,1.);float localTime=time*0.0001;mat2 rot1=mat2(cos(alpha),sin(alpha),-sin(alpha),cos(alpha));mat2 rot2=mat2(cos(beta),sin(beta),-sin(beta),cos(beta));dir.xz*=rot1;dir.xy*=rot2;vec3 from=vec3(1.,.5,0.5);from+=vec3(-2.,localTime*2.,localTime);from.xz*=rot1;from.xy*=rot2;float s=0.1,fade=1.;vec3 v=vec3(0.);for (int r=0; r<volsteps; r++) {vec3 p=from+s*dir*.5;p=abs(vec3(tile)-mod(p,vec3(tile*2.))); \nfloat pa,a=pa=0.;for (int i=0; i<iterations; i++) {p=abs(p)/dot(p,p)-formuparam; \na+=abs(length(p)-pa); \npa=length(p);}\nfloat dm=max(0.,darkmatter-a*a*.001); \na*=a*a; \nif (r>6) fade*=1.-dm; \nv+=fade;v+=vec3(s,s*s,s*s*s*s)*a*brightness*fade; \nfade*=distfading; \ns+=stepsize;}\nv=mix(vec3(length(v)),v,saturation); \ngl_FragColor=vec4(v*.01,1.);}`;\n// Sideeffect\nShaderStore.ShadersStore[name] = shader;\n/** @hidden */\nexport const starfieldProceduralTexturePixelShader = { name, shader };\n"]}