@babylonjs/procedural-textures 9.15.0 → 9.16.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.
@@ -1,85 +1,96 @@
1
- import { __decorate } from "@babylonjs/core/tslib.es6.js";
1
+ import { __esDecorate, __runInitializers } from "@babylonjs/core/tslib.es6.js";
2
2
  import { serialize } from "@babylonjs/core/Misc/decorators.js";
3
3
  import { SerializationHelper } from "@babylonjs/core/Misc/decorators.serialization.js";
4
4
  import { Color3 } from "@babylonjs/core/Maths/math.color.js";
5
5
  import { ProceduralTexture } from "@babylonjs/core/Materials/Textures/Procedurals/proceduralTexture.js";
6
6
  import { RegisterClass } from "@babylonjs/core/Misc/typeStore.js";
7
7
  import "./marbleProceduralTexture.fragment.js";
8
- export class MarbleProceduralTexture extends ProceduralTexture {
9
- constructor(name, size, scene = null, fallbackTexture, generateMipMaps) {
10
- super(name, size, "marbleProceduralTexture", scene, fallbackTexture, generateMipMaps);
11
- this._numberOfTilesHeight = 3;
12
- this._numberOfTilesWidth = 3;
13
- this._amplitude = 9.0;
14
- this._jointColor = new Color3(0.72, 0.72, 0.72);
15
- this.updateShaderUniforms();
16
- }
17
- updateShaderUniforms() {
18
- this.setFloat("numberOfTilesHeight", this._numberOfTilesHeight);
19
- this.setFloat("numberOfTilesWidth", this._numberOfTilesWidth);
20
- this.setFloat("amplitude", this._amplitude);
21
- this.setColor3("jointColor", this._jointColor);
22
- }
23
- get numberOfTilesHeight() {
24
- return this._numberOfTilesHeight;
25
- }
26
- set numberOfTilesHeight(value) {
27
- this._numberOfTilesHeight = value;
28
- this.updateShaderUniforms();
29
- }
30
- get amplitude() {
31
- return this._amplitude;
32
- }
33
- set amplitude(value) {
34
- this._amplitude = value;
35
- this.updateShaderUniforms();
36
- }
37
- get numberOfTilesWidth() {
38
- return this._numberOfTilesWidth;
39
- }
40
- set numberOfTilesWidth(value) {
41
- this._numberOfTilesWidth = value;
42
- this.updateShaderUniforms();
43
- }
44
- get jointColor() {
45
- return this._jointColor;
46
- }
47
- set jointColor(value) {
48
- this._jointColor = value;
49
- this.updateShaderUniforms();
50
- }
51
- /**
52
- * Serializes this marble procedural texture
53
- * @returns a serialized marble procedural texture object
54
- */
55
- serialize() {
56
- const serializationObject = SerializationHelper.Serialize(this, super.serialize());
57
- serializationObject.customType = "BABYLON.MarbleProceduralTexture";
58
- return serializationObject;
59
- }
60
- /**
61
- * Creates a Marble Procedural Texture from parsed marble procedural texture data
62
- * @param parsedTexture defines parsed texture data
63
- * @param scene defines the current scene
64
- * @param rootUrl defines the root URL containing marble procedural texture information
65
- * @returns a parsed Marble Procedural Texture
66
- */
67
- static Parse(parsedTexture, scene, rootUrl) {
68
- const texture = SerializationHelper.Parse(() => new MarbleProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps), parsedTexture, scene, rootUrl);
69
- return texture;
70
- }
71
- }
72
- __decorate([
73
- serialize()
74
- ], MarbleProceduralTexture.prototype, "numberOfTilesHeight", null);
75
- __decorate([
76
- serialize()
77
- ], MarbleProceduralTexture.prototype, "amplitude", null);
78
- __decorate([
79
- serialize()
80
- ], MarbleProceduralTexture.prototype, "numberOfTilesWidth", null);
81
- __decorate([
82
- serialize()
83
- ], MarbleProceduralTexture.prototype, "jointColor", null);
8
+ let MarbleProceduralTexture = (() => {
9
+ var _a;
10
+ let _classSuper = ProceduralTexture;
11
+ let _instanceExtraInitializers = [];
12
+ let _get_numberOfTilesHeight_decorators;
13
+ let _get_amplitude_decorators;
14
+ let _get_numberOfTilesWidth_decorators;
15
+ let _get_jointColor_decorators;
16
+ return _a = class MarbleProceduralTexture extends _classSuper {
17
+ constructor(name, size, scene = null, fallbackTexture, generateMipMaps) {
18
+ super(name, size, "marbleProceduralTexture", scene, fallbackTexture, generateMipMaps);
19
+ this._numberOfTilesHeight = (__runInitializers(this, _instanceExtraInitializers), 3);
20
+ this._numberOfTilesWidth = 3;
21
+ this._amplitude = 9.0;
22
+ this._jointColor = new Color3(0.72, 0.72, 0.72);
23
+ this.updateShaderUniforms();
24
+ }
25
+ updateShaderUniforms() {
26
+ this.setFloat("numberOfTilesHeight", this._numberOfTilesHeight);
27
+ this.setFloat("numberOfTilesWidth", this._numberOfTilesWidth);
28
+ this.setFloat("amplitude", this._amplitude);
29
+ this.setColor3("jointColor", this._jointColor);
30
+ }
31
+ get numberOfTilesHeight() {
32
+ return this._numberOfTilesHeight;
33
+ }
34
+ set numberOfTilesHeight(value) {
35
+ this._numberOfTilesHeight = value;
36
+ this.updateShaderUniforms();
37
+ }
38
+ get amplitude() {
39
+ return this._amplitude;
40
+ }
41
+ set amplitude(value) {
42
+ this._amplitude = value;
43
+ this.updateShaderUniforms();
44
+ }
45
+ get numberOfTilesWidth() {
46
+ return this._numberOfTilesWidth;
47
+ }
48
+ set numberOfTilesWidth(value) {
49
+ this._numberOfTilesWidth = value;
50
+ this.updateShaderUniforms();
51
+ }
52
+ get jointColor() {
53
+ return this._jointColor;
54
+ }
55
+ set jointColor(value) {
56
+ this._jointColor = value;
57
+ this.updateShaderUniforms();
58
+ }
59
+ /**
60
+ * Serializes this marble procedural texture
61
+ * @returns a serialized marble procedural texture object
62
+ */
63
+ serialize() {
64
+ const serializationObject = SerializationHelper.Serialize(this, super.serialize());
65
+ serializationObject.customType = "BABYLON.MarbleProceduralTexture";
66
+ return serializationObject;
67
+ }
68
+ /**
69
+ * Creates a Marble Procedural Texture from parsed marble procedural texture data
70
+ * @param parsedTexture defines parsed texture data
71
+ * @param scene defines the current scene
72
+ * @param rootUrl defines the root URL containing marble procedural texture information
73
+ * @returns a parsed Marble Procedural Texture
74
+ */
75
+ static Parse(parsedTexture, scene, rootUrl) {
76
+ const texture = SerializationHelper.Parse(() => new _a(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps), parsedTexture, scene, rootUrl);
77
+ return texture;
78
+ }
79
+ },
80
+ (() => {
81
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
82
+ _get_numberOfTilesHeight_decorators = [serialize()];
83
+ _get_amplitude_decorators = [serialize()];
84
+ _get_numberOfTilesWidth_decorators = [serialize()];
85
+ _get_jointColor_decorators = [serialize()];
86
+ __esDecorate(_a, null, _get_numberOfTilesHeight_decorators, { kind: "getter", name: "numberOfTilesHeight", static: false, private: false, access: { has: obj => "numberOfTilesHeight" in obj, get: obj => obj.numberOfTilesHeight }, metadata: _metadata }, null, _instanceExtraInitializers);
87
+ __esDecorate(_a, null, _get_amplitude_decorators, { kind: "getter", name: "amplitude", static: false, private: false, access: { has: obj => "amplitude" in obj, get: obj => obj.amplitude }, metadata: _metadata }, null, _instanceExtraInitializers);
88
+ __esDecorate(_a, null, _get_numberOfTilesWidth_decorators, { kind: "getter", name: "numberOfTilesWidth", static: false, private: false, access: { has: obj => "numberOfTilesWidth" in obj, get: obj => obj.numberOfTilesWidth }, metadata: _metadata }, null, _instanceExtraInitializers);
89
+ __esDecorate(_a, null, _get_jointColor_decorators, { kind: "getter", name: "jointColor", static: false, private: false, access: { has: obj => "jointColor" in obj, get: obj => obj.jointColor }, metadata: _metadata }, null, _instanceExtraInitializers);
90
+ if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
91
+ })(),
92
+ _a;
93
+ })();
94
+ export { MarbleProceduralTexture };
84
95
  RegisterClass("BABYLON.MarbleProceduralTexture", MarbleProceduralTexture);
