@babylonjs/procedural-textures 5.0.0-rc.6 → 5.0.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.
- package/brick/brickProceduralTexture.d.ts +35 -35
- package/brick/brickProceduralTexture.fragment.d.ts +5 -5
- package/brick/brickProceduralTexture.fragment.js +8 -8
- package/brick/brickProceduralTexture.js +104 -104
- package/brick/brickProceduralTexture.js.map +1 -1
- package/brick/index.d.ts +1 -1
- package/brick/index.js +1 -1
- package/cloud/cloudProceduralTexture.d.ts +35 -35
- package/cloud/cloudProceduralTexture.fragment.d.ts +5 -5
- package/cloud/cloudProceduralTexture.fragment.js +8 -8
- package/cloud/cloudProceduralTexture.js +104 -104
- package/cloud/cloudProceduralTexture.js.map +1 -1
- package/cloud/index.d.ts +1 -1
- package/cloud/index.js +1 -1
- package/fire/fireProceduralTexture.d.ts +44 -44
- package/fire/fireProceduralTexture.fragment.d.ts +5 -5
- package/fire/fireProceduralTexture.fragment.js +8 -8
- package/fire/fireProceduralTexture.js +166 -166
- package/fire/fireProceduralTexture.js.map +1 -1
- package/fire/index.d.ts +1 -1
- package/fire/index.js +1 -1
- package/grass/grassProceduralTexture.d.ts +29 -29
- package/grass/grassProceduralTexture.fragment.d.ts +5 -5
- package/grass/grassProceduralTexture.fragment.js +8 -8
- package/grass/grassProceduralTexture.js +80 -80
- package/grass/grassProceduralTexture.js.map +1 -1
- package/grass/index.d.ts +1 -1
- package/grass/index.js +1 -1
- package/index.d.ts +10 -10
- package/index.js +11 -10
- package/index.js.map +1 -1
- package/legacy/legacy-brick.d.ts +1 -1
- package/legacy/legacy-brick.js +13 -12
- package/legacy/legacy-brick.js.map +1 -1
- package/legacy/legacy-cloud.d.ts +1 -1
- package/legacy/legacy-cloud.js +13 -12
- package/legacy/legacy-cloud.js.map +1 -1
- package/legacy/legacy-fire.d.ts +1 -1
- package/legacy/legacy-fire.js +13 -12
- package/legacy/legacy-fire.js.map +1 -1
- package/legacy/legacy-grass.d.ts +1 -1
- package/legacy/legacy-grass.js +13 -12
- package/legacy/legacy-grass.js.map +1 -1
- package/legacy/legacy-marble.d.ts +1 -1
- package/legacy/legacy-marble.js +13 -12
- package/legacy/legacy-marble.js.map +1 -1
- package/legacy/legacy-normalMap.d.ts +1 -1
- package/legacy/legacy-normalMap.js +13 -12
- package/legacy/legacy-normalMap.js.map +1 -1
- package/legacy/legacy-perlinNoise.d.ts +1 -1
- package/legacy/legacy-perlinNoise.js +13 -12
- package/legacy/legacy-perlinNoise.js.map +1 -1
- package/legacy/legacy-road.d.ts +1 -1
- package/legacy/legacy-road.js +13 -12
- package/legacy/legacy-road.js.map +1 -1
- package/legacy/legacy-starfield.d.ts +1 -1
- package/legacy/legacy-starfield.js +13 -12
- package/legacy/legacy-starfield.js.map +1 -1
- package/legacy/legacy-wood.d.ts +1 -1
- package/legacy/legacy-wood.js +13 -12
- package/legacy/legacy-wood.js.map +1 -1
- package/legacy/legacy.d.ts +1 -1
- package/legacy/legacy.js +16 -15
- package/legacy/legacy.js.map +1 -1
- package/license.md +71 -0
- package/marble/index.d.ts +1 -1
- package/marble/index.js +1 -1
- package/marble/marbleProceduralTexture.d.ts +35 -35
- package/marble/marbleProceduralTexture.fragment.d.ts +5 -5
- package/marble/marbleProceduralTexture.fragment.js +8 -8
- package/marble/marbleProceduralTexture.js +104 -104
- package/marble/marbleProceduralTexture.js.map +1 -1
- package/normalMap/index.d.ts +1 -1
- package/normalMap/index.js +1 -1
- package/normalMap/normalMapProceduralTexture.d.ts +28 -28
- package/normalMap/normalMapProceduralTexture.fragment.d.ts +5 -5
- package/normalMap/normalMapProceduralTexture.fragment.js +8 -8
- package/normalMap/normalMapProceduralTexture.js +69 -69
- package/normalMap/normalMapProceduralTexture.js.map +1 -1
- package/package.json +24 -5
- package/perlinNoise/index.d.ts +1 -1
- package/perlinNoise/index.js +1 -1
- package/perlinNoise/perlinNoiseProceduralTexture.d.ts +28 -28
- package/perlinNoise/perlinNoiseProceduralTexture.fragment.d.ts +5 -5
- package/perlinNoise/perlinNoiseProceduralTexture.fragment.js +8 -8
- package/perlinNoise/perlinNoiseProceduralTexture.js +69 -69
- package/perlinNoise/perlinNoiseProceduralTexture.js.map +1 -1
- package/road/index.d.ts +1 -1
- package/road/index.js +1 -1
- package/road/roadProceduralTexture.d.ts +26 -26
- package/road/roadProceduralTexture.fragment.d.ts +5 -5
- package/road/roadProceduralTexture.fragment.js +8 -8
- package/road/roadProceduralTexture.js +56 -56
- package/road/roadProceduralTexture.js.map +1 -1
- package/starfield/index.d.ts +1 -1
- package/starfield/index.js +1 -1
- package/starfield/starfieldProceduralTexture.d.ts +55 -55
- package/starfield/starfieldProceduralTexture.fragment.d.ts +5 -5
- package/starfield/starfieldProceduralTexture.fragment.js +8 -8
- package/starfield/starfieldProceduralTexture.js +215 -215
- package/starfield/starfieldProceduralTexture.js.map +1 -1
- package/wood/index.d.ts +1 -1
- package/wood/index.js +1 -1
- package/wood/woodProceduralTexture.d.ts +29 -29
- package/wood/woodProceduralTexture.fragment.d.ts +5 -5
- package/wood/woodProceduralTexture.fragment.js +8 -8
- package/wood/woodProceduralTexture.js +72 -72
- package/wood/woodProceduralTexture.js.map +1 -1
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
import { __decorate, __extends } from "tslib";
|
|
2
|
-
import { serialize, 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 "./woodProceduralTexture.fragment.js";
|
|
7
|
-
var WoodProceduralTexture = /** @class */ (function (_super) {
|
|
8
|
-
__extends(WoodProceduralTexture, _super);
|
|
9
|
-
function WoodProceduralTexture(name, size, scene, fallbackTexture, generateMipMaps) {
|
|
10
|
-
if (scene === void 0) { scene = null; }
|
|
11
|
-
var _this = _super.call(this, name, size, "woodProceduralTexture", scene, fallbackTexture, generateMipMaps) || this;
|
|
12
|
-
_this._ampScale = 100.0;
|
|
13
|
-
_this._woodColor = new Color3(0.32, 0.17, 0.09);
|
|
14
|
-
_this.updateShaderUniforms();
|
|
15
|
-
return _this;
|
|
16
|
-
}
|
|
17
|
-
WoodProceduralTexture.prototype.updateShaderUniforms = function () {
|
|
18
|
-
this.setFloat("ampScale", this._ampScale);
|
|
19
|
-
this.setColor3("woodColor", this._woodColor);
|
|
20
|
-
};
|
|
21
|
-
Object.defineProperty(WoodProceduralTexture.prototype, "ampScale", {
|
|
22
|
-
get: function () {
|
|
23
|
-
return this._ampScale;
|
|
24
|
-
},
|
|
25
|
-
set: function (value) {
|
|
26
|
-
this._ampScale = value;
|
|
27
|
-
this.updateShaderUniforms();
|
|
28
|
-
},
|
|
29
|
-
enumerable: false,
|
|
30
|
-
configurable: true
|
|
31
|
-
});
|
|
32
|
-
Object.defineProperty(WoodProceduralTexture.prototype, "woodColor", {
|
|
33
|
-
get: function () {
|
|
34
|
-
return this._woodColor;
|
|
35
|
-
},
|
|
36
|
-
set: function (value) {
|
|
37
|
-
this._woodColor = value;
|
|
38
|
-
this.updateShaderUniforms();
|
|
39
|
-
},
|
|
40
|
-
enumerable: false,
|
|
41
|
-
configurable: true
|
|
42
|
-
});
|
|
43
|
-
/**
|
|
44
|
-
* Serializes this wood procedural texture
|
|
45
|
-
* @returns a serialized wood procedural texture object
|
|
46
|
-
*/
|
|
47
|
-
WoodProceduralTexture.prototype.serialize = function () {
|
|
48
|
-
var serializationObject = SerializationHelper.Serialize(this, _super.prototype.serialize.call(this));
|
|
49
|
-
serializationObject.customType = "BABYLON.WoodProceduralTexture";
|
|
50
|
-
return serializationObject;
|
|
51
|
-
};
|
|
52
|
-
/**
|
|
53
|
-
* Creates a Wood Procedural Texture from parsed wood 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 wood procedural texture information
|
|
57
|
-
* @returns a parsed Wood Procedural Texture
|
|
58
|
-
*/
|
|
59
|
-
WoodProceduralTexture.Parse = function (parsedTexture, scene, rootUrl) {
|
|
60
|
-
var texture = SerializationHelper.Parse(function () { return new WoodProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps); }, parsedTexture, scene, rootUrl);
|
|
61
|
-
return texture;
|
|
62
|
-
};
|
|
63
|
-
__decorate([
|
|
64
|
-
serialize()
|
|
65
|
-
], WoodProceduralTexture.prototype, "ampScale", null);
|
|
66
|
-
__decorate([
|
|
67
|
-
serializeAsColor3()
|
|
68
|
-
], WoodProceduralTexture.prototype, "woodColor", null);
|
|
69
|
-
return WoodProceduralTexture;
|
|
70
|
-
}(ProceduralTexture));
|
|
71
|
-
export { WoodProceduralTexture };
|
|
72
|
-
RegisterClass("BABYLON.WoodProceduralTexture", WoodProceduralTexture);
|
|
1
|
+
import { __decorate, __extends } from "tslib";
|
|
2
|
+
import { serialize, 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 "./woodProceduralTexture.fragment.js";
|
|
7
|
+
var WoodProceduralTexture = /** @class */ (function (_super) {
|
|
8
|
+
__extends(WoodProceduralTexture, _super);
|
|
9
|
+
function WoodProceduralTexture(name, size, scene, fallbackTexture, generateMipMaps) {
|
|
10
|
+
if (scene === void 0) { scene = null; }
|
|
11
|
+
var _this = _super.call(this, name, size, "woodProceduralTexture", scene, fallbackTexture, generateMipMaps) || this;
|
|
12
|
+
_this._ampScale = 100.0;
|
|
13
|
+
_this._woodColor = new Color3(0.32, 0.17, 0.09);
|
|
14
|
+
_this.updateShaderUniforms();
|
|
15
|
+
return _this;
|
|
16
|
+
}
|
|
17
|
+
WoodProceduralTexture.prototype.updateShaderUniforms = function () {
|
|
18
|
+
this.setFloat("ampScale", this._ampScale);
|
|
19
|
+
this.setColor3("woodColor", this._woodColor);
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(WoodProceduralTexture.prototype, "ampScale", {
|
|
22
|
+
get: function () {
|
|
23
|
+
return this._ampScale;
|
|
24
|
+
},
|
|
25
|
+
set: function (value) {
|
|
26
|
+
this._ampScale = value;
|
|
27
|
+
this.updateShaderUniforms();
|
|
28
|
+
},
|
|
29
|
+
enumerable: false,
|
|
30
|
+
configurable: true
|
|
31
|
+
});
|
|
32
|
+
Object.defineProperty(WoodProceduralTexture.prototype, "woodColor", {
|
|
33
|
+
get: function () {
|
|
34
|
+
return this._woodColor;
|
|
35
|
+
},
|
|
36
|
+
set: function (value) {
|
|
37
|
+
this._woodColor = value;
|
|
38
|
+
this.updateShaderUniforms();
|
|
39
|
+
},
|
|
40
|
+
enumerable: false,
|
|
41
|
+
configurable: true
|
|
42
|
+
});
|
|
43
|
+
/**
|
|
44
|
+
* Serializes this wood procedural texture
|
|
45
|
+
* @returns a serialized wood procedural texture object
|
|
46
|
+
*/
|
|
47
|
+
WoodProceduralTexture.prototype.serialize = function () {
|
|
48
|
+
var serializationObject = SerializationHelper.Serialize(this, _super.prototype.serialize.call(this));
|
|
49
|
+
serializationObject.customType = "BABYLON.WoodProceduralTexture";
|
|
50
|
+
return serializationObject;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Creates a Wood Procedural Texture from parsed wood 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 wood procedural texture information
|
|
57
|
+
* @returns a parsed Wood Procedural Texture
|
|
58
|
+
*/
|
|
59
|
+
WoodProceduralTexture.Parse = function (parsedTexture, scene, rootUrl) {
|
|
60
|
+
var texture = SerializationHelper.Parse(function () { return new WoodProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps); }, parsedTexture, scene, rootUrl);
|
|
61
|
+
return texture;
|
|
62
|
+
};
|
|
63
|
+
__decorate([
|
|
64
|
+
serialize()
|
|
65
|
+
], WoodProceduralTexture.prototype, "ampScale", null);
|
|
66
|
+
__decorate([
|
|
67
|
+
serializeAsColor3()
|
|
68
|
+
], WoodProceduralTexture.prototype, "woodColor", null);
|
|
69
|
+
return WoodProceduralTexture;
|
|
70
|
+
}(ProceduralTexture));
|
|
71
|
+
export { WoodProceduralTexture };
|
|
72
|
+
RegisterClass("BABYLON.WoodProceduralTexture", WoodProceduralTexture);
|
|
73
73
|
//# sourceMappingURL=woodProceduralTexture.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"woodProceduralTexture.js","sourceRoot":"","sources":["../../../../../lts/proceduralTextures/generated/wood/woodProceduralTexture.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,2CAA6B;AACzF,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;IAIxD,+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;QANO,eAAS,GAAW,KAAK,CAAC;QAC1B,gBAAU,GAAW,IAAI,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QAItD,KAAI,CAAC,oBAAoB,EAAE,CAAC;;IAChC,CAAC;IAEM,oDAAoB,GAA3B;QACI,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QAC1C,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IACjD,CAAC;IAGD,sBAAW,2CAAQ;aAAnB;YACI,OAAO,IAAI,CAAC,SAAS,CAAC;QAC1B,CAAC;aAED,UAAoB,KAAa;YAC7B,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;YACvB,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAChC,CAAC;;;OALA;IAQD,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;IA9CD;QADC,SAAS,EAAE;yDAGX;IAQD;QADC,iBAAiB,EAAE;0DAGnB;IAmCL,4BAAC;CAAA,AA9DD,CAA2C,iBAAiB,GA8D3D;SA9DY,qBAAqB;AAgElC,aAAa,CAAC,+BAA+B,EAAE,qBAAqB,CAAC,CAAC","sourcesContent":["import { serialize, serializeAsColor3, SerializationHelper } from \"core/Misc/decorators\";\r\nimport { Color3 } from \"core/Maths/math.color\";\r\nimport { Texture } from \"core/Materials/Textures/texture\";\r\nimport { ProceduralTexture } from \"core/Materials/Textures/Procedurals/proceduralTexture\";\r\nimport { Scene } from \"core/scene\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport { Nullable } from \"core/types\";\r\nimport \"./woodProceduralTexture.fragment\";\r\n\r\nexport class WoodProceduralTexture extends ProceduralTexture {\r\n private _ampScale: number = 100.0;\r\n private _woodColor: Color3 = new Color3(0.32, 0.17, 0.09);\r\n\r\n constructor(name: string, size: number, scene: Nullable<Scene> = null, fallbackTexture?: Texture, generateMipMaps?: boolean) {\r\n super(name, size, \"woodProceduralTexture\", scene, fallbackTexture, generateMipMaps);\r\n this.updateShaderUniforms();\r\n }\r\n\r\n public updateShaderUniforms() {\r\n this.setFloat(\"ampScale\", this._ampScale);\r\n this.setColor3(\"woodColor\", this._woodColor);\r\n }\r\n\r\n @serialize()\r\n public get ampScale(): number {\r\n return this._ampScale;\r\n }\r\n\r\n public set ampScale(value: number) {\r\n this._ampScale = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n @serializeAsColor3()\r\n public get woodColor(): Color3 {\r\n return this._woodColor;\r\n }\r\n\r\n public set woodColor(value: Color3) {\r\n this._woodColor = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n /**\r\n * Serializes this wood procedural texture\r\n * @returns a serialized wood procedural texture object\r\n */\r\n public serialize(): any {\r\n const serializationObject = SerializationHelper.Serialize(this, super.serialize());\r\n serializationObject.customType = \"BABYLON.WoodProceduralTexture\";\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Creates a Wood Procedural Texture from parsed wood 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 wood procedural texture information\r\n * @returns a parsed Wood Procedural Texture\r\n */\r\n public static Parse(parsedTexture: any, scene: Scene, rootUrl: string): WoodProceduralTexture {\r\n const texture = SerializationHelper.Parse(\r\n () => new WoodProceduralTexture(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.WoodProceduralTexture\", WoodProceduralTexture);\r\n"]}
|
|
1
|
+
{"version":3,"file":"woodProceduralTexture.js","sourceRoot":"","sources":["../../../../../lts/proceduralTextures/generated/wood/woodProceduralTexture.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,2CAA6B;AACzF,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;IAIxD,+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;QANO,eAAS,GAAW,KAAK,CAAC;QAC1B,gBAAU,GAAW,IAAI,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QAItD,KAAI,CAAC,oBAAoB,EAAE,CAAC;;IAChC,CAAC;IAEM,oDAAoB,GAA3B;QACI,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QAC1C,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IACjD,CAAC;IAGD,sBAAW,2CAAQ;aAAnB;YACI,OAAO,IAAI,CAAC,SAAS,CAAC;QAC1B,CAAC;aAED,UAAoB,KAAa;YAC7B,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;YACvB,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAChC,CAAC;;;OALA;IAQD,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;IA9CD;QADC,SAAS,EAAE;yDAGX;IAQD;QADC,iBAAiB,EAAE;0DAGnB;IAmCL,4BAAC;CAAA,AA9DD,CAA2C,iBAAiB,GA8D3D;SA9DY,qBAAqB;AAgElC,aAAa,CAAC,+BAA+B,EAAE,qBAAqB,CAAC,CAAC","sourcesContent":["import { serialize, 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 \"./woodProceduralTexture.fragment\";\r\n\r\nexport class WoodProceduralTexture extends ProceduralTexture {\r\n private _ampScale: number = 100.0;\r\n private _woodColor: Color3 = new Color3(0.32, 0.17, 0.09);\r\n\r\n constructor(name: string, size: number, scene: Nullable<Scene> = null, fallbackTexture?: Texture, generateMipMaps?: boolean) {\r\n super(name, size, \"woodProceduralTexture\", scene, fallbackTexture, generateMipMaps);\r\n this.updateShaderUniforms();\r\n }\r\n\r\n public updateShaderUniforms() {\r\n this.setFloat(\"ampScale\", this._ampScale);\r\n this.setColor3(\"woodColor\", this._woodColor);\r\n }\r\n\r\n @serialize()\r\n public get ampScale(): number {\r\n return this._ampScale;\r\n }\r\n\r\n public set ampScale(value: number) {\r\n this._ampScale = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n @serializeAsColor3()\r\n public get woodColor(): Color3 {\r\n return this._woodColor;\r\n }\r\n\r\n public set woodColor(value: Color3) {\r\n this._woodColor = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n /**\r\n * Serializes this wood procedural texture\r\n * @returns a serialized wood procedural texture object\r\n */\r\n public serialize(): any {\r\n const serializationObject = SerializationHelper.Serialize(this, super.serialize());\r\n serializationObject.customType = \"BABYLON.WoodProceduralTexture\";\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Creates a Wood Procedural Texture from parsed wood 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 wood procedural texture information\r\n * @returns a parsed Wood Procedural Texture\r\n */\r\n public static Parse(parsedTexture: any, scene: Scene, rootUrl: string): WoodProceduralTexture {\r\n const texture = SerializationHelper.Parse(\r\n () => new WoodProceduralTexture(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.WoodProceduralTexture\", WoodProceduralTexture);\r\n"]}
|