85
96
  //# sourceMappingURL=marbleProceduralTexture.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"marbleProceduralTexture.js","sourceRoot":"","sources":["../../../../dev/proceduralTextures/src/marble/marbleProceduralTexture.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,O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ializationHelper } from \"core/Misc/decorators.serialization\";\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 override 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 override 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":["../../../../dev/proceduralTextures/src/marble/marbleProceduralTexture.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,uDAAuD,CAAC;AAE1F,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGpD,OAAO,oCAAoC,CAAC;IAE/B,uBAAuB;;sBAAS,iBAAiB;;;;;;sBAAjD,uBAAwB,SAAQ,WAAiB;YAM1D,YAAY,IAAY,EAAE,IAAY,EAAE,QAAyB,IAAI,EAAE,eAAyB,EAAE,eAAyB;gBACvH,KAAK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,oBAAoB,EAAE,CAAC;YAChC,CAAC;YAGD,IAAW,UAAU;gBACjB,OAAO,IAAI,CAAC,WAAW,CAAC;YAC5B,CAAC;YAED,IAAW,UAAU,CAAC,KAAa;gBAC/B,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;gBACzB,IAAI,CAAC,oBAAoB,EAAE,CAAC;YAChC,CAAC;YAED;;;eAGG;YACa,SAAS;gBACrB,MAAM,mBAAmB,GAAG,mBAAmB,CAAC,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC;gBACnF,mBAAmB,CAAC,UAAU,GAAG,iCAAiC,CAAC;gBAEnE,OAAO,mBAAmB,CAAC;YAC/B,CAAC;YAED;;;;;;eAMG;YACI,MAAM,CAAU,KAAK,CAAC,aAAkB,EAAE,KAAY,EAAE,OAAe;gBAC1E,MAAM,OAAO,GAAG,mBAAmB,CAAC,KAAK,CACrC,GAAG,EAAE,CAAC,IAAI,EAAuB,CAAC,aAAa,CAAC,IAAI,EAAE,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,aAAa,CAAC,gBAAgB,CAAC,EAC5H,aAAa,EACb,KAAK,EACL,OAAO,CACV,CAAC;gBAEF,OAAO,OAAO,CAAC;YACnB,CAAC;;;;mDAnEA,SAAS,EAAE;yCAUX,SAAS,EAAE;kDAUX,SAAS,EAAE;0CAUX,SAAS,EAAE;YA7BZ,8MAAW,mBAAmB,6DAE7B;YAQD,gLAAW,SAAS,6DAEnB;YAQD,2MAAW,kBAAkB,6DAE5B;YAQD,mLAAW,UAAU,6DAEpB;;;;;SAnDQ,uBAAuB;AAwFpC,aAAa,CAAC,iCAAiC,EAAE,uBAAuB,CAAC,CAAC","sourcesContent":["import { serialize } from \"core/Misc/decorators\";\r\nimport { SerializationHelper } from \"core/Misc/decorators.serialization\";\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 override 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 override 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,62 +1,74 @@
1
- import { __decorate } from "@babylonjs/core/tslib.es6.js";
1
+ import { __esDecorate, __runInitializers } from "@babylonjs/core/tslib.es6.js";
2
2
  import { serializeAsTexture } from "@babylonjs/core/Misc/decorators.js";
3
3
  import { SerializationHelper } from "@babylonjs/core/Misc/decorators.serialization.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 "./normalMapProceduralTexture.fragment.js";
7
- export class NormalMapProceduralTexture extends ProceduralTexture {
8
- constructor(name, size, scene = null, fallbackTexture, generateMipMaps) {
9
- super(name, size, "normalMapProceduralTexture", scene, fallbackTexture, generateMipMaps);
10
- this.updateShaderUniforms();
11
- }
12
- updateShaderUniforms() {
13
- this.setTexture("baseSampler", this._baseTexture);
14
- this.setFloat("size", this.getRenderSize());
15
- }
16
- render(useCameraPostProcess) {
17
- super.render(useCameraPostProcess);
18
- }
19
- resize(size, generateMipMaps) {
20
- super.resize(size, generateMipMaps);
21
- // We need to update the "size" uniform
22
- this.updateShaderUniforms();
23
- }
24
- isReady() {
25
- if (!this._baseTexture || !this._baseTexture.isReady()) {
26
- return false;
27
- }
28
- return super.isReady();
29
- }
30
- get baseTexture() {
31
- return this._baseTexture;
32
- }
33
- set baseTexture(texture) {
34
- this._baseTexture = texture;
35
- this.updateShaderUniforms();
36
- }
37
- /**
38
- * Serializes this normal map procedural texture
39
- * @returns a serialized normal map procedural texture object
40
- */
41
- serialize() {
42
- const serializationObject = SerializationHelper.Serialize(this, super.serialize());
43
- serializationObject.customType = "BABYLON.NormalMapProceduralTexture";
44
- return serializationObject;
45
- }
46
- /**
47
- * Creates a Normal Map Procedural Texture from parsed normal map 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 normal map procedural texture information
51
- * @returns a parsed Normal Map Procedural Texture
52
- */
53
- static Parse(parsedTexture, scene, rootUrl) {
54
- const texture = SerializationHelper.Parse(() => new NormalMapProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps), parsedTexture, scene, rootUrl);
55
- return texture;
56
- }
57
- }
58
- __decorate([
59
- serializeAsTexture()
60
- ], NormalMapProceduralTexture.prototype, "baseTexture", null);
7
+ let NormalMapProceduralTexture = (() => {
8
+ var _a;
9
+ let _classSuper = ProceduralTexture;
10
+ let _instanceExtraInitializers = [];
11
+ let _get_baseTexture_decorators;
12
+ return _a = class NormalMapProceduralTexture extends _classSuper {
13
+ constructor(name, size, scene = null, fallbackTexture, generateMipMaps) {
14
+ super(name, size, "normalMapProceduralTexture", scene, fallbackTexture, generateMipMaps);
15
+ this._baseTexture = __runInitializers(this, _instanceExtraInitializers);
16
+ this.updateShaderUniforms();
17
+ }
18
+ updateShaderUniforms() {
19
+ this.setTexture("baseSampler", this._baseTexture);
20
+ this.setFloat("size", this.getRenderSize());
21
+ }
22
+ render(useCameraPostProcess) {
23
+ super.render(useCameraPostProcess);
24
+ }
25
+ resize(size, generateMipMaps) {
26
+ super.resize(size, generateMipMaps);
27
+ // We need to update the "size" uniform
28
+ this.updateShaderUniforms();
29
+ }
30
+ isReady() {
31
+ if (!this._baseTexture || !this._baseTexture.isReady()) {
32
+ return false;
33
+ }
34
+ return super.isReady();
35
+ }
36
+ get baseTexture() {
37
+ return this._baseTexture;
38
+ }
39
+ set baseTexture(texture) {
40
+ this._baseTexture = texture;
41
+ this.updateShaderUniforms();
42
+ }
43
+ /**
44
+ * Serializes this normal map procedural texture
45
+ * @returns a serialized normal map procedural texture object
46
+ */
47
+ serialize() {
48
+ const serializationObject = SerializationHelper.Serialize(this, super.serialize());
49
+ serializationObject.customType = "BABYLON.NormalMapProceduralTexture";
50
+ return serializationObject;
51
+ }
52
+ /**
53
+ * Creates a Normal Map Procedural Texture from parsed normal map procedural texture data
54
+ * @param parsedTexture defines parsed texture data
55
+ * @param scene defines the current scene
56
+ * @param rootUrl defines the root URL containing normal map procedural texture information
57
+ * @returns a parsed Normal Map Procedural Texture
58
+ */
59
+ static Parse(parsedTexture, scene, rootUrl) {
60
+ const texture = SerializationHelper.Parse(() => new _a(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps), parsedTexture, scene, rootUrl);
61
+ return texture;
62
+ }
63
+ },
64
+ (() => {
65
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
66
+ _get_baseTexture_decorators = [serializeAsTexture()];
67
+ __esDecorate(_a, null, _get_baseTexture_decorators, { kind: "getter", name: "baseTexture", static: false, private: false, access: { has: obj => "baseTexture" in obj, get: obj => obj.baseTexture }, metadata: _metadata }, null, _instanceExtraInitializers);
68
+ if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
69
+ })(),
70
+ _a;
71
+ })();
72
+ export { NormalMapProceduralTexture };
61
73
  RegisterClass("BABYLON.NormalMapProceduralTexture", NormalMapProceduralTexture);
62
74
  //# sourceMappingURL=normalMapProceduralTexture.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"normalMapProceduralTexture.js","sourceRoot":"","sources":["../../../../dev/proceduralTextures/src/normalMap/normalMapProceduralTexture.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAEzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uDAAuD,CAAC;AAE1F,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;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;IAEe,MAAM,CAAC,oBAA8B;QACjD,KAAK,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC;IACvC,CAAC;IAEe,MAAM,CAAC,IAAS,EAAE,eAAoB;QAClD,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;QAEpC,uCAAuC;QACvC,IAAI,CAAC,oBAAoB,EAAE,CAAC;IAChC,CAAC;IAEe,OAAO;QACnB,IAAI,CAAC,IAAI,CAAC,YAAY,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,EAAE,CAAC;YACrD,OAAO,KAAK,CAAC;QACjB,CAAC;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;IACa,SAAS;QACrB,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,CAAU,KAAK,CAAC,aAAkB,EAAE,KAAY,EAAE,OAAe;QAC1E,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 } from \"core/Misc/decorators\";\r\nimport { SerializationHelper } from \"core/Misc/decorators.serialization\";\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 override render(useCameraPostProcess?: boolean) {\r\n super.render(useCameraPostProcess);\r\n }\r\n\r\n public override 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 override 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 override 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 override 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":["../../../../dev/proceduralTextures/src/normalMap/normalMapProceduralTexture.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAEzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uDAAuD,CAAC;AAE1F,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,uCAAuC,CAAC;IAElC,0BAA0B;;sBAAS,iBAAiB;;;sBAApD,0BAA2B,SAAQ,WAAiB;YAG7D,YAAY,IAAY,EAAE,IAAY,EAAE,QAAyB,IAAI,EAAE,eAAyB,EAAE,eAAyB;gBACvH,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,4BAA4B,EAAE,KAAK,EAAE,eAAe,EAAE,eAAe,CAAC,CAAC;gBAHrF,iBAAY,GADX,mDAA0B,CACL;gBAI1B,IAAI,CAAC,oBAAoB,EAAE,CAAC;YAChC,CAAC;YAEM,oBAAoB;gBACvB,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;gBAClD,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,aAAa,EAAY,CAAC,CAAC;YAC1D,CAAC;YAEe,MAAM,CAAC,oBAA8B;gBACjD,KAAK,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC;YACvC,CAAC;YAEe,MAAM,CAAC,IAAS,EAAE,eAAoB;gBAClD,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;gBAEpC,uCAAuC;gBACvC,IAAI,CAAC,oBAAoB,EAAE,CAAC;YAChC,CAAC;YAEe,OAAO;gBACnB,IAAI,CAAC,IAAI,CAAC,YAAY,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,EAAE,CAAC;oBACrD,OAAO,KAAK,CAAC;gBACjB,CAAC;gBAED,OAAO,KAAK,CAAC,OAAO,EAAE,CAAC;YAC3B,CAAC;YAGD,IAAW,WAAW;gBAClB,OAAO,IAAI,CAAC,YAAY,CAAC;YAC7B,CAAC;YAED,IAAW,WAAW,CAAC,OAAgB;gBACnC,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC;gBAC5B,IAAI,CAAC,oBAAoB,EAAE,CAAC;YAChC,CAAC;YAED;;;eAGG;YACa,SAAS;gBACrB,MAAM,mBAAmB,GAAG,mBAAmB,CAAC,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC;gBACnF,mBAAmB,CAAC,UAAU,GAAG,oCAAoC,CAAC;gBAEtE,OAAO,mBAAmB,CAAC;YAC/B,CAAC;YAED;;;;;;eAMG;YACI,MAAM,CAAU,KAAK,CAAC,aAAkB,EAAE,KAAY,EAAE,OAAe;gBAC1E,MAAM,OAAO,GAAG,mBAAmB,CAAC,KAAK,CACrC,GAAG,EAAE,CAAC,IAAI,EAA0B,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;gBAEF,OAAO,OAAO,CAAC;YACnB,CAAC;;;;2CArCA,kBAAkB,EAAE;YACrB,sLAAW,WAAW,6DAErB;;;;;SAnCQ,0BAA0B;AAwEvC,aAAa,CAAC,oCAAoC,EAAE,0BAA0B,CAAC,CAAC","sourcesContent":["import { serializeAsTexture } from \"core/Misc/decorators\";\r\nimport { SerializationHelper } from \"core/Misc/decorators.serialization\";\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 override render(useCameraPostProcess?: boolean) {\r\n super.render(useCameraPostProcess);\r\n }\r\n\r\n public override 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 override 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 override 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 override 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": "9.15.0",
3
+ "version": "9.16.0",
4
4
  "main": "index.js",
5
5
  "module": "index.js",
6
6
  "types": "index.d.ts",
@@ -18,7 +18,7 @@
18
18
  "postcompile": "build-tools -c add-js-to-es6"
19
19
  },
20
20
  "devDependencies": {
21
- "@babylonjs/core": "9.15.0",
21
+ "@babylonjs/core": "9.16.0",
22
22
  "@dev/build-tools": "^1.0.0",
23
23
  "@dev/procedural-textures": "^1.0.0"
24
24
  },
@@ -1,66 +1,82 @@
1
- import { __decorate } from "@babylonjs/core/tslib.es6.js";
1
+ import { __esDecorate, __runInitializers } from "@babylonjs/core/tslib.es6.js";
2
2
  import { serialize } from "@babylonjs/core/Misc/decorators.js";
3
3
  import { SerializationHelper } from "@babylonjs/core/Misc/decorators.serialization.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 "./perlinNoiseProceduralTexture.fragment.js";
7
- export class PerlinNoiseProceduralTexture extends ProceduralTexture {
8
- constructor(name, size, scene = null, fallbackTexture, generateMipMaps) {
9
- super(name, size, "perlinNoiseProceduralTexture", scene, fallbackTexture, generateMipMaps);
10
- this.time = 0.0;
11
- this.timeScale = 1.0;
12
- this.translationSpeed = 1.0;
13
- this._currentTranslation = 0;
14
- this.updateShaderUniforms();
15
- }
16
- updateShaderUniforms() {
17
- this.setFloat("size", this.getRenderSize());
18
- const scene = this.getScene();
19
- if (!scene) {
20
- return;
21
- }
22
- const deltaTime = scene.getEngine().getDeltaTime();
23
- this.time += deltaTime;
24
- this.setFloat("time", (this.time * this.timeScale) / 1000);
25
- this._currentTranslation += (deltaTime * this.translationSpeed) / 1000.0;
26
- this.setFloat("translationSpeed", this._currentTranslation);
27
- }
28
- render(useCameraPostProcess) {
29
- this.updateShaderUniforms();
30
- super.render(useCameraPostProcess);
31
- }
32
- resize(size, generateMipMaps) {
33
- super.resize(size, generateMipMaps);
34
- }
35
- /**
36
- * Serializes this perlin noise procedural texture
37
- * @returns a serialized perlin noise procedural texture object
38
- */
39
- serialize() {
40
- const serializationObject = SerializationHelper.Serialize(this, super.serialize());
41
- serializationObject.customType = "BABYLON.PerlinNoiseProceduralTexture";
42
- return serializationObject;
43
- }
44
- /**
45
- * Creates a Perlin Noise Procedural Texture from parsed perlin noise procedural texture data
46
- * @param parsedTexture defines parsed texture data
47
- * @param scene defines the current scene
48
- * @param rootUrl defines the root URL containing perlin noise procedural texture information
49
- * @returns a parsed Perlin Noise Procedural Texture
50
- */
51
- static Parse(parsedTexture, scene, rootUrl) {
52
- const texture = SerializationHelper.Parse(() => new PerlinNoiseProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps), parsedTexture, scene, rootUrl);
53
- return texture;
54
- }
55
- }
56
- __decorate([
57
- serialize()
58
- ], PerlinNoiseProceduralTexture.prototype, "time", void 0);
59
- __decorate([
60
- serialize()
61
- ], PerlinNoiseProceduralTexture.prototype, "timeScale", void 0);
62
- __decorate([
63
- serialize()
64
- ], PerlinNoiseProceduralTexture.prototype, "translationSpeed", void 0);
7
+ let PerlinNoiseProceduralTexture = (() => {
8
+ var _a;
9
+ let _classSuper = ProceduralTexture;
10
+ let _time_decorators;
11
+ let _time_initializers = [];
12
+ let _time_extraInitializers = [];
13
+ let _timeScale_decorators;
14
+ let _timeScale_initializers = [];
15
+ let _timeScale_extraInitializers = [];
16
+ let _translationSpeed_decorators;
17
+ let _translationSpeed_initializers = [];
18
+ let _translationSpeed_extraInitializers = [];
19
+ return _a = class PerlinNoiseProceduralTexture extends _classSuper {
20
+ constructor(name, size, scene = null, fallbackTexture, generateMipMaps) {
21
+ super(name, size, "perlinNoiseProceduralTexture", scene, fallbackTexture, generateMipMaps);
22
+ this.time = __runInitializers(this, _time_initializers, 0.0);
23
+ this.timeScale = (__runInitializers(this, _time_extraInitializers), __runInitializers(this, _timeScale_initializers, 1.0));
24
+ this.translationSpeed = (__runInitializers(this, _timeScale_extraInitializers), __runInitializers(this, _translationSpeed_initializers, 1.0));
25
+ this._currentTranslation = (__runInitializers(this, _translationSpeed_extraInitializers), 0);
26
+ this.updateShaderUniforms();
27
+ }
28
+ updateShaderUniforms() {
29
+ this.setFloat("size", this.getRenderSize());
30
+ const scene = this.getScene();
31
+ if (!scene) {
32
+ return;
33
+ }
34
+ const deltaTime = scene.getEngine().getDeltaTime();
35
+ this.time += deltaTime;
36
+ this.setFloat("time", (this.time * this.timeScale) / 1000);
37
+ this._currentTranslation += (deltaTime * this.translationSpeed) / 1000.0;
38
+ this.setFloat("translationSpeed", this._currentTranslation);
39
+ }
40
+ render(useCameraPostProcess) {
41
+ this.updateShaderUniforms();
42
+ super.render(useCameraPostProcess);
43
+ }
44
+ resize(size, generateMipMaps) {
45
+ super.resize(size, generateMipMaps);
46
+ }
47
+ /**
48
+ * Serializes this perlin noise procedural texture
49
+ * @returns a serialized perlin noise procedural texture object
50
+ */
51
+ serialize() {
52
+ const serializationObject = SerializationHelper.Serialize(this, super.serialize());
53
+ serializationObject.customType = "BABYLON.PerlinNoiseProceduralTexture";
54
+ return serializationObject;
55
+ }
56
+ /**
57
+ * Creates a Perlin Noise Procedural Texture from parsed perlin noise procedural texture data
58
+ * @param parsedTexture defines parsed texture data
59
+ * @param scene defines the current scene
60
+ * @param rootUrl defines the root URL containing perlin noise procedural texture information
61
+ * @returns a parsed Perlin Noise Procedural Texture
62
+ */
63
+ static Parse(parsedTexture, scene, rootUrl) {
64
+ const texture = SerializationHelper.Parse(() => new _a(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps), parsedTexture, scene, rootUrl);
65
+ return texture;
66
+ }
67
+ },
68
+ (() => {
69
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
70
+ _time_decorators = [serialize()];
71
+ _timeScale_decorators = [serialize()];
72
+ _translationSpeed_decorators = [serialize()];
73
+ __esDecorate(null, null, _time_decorators, { kind: "field", name: "time", static: false, private: false, access: { has: obj => "time" in obj, get: obj => obj.time, set: (obj, value) => { obj.time = value; } }, metadata: _metadata }, _time_initializers, _time_extraInitializers);
74
+ __esDecorate(null, null, _timeScale_decorators, { kind: "field", name: "timeScale", static: false, private: false, access: { has: obj => "timeScale" in obj, get: obj => obj.timeScale, set: (obj, value) => { obj.timeScale = value; } }, metadata: _metadata }, _timeScale_initializers, _timeScale_extraInitializers);
75
+ __esDecorate(null, null, _translationSpeed_decorators, { kind: "field", name: "translationSpeed", static: false, private: false, access: { has: obj => "translationSpeed" in obj, get: obj => obj.translationSpeed, set: (obj, value) => { obj.translationSpeed = value; } }, metadata: _metadata }, _translationSpeed_initializers, _translationSpeed_extraInitializers);
76
+ if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
77
+ })(),
78
+ _a;
79
+ })();
80
+ export { PerlinNoiseProceduralTexture };
65
81
  RegisterClass("BABYLON.PerlinNoiseProceduralTexture", PerlinNoiseProceduralTexture);
66
82
  //# sourceMappingURL=perlinNoiseProceduralTexture.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"perlinNoiseProceduralTexture.js","sourceRoot":"","sources":["../../../../dev/proceduralTextures/src/perlinNoise/perlinNoiseProceduralTexture.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAEz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,KAAK,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC;IACvC,CAAC;IAEe,MAAM,CAAC,IAAS,EAAE,eAAoB;QAClD,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;IACxC,CAAC;IAED;;;OAGG;IACa,SAAS;QACrB,MAAM,mBAAmB,GAAG,mBAAmB,CAAC,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC;QACnF,mBAAmB,CAAC,UAAU,GAAG,sCAAsC,CAAC;QAExE,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAED;;;;;;OAMG;IACI,MAAM,CAAU,KAAK,CAAC,aAAkB,EAAE,KAAY,EAAE,OAAe;QAC1E,MAAM,OAAO,GAAG,mBAAmB,CAAC,KAAK,CACrC,GAAG,EAAE,CAAC,IAAI,4BAA4B,CAAC,aAAa,CAAC,IAAI,EAAE,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,aAAa,CAAC,gBAAgB,CAAC,EACjI,aAAa,EACb,KAAK,EACL,OAAO,CACV,CAAC;QAEF,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ;AArEU;IADN,SAAS,EAAE;0DACc;AAGnB;IADN,SAAS,EAAE;+DACmB;AAGxB;IADN,SAAS,EAAE;sEAC0B;AAiE1C,aAAa,CAAC,sCAAsC,EAAE,4BAA4B,CAAC,CAAC","sourcesContent":["import { serialize } from \"core/Misc/decorators\";\r\nimport { SerializationHelper } from \"core/Misc/decorators.serialization\";\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 override render(useCameraPostProcess?: boolean) {\r\n this.updateShaderUniforms();\r\n super.render(useCameraPostProcess);\r\n }\r\n\r\n public override 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 override 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 override 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"]}
1
+ {"version":3,"file":"perlinNoiseProceduralTexture.js","sourceRoot":"","sources":["../../../../dev/proceduralTextures/src/perlinNoise/perlinNoiseProceduralTexture.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAEzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uDAAuD,CAAC;AAE1F,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,yCAAyC,CAAC;IAEpC,4BAA4B;;sBAAS,iBAAiB;;;;;;;;;;sBAAtD,4BAA6B,SAAQ,WAAiB;YAY/D,YAAY,IAAY,EAAE,IAAY,EAAE,QAAyB,IAAI,EAAE,eAAyB,EAAE,eAAyB;gBACvH,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,8BAA8B,EAAE,KAAK,EAAE,eAAe,EAAE,eAAe,CAAC,CAAC;gBAXxF,SAAI,+CAAW,GAAG,EAAC;gBAGnB,cAAS,uGAAW,GAAG,GAAC;gBAGxB,qBAAgB,mHAAW,GAAG,GAAC;gBAE9B,wBAAmB,kEAAW,CAAC,EAAC;gBAIpC,IAAI,CAAC,oBAAoB,EAAE,CAAC;YAChC,CAAC;YAEM,oBAAoB;gBACvB,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,aAAa,EAAY,CAAC,CAAC;gBAEtD,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;gBAE9B,IAAI,CAAC,KAAK,EAAE,CAAC;oBACT,OAAO;gBACX,CAAC;gBACD,MAAM,SAAS,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC,YAAY,EAAE,CAAC;gBAEnD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I,6BAAJ,IAAI,mFAAe;YAG1B,6KAAO,SAAS,6BAAT,SAAS,6FAAe;YAG/B,kMAAO,gBAAgB,6BAAhB,gBAAgB,2GAAe;;;;;SAR7B,4BAA4B;AAyEzC,aAAa,CAAC,sCAAsC,EAAE,4BAA4B,CAAC,CAAC","sourcesContent":["import { serialize } from \"core/Misc/decorators\";\r\nimport { SerializationHelper } from \"core/Misc/decorators.serialization\";\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 override render(useCameraPostProcess?: boolean) {\r\n this.updateShaderUniforms();\r\n super.render(useCameraPostProcess);\r\n }\r\n\r\n public override 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 override 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 override 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"]}