@babylonjs/procedural-textures 5.0.0-alpha.9 → 5.0.0-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/brick/brickProceduralTexture.d.ts +2 -1
- package/brick/brickProceduralTexture.fragment.js +3 -3
- package/brick/brickProceduralTexture.fragment.js.map +1 -1
- package/brick/brickProceduralTexture.js +7 -6
- package/brick/brickProceduralTexture.js.map +1 -1
- package/brick/index.js +1 -1
- package/cloud/cloudProceduralTexture.d.ts +8 -1
- package/cloud/cloudProceduralTexture.fragment.js +3 -3
- package/cloud/cloudProceduralTexture.fragment.js.map +1 -1
- package/cloud/cloudProceduralTexture.js +39 -6
- package/cloud/cloudProceduralTexture.js.map +1 -1
- package/cloud/index.js +1 -1
- package/fire/fireProceduralTexture.d.ts +2 -1
- package/fire/fireProceduralTexture.fragment.js +2 -2
- package/fire/fireProceduralTexture.fragment.js.map +1 -1
- package/fire/fireProceduralTexture.js +8 -7
- package/fire/fireProceduralTexture.js.map +1 -1
- package/fire/index.js +1 -1
- package/grass/grassProceduralTexture.d.ts +2 -1
- package/grass/grassProceduralTexture.fragment.js +3 -3
- package/grass/grassProceduralTexture.fragment.js.map +1 -1
- package/grass/grassProceduralTexture.js +7 -6
- package/grass/grassProceduralTexture.js.map +1 -1
- package/grass/index.js +1 -1
- package/index.d.ts +10 -10
- package/index.js +10 -10
- package/index.js.map +1 -1
- package/legacy/legacy-brick.js +2 -2
- package/legacy/legacy-cloud.js +2 -2
- package/legacy/legacy-fire.d.ts +1 -1
- package/legacy/legacy-fire.js +2 -2
- package/legacy/legacy-fire.js.map +1 -1
- package/legacy/legacy-grass.d.ts +1 -1
- package/legacy/legacy-grass.js +2 -2
- package/legacy/legacy-grass.js.map +1 -1
- package/legacy/legacy-marble.d.ts +1 -1
- package/legacy/legacy-marble.js +2 -2
- package/legacy/legacy-marble.js.map +1 -1
- package/legacy/legacy-normalMap.d.ts +1 -1
- package/legacy/legacy-normalMap.js +2 -2
- package/legacy/legacy-normalMap.js.map +1 -1
- package/legacy/legacy-perlinNoise.d.ts +1 -1
- package/legacy/legacy-perlinNoise.js +2 -2
- package/legacy/legacy-perlinNoise.js.map +1 -1
- package/legacy/legacy-road.d.ts +1 -1
- package/legacy/legacy-road.js +2 -2
- package/legacy/legacy-road.js.map +1 -1
- package/legacy/legacy-starfield.d.ts +1 -1
- package/legacy/legacy-starfield.js +2 -2
- package/legacy/legacy-starfield.js.map +1 -1
- package/legacy/legacy-wood.d.ts +1 -1
- package/legacy/legacy-wood.js +2 -2
- package/legacy/legacy-wood.js.map +1 -1
- package/legacy/legacy.js +2 -2
- package/marble/index.js +1 -1
- package/marble/marbleProceduralTexture.d.ts +2 -1
- package/marble/marbleProceduralTexture.fragment.js +2 -2
- package/marble/marbleProceduralTexture.fragment.js.map +1 -1
- package/marble/marbleProceduralTexture.js +7 -6
- package/marble/marbleProceduralTexture.js.map +1 -1
- package/normalMap/index.js +1 -1
- package/normalMap/normalMapProceduralTexture.d.ts +2 -1
- package/normalMap/normalMapProceduralTexture.fragment.js +2 -2
- package/normalMap/normalMapProceduralTexture.fragment.js.map +1 -1
- package/normalMap/normalMapProceduralTexture.js +6 -5
- package/normalMap/normalMapProceduralTexture.js.map +1 -1
- package/package.json +3 -3
- package/perlinNoise/index.js +1 -1
- package/perlinNoise/perlinNoiseProceduralTexture.d.ts +2 -1
- package/perlinNoise/perlinNoiseProceduralTexture.fragment.js +3 -3
- package/perlinNoise/perlinNoiseProceduralTexture.fragment.js.map +1 -1
- package/perlinNoise/perlinNoiseProceduralTexture.js +6 -5
- package/perlinNoise/perlinNoiseProceduralTexture.js.map +1 -1
- package/road/index.js +1 -1
- package/road/roadProceduralTexture.d.ts +2 -1
- package/road/roadProceduralTexture.fragment.js +3 -3
- package/road/roadProceduralTexture.fragment.js.map +1 -1
- package/road/roadProceduralTexture.js +7 -6
- package/road/roadProceduralTexture.js.map +1 -1
- package/starfield/index.js +1 -1
- package/starfield/starfieldProceduralTexture.d.ts +2 -1
- package/starfield/starfieldProceduralTexture.fragment.js +2 -2
- package/starfield/starfieldProceduralTexture.fragment.js.map +1 -1
- package/starfield/starfieldProceduralTexture.js +6 -5
- package/starfield/starfieldProceduralTexture.js.map +1 -1
- package/wood/index.js +1 -1
- package/wood/woodProceduralTexture.d.ts +2 -1
- package/wood/woodProceduralTexture.fragment.js +3 -3
- package/wood/woodProceduralTexture.fragment.js.map +1 -1
- package/wood/woodProceduralTexture.js +7 -6
- package/wood/woodProceduralTexture.js.map +1 -1
package/legacy/legacy-cloud.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as proceduralTexture from "../cloud/index";
|
|
1
|
+
import * as proceduralTexture from "../cloud/index.js";
|
|
2
2
|
/**
|
|
3
3
|
* This is the entry point for the UMD module.
|
|
4
4
|
* The entry point for a future ESM package should be index.ts
|
|
@@ -9,5 +9,5 @@ if (typeof globalObject !== "undefined") {
|
|
|
9
9
|
globalObject.BABYLON[key] = proceduralTexture[key];
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
-
export * from "../cloud/index";
|
|
12
|
+
export * from "../cloud/index.js";
|
|
13
13
|
//# sourceMappingURL=legacy-cloud.js.map
|
package/legacy/legacy-fire.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "../fire";
|
|
1
|
+
export * from "../fire/index";
|
package/legacy/legacy-fire.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as proceduralTexture from "../fire";
|
|
1
|
+
import * as proceduralTexture from "../fire/index.js";
|
|
2
2
|
/**
|
|
3
3
|
* This is the entry point for the UMD module.
|
|
4
4
|
* The entry point for a future ESM package should be index.ts
|
|
@@ -9,5 +9,5 @@ if (typeof globalObject !== "undefined") {
|
|
|
9
9
|
globalObject.BABYLON[key] = proceduralTexture[key];
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
-
export * from "../fire";
|
|
12
|
+
export * from "../fire/index.js";
|
|
13
13
|
//# sourceMappingURL=legacy-fire.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"legacy-fire.js","sourceRoot":"","sources":["../../../sourceES6/proceduralTexturesLibrary/src/legacy/legacy-fire.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,iBAAiB,MAAM,
|
|
1
|
+
{"version":3,"file":"legacy-fire.js","sourceRoot":"","sources":["../../../sourceES6/proceduralTexturesLibrary/src/legacy/legacy-fire.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,iBAAiB,MAAM,eAAe,CAAC;AAEnD;;;GAGG;AACH,IAAI,YAAY,GAAG,CAAC,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;AACrH,IAAI,OAAO,YAAY,KAAK,WAAW,EAAE;IACrC,KAAK,IAAI,GAAG,IAAI,iBAAiB,EAAE;QACzB,YAAa,CAAC,OAAO,CAAC,GAAG,CAAC,GAAS,iBAAkB,CAAC,GAAG,CAAC,CAAC;KACpE;CACJ;AAED,cAAc,eAAe,CAAC","sourcesContent":["import * as proceduralTexture from \"../fire/index\";\r\n\r\n/**\r\n * This is the entry point for the UMD module.\r\n * The entry point for a future ESM package should be index.ts\r\n */\r\nvar globalObject = (typeof global !== 'undefined') ? global : ((typeof window !== 'undefined') ? window : undefined);\r\nif (typeof globalObject !== \"undefined\") {\r\n for (var key in proceduralTexture) {\r\n (<any>globalObject).BABYLON[key] = (<any>proceduralTexture)[key];\r\n }\r\n}\r\n\r\nexport * from \"../fire/index\";"]}
|
package/legacy/legacy-grass.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "../grass";
|
|
1
|
+
export * from "../grass/index";
|
package/legacy/legacy-grass.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as proceduralTexture from "../grass";
|
|
1
|
+
import * as proceduralTexture from "../grass/index.js";
|
|
2
2
|
/**
|
|
3
3
|
* This is the entry point for the UMD module.
|
|
4
4
|
* The entry point for a future ESM package should be index.ts
|
|
@@ -9,5 +9,5 @@ if (typeof globalObject !== "undefined") {
|
|
|
9
9
|
globalObject.BABYLON[key] = proceduralTexture[key];
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
-
export * from "../grass";
|
|
12
|
+
export * from "../grass/index.js";
|
|
13
13
|
//# sourceMappingURL=legacy-grass.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"legacy-grass.js","sourceRoot":"","sources":["../../../sourceES6/proceduralTexturesLibrary/src/legacy/legacy-grass.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,iBAAiB,MAAM,
|
|
1
|
+
{"version":3,"file":"legacy-grass.js","sourceRoot":"","sources":["../../../sourceES6/proceduralTexturesLibrary/src/legacy/legacy-grass.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,iBAAiB,MAAM,gBAAgB,CAAC;AAEpD;;;GAGG;AACH,IAAI,YAAY,GAAG,CAAC,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;AACrH,IAAI,OAAO,YAAY,KAAK,WAAW,EAAE;IACrC,KAAK,IAAI,GAAG,IAAI,iBAAiB,EAAE;QACzB,YAAa,CAAC,OAAO,CAAC,GAAG,CAAC,GAAS,iBAAkB,CAAC,GAAG,CAAC,CAAC;KACpE;CACJ;AAED,cAAc,gBAAgB,CAAC","sourcesContent":["import * as proceduralTexture from \"../grass/index\";\r\n\r\n/**\r\n * This is the entry point for the UMD module.\r\n * The entry point for a future ESM package should be index.ts\r\n */\r\nvar globalObject = (typeof global !== 'undefined') ? global : ((typeof window !== 'undefined') ? window : undefined);\r\nif (typeof globalObject !== \"undefined\") {\r\n for (var key in proceduralTexture) {\r\n (<any>globalObject).BABYLON[key] = (<any>proceduralTexture)[key];\r\n }\r\n}\r\n\r\nexport * from \"../grass/index\";"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "../marble";
|
|
1
|
+
export * from "../marble/index";
|
package/legacy/legacy-marble.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as proceduralTexture from "../marble";
|
|
1
|
+
import * as proceduralTexture from "../marble/index.js";
|
|
2
2
|
/**
|
|
3
3
|
* This is the entry point for the UMD module.
|
|
4
4
|
* The entry point for a future ESM package should be index.ts
|
|
@@ -9,5 +9,5 @@ if (typeof globalObject !== "undefined") {
|
|
|
9
9
|
globalObject.BABYLON[key] = proceduralTexture[key];
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
-
export * from "../marble";
|
|
12
|
+
export * from "../marble/index.js";
|
|
13
13
|
//# sourceMappingURL=legacy-marble.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"legacy-marble.js","sourceRoot":"","sources":["../../../sourceES6/proceduralTexturesLibrary/src/legacy/legacy-marble.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,iBAAiB,MAAM,
|
|
1
|
+
{"version":3,"file":"legacy-marble.js","sourceRoot":"","sources":["../../../sourceES6/proceduralTexturesLibrary/src/legacy/legacy-marble.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,iBAAiB,MAAM,iBAAiB,CAAC;AAErD;;;GAGG;AACH,IAAI,YAAY,GAAG,CAAC,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;AACrH,IAAI,OAAO,YAAY,KAAK,WAAW,EAAE;IACrC,KAAK,IAAI,GAAG,IAAI,iBAAiB,EAAE;QACzB,YAAa,CAAC,OAAO,CAAC,GAAG,CAAC,GAAS,iBAAkB,CAAC,GAAG,CAAC,CAAC;KACpE;CACJ;AAED,cAAc,iBAAiB,CAAC","sourcesContent":["import * as proceduralTexture from \"../marble/index\";\r\n\r\n/**\r\n * This is the entry point for the UMD module.\r\n * The entry point for a future ESM package should be index.ts\r\n */\r\nvar globalObject = (typeof global !== 'undefined') ? global : ((typeof window !== 'undefined') ? window : undefined);\r\nif (typeof globalObject !== \"undefined\") {\r\n for (var key in proceduralTexture) {\r\n (<any>globalObject).BABYLON[key] = (<any>proceduralTexture)[key];\r\n }\r\n}\r\n\r\nexport * from \"../marble/index\";"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "../normalMap";
|
|
1
|
+
export * from "../normalMap/index";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as proceduralTexture from "../normalMap";
|
|
1
|
+
import * as proceduralTexture from "../normalMap/index.js";
|
|
2
2
|
/**
|
|
3
3
|
* This is the entry point for the UMD module.
|
|
4
4
|
* The entry point for a future ESM package should be index.ts
|
|
@@ -9,5 +9,5 @@ if (typeof globalObject !== "undefined") {
|
|
|
9
9
|
globalObject.BABYLON[key] = proceduralTexture[key];
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
-
export * from "../normalMap";
|
|
12
|
+
export * from "../normalMap/index.js";
|
|
13
13
|
//# sourceMappingURL=legacy-normalMap.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"legacy-normalMap.js","sourceRoot":"","sources":["../../../sourceES6/proceduralTexturesLibrary/src/legacy/legacy-normalMap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,iBAAiB,MAAM,
|
|
1
|
+
{"version":3,"file":"legacy-normalMap.js","sourceRoot":"","sources":["../../../sourceES6/proceduralTexturesLibrary/src/legacy/legacy-normalMap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,iBAAiB,MAAM,oBAAoB,CAAC;AAExD;;;GAGG;AACH,IAAI,YAAY,GAAG,CAAC,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;AACrH,IAAI,OAAO,YAAY,KAAK,WAAW,EAAE;IACrC,KAAK,IAAI,GAAG,IAAI,iBAAiB,EAAE;QACzB,YAAa,CAAC,OAAO,CAAC,GAAG,CAAC,GAAS,iBAAkB,CAAC,GAAG,CAAC,CAAC;KACpE;CACJ;AAED,cAAc,oBAAoB,CAAC","sourcesContent":["import * as proceduralTexture from \"../normalMap/index\";\r\n\r\n/**\r\n * This is the entry point for the UMD module.\r\n * The entry point for a future ESM package should be index.ts\r\n */\r\nvar globalObject = (typeof global !== 'undefined') ? global : ((typeof window !== 'undefined') ? window : undefined);\r\nif (typeof globalObject !== \"undefined\") {\r\n for (var key in proceduralTexture) {\r\n (<any>globalObject).BABYLON[key] = (<any>proceduralTexture)[key];\r\n }\r\n}\r\n\r\nexport * from \"../normalMap/index\";"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "../perlinNoise";
|
|
1
|
+
export * from "../perlinNoise/index";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as proceduralTexture from "../perlinNoise";
|
|
1
|
+
import * as proceduralTexture from "../perlinNoise/index.js";
|
|
2
2
|
/**
|
|
3
3
|
* This is the entry point for the UMD module.
|
|
4
4
|
* The entry point for a future ESM package should be index.ts
|
|
@@ -9,5 +9,5 @@ if (typeof globalObject !== "undefined") {
|
|
|
9
9
|
globalObject.BABYLON[key] = proceduralTexture[key];
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
-
export * from "../perlinNoise";
|
|
12
|
+
export * from "../perlinNoise/index.js";
|
|
13
13
|
//# sourceMappingURL=legacy-perlinNoise.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"legacy-perlinNoise.js","sourceRoot":"","sources":["../../../sourceES6/proceduralTexturesLibrary/src/legacy/legacy-perlinNoise.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,iBAAiB,MAAM,
|
|
1
|
+
{"version":3,"file":"legacy-perlinNoise.js","sourceRoot":"","sources":["../../../sourceES6/proceduralTexturesLibrary/src/legacy/legacy-perlinNoise.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,iBAAiB,MAAM,sBAAsB,CAAC;AAE1D;;;GAGG;AACH,IAAI,YAAY,GAAG,CAAC,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;AACrH,IAAI,OAAO,YAAY,KAAK,WAAW,EAAE;IACrC,KAAK,IAAI,GAAG,IAAI,iBAAiB,EAAE;QACzB,YAAa,CAAC,OAAO,CAAC,GAAG,CAAC,GAAS,iBAAkB,CAAC,GAAG,CAAC,CAAC;KACpE;CACJ;AAED,cAAc,sBAAsB,CAAC","sourcesContent":["import * as proceduralTexture from \"../perlinNoise/index\";\r\n\r\n/**\r\n * This is the entry point for the UMD module.\r\n * The entry point for a future ESM package should be index.ts\r\n */\r\nvar globalObject = (typeof global !== 'undefined') ? global : ((typeof window !== 'undefined') ? window : undefined);\r\nif (typeof globalObject !== \"undefined\") {\r\n for (var key in proceduralTexture) {\r\n (<any>globalObject).BABYLON[key] = (<any>proceduralTexture)[key];\r\n }\r\n}\r\n\r\nexport * from \"../perlinNoise/index\";"]}
|
package/legacy/legacy-road.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "../road";
|
|
1
|
+
export * from "../road/index";
|
package/legacy/legacy-road.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as proceduralTexture from "../road";
|
|
1
|
+
import * as proceduralTexture from "../road/index.js";
|
|
2
2
|
/**
|
|
3
3
|
* This is the entry point for the UMD module.
|
|
4
4
|
* The entry point for a future ESM package should be index.ts
|
|
@@ -9,5 +9,5 @@ if (typeof globalObject !== "undefined") {
|
|
|
9
9
|
globalObject.BABYLON[key] = proceduralTexture[key];
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
-
export * from "../road";
|
|
12
|
+
export * from "../road/index.js";
|
|
13
13
|
//# sourceMappingURL=legacy-road.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"legacy-road.js","sourceRoot":"","sources":["../../../sourceES6/proceduralTexturesLibrary/src/legacy/legacy-road.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,iBAAiB,MAAM,
|
|
1
|
+
{"version":3,"file":"legacy-road.js","sourceRoot":"","sources":["../../../sourceES6/proceduralTexturesLibrary/src/legacy/legacy-road.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,iBAAiB,MAAM,eAAe,CAAC;AAEnD;;;GAGG;AACH,IAAI,YAAY,GAAG,CAAC,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;AACrH,IAAI,OAAO,YAAY,KAAK,WAAW,EAAE;IACrC,KAAK,IAAI,GAAG,IAAI,iBAAiB,EAAE;QACzB,YAAa,CAAC,OAAO,CAAC,GAAG,CAAC,GAAS,iBAAkB,CAAC,GAAG,CAAC,CAAC;KACpE;CACJ;AAED,cAAc,eAAe,CAAC","sourcesContent":["import * as proceduralTexture from \"../road/index\";\r\n\r\n/**\r\n * This is the entry point for the UMD module.\r\n * The entry point for a future ESM package should be index.ts\r\n */\r\nvar globalObject = (typeof global !== 'undefined') ? global : ((typeof window !== 'undefined') ? window : undefined);\r\nif (typeof globalObject !== \"undefined\") {\r\n for (var key in proceduralTexture) {\r\n (<any>globalObject).BABYLON[key] = (<any>proceduralTexture)[key];\r\n }\r\n}\r\n\r\nexport * from \"../road/index\";"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "../starfield";
|
|
1
|
+
export * from "../starfield/index";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as proceduralTexture from "../starfield";
|
|
1
|
+
import * as proceduralTexture from "../starfield/index.js";
|
|
2
2
|
/**
|
|
3
3
|
* This is the entry point for the UMD module.
|
|
4
4
|
* The entry point for a future ESM package should be index.ts
|
|
@@ -9,5 +9,5 @@ if (typeof globalObject !== "undefined") {
|
|
|
9
9
|
globalObject.BABYLON[key] = proceduralTexture[key];
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
-
export * from "../starfield";
|
|
12
|
+
export * from "../starfield/index.js";
|
|
13
13
|
//# sourceMappingURL=legacy-starfield.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"legacy-starfield.js","sourceRoot":"","sources":["../../../sourceES6/proceduralTexturesLibrary/src/legacy/legacy-starfield.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,iBAAiB,MAAM,
|
|
1
|
+
{"version":3,"file":"legacy-starfield.js","sourceRoot":"","sources":["../../../sourceES6/proceduralTexturesLibrary/src/legacy/legacy-starfield.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,iBAAiB,MAAM,oBAAoB,CAAC;AAExD;;;GAGG;AACH,IAAI,YAAY,GAAG,CAAC,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;AACrH,IAAI,OAAO,YAAY,KAAK,WAAW,EAAE;IACrC,KAAK,IAAI,GAAG,IAAI,iBAAiB,EAAE;QACzB,YAAa,CAAC,OAAO,CAAC,GAAG,CAAC,GAAS,iBAAkB,CAAC,GAAG,CAAC,CAAC;KACpE;CACJ;AAED,cAAc,oBAAoB,CAAC","sourcesContent":["import * as proceduralTexture from \"../starfield/index\";\r\n\r\n/**\r\n * This is the entry point for the UMD module.\r\n * The entry point for a future ESM package should be index.ts\r\n */\r\nvar globalObject = (typeof global !== 'undefined') ? global : ((typeof window !== 'undefined') ? window : undefined);\r\nif (typeof globalObject !== \"undefined\") {\r\n for (var key in proceduralTexture) {\r\n (<any>globalObject).BABYLON[key] = (<any>proceduralTexture)[key];\r\n }\r\n}\r\n\r\nexport * from \"../starfield/index\";"]}
|
package/legacy/legacy-wood.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "../wood";
|
|
1
|
+
export * from "../wood/index";
|
package/legacy/legacy-wood.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as proceduralTexture from "../wood";
|
|
1
|
+
import * as proceduralTexture from "../wood/index.js";
|
|
2
2
|
/**
|
|
3
3
|
* This is the entry point for the UMD module.
|
|
4
4
|
* The entry point for a future ESM package should be index.ts
|
|
@@ -9,5 +9,5 @@ if (typeof globalObject !== "undefined") {
|
|
|
9
9
|
globalObject.BABYLON[key] = proceduralTexture[key];
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
-
export * from "../wood";
|
|
12
|
+
export * from "../wood/index.js";
|
|
13
13
|
//# sourceMappingURL=legacy-wood.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"legacy-wood.js","sourceRoot":"","sources":["../../../sourceES6/proceduralTexturesLibrary/src/legacy/legacy-wood.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,iBAAiB,MAAM,
|
|
1
|
+
{"version":3,"file":"legacy-wood.js","sourceRoot":"","sources":["../../../sourceES6/proceduralTexturesLibrary/src/legacy/legacy-wood.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,iBAAiB,MAAM,eAAe,CAAC;AAEnD;;;GAGG;AACH,IAAI,YAAY,GAAG,CAAC,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;AACrH,IAAI,OAAO,YAAY,KAAK,WAAW,EAAE;IACrC,KAAK,IAAI,GAAG,IAAI,iBAAiB,EAAE;QACzB,YAAa,CAAC,OAAO,CAAC,GAAG,CAAC,GAAS,iBAAkB,CAAC,GAAG,CAAC,CAAC;KACpE;CACJ;AAED,cAAc,eAAe,CAAC","sourcesContent":["import * as proceduralTexture from \"../wood/index\";\r\n\r\n/**\r\n * This is the entry point for the UMD module.\r\n * The entry point for a future ESM package should be index.ts\r\n */\r\nvar globalObject = (typeof global !== 'undefined') ? global : ((typeof window !== 'undefined') ? window : undefined);\r\nif (typeof globalObject !== \"undefined\") {\r\n for (var key in proceduralTexture) {\r\n (<any>globalObject).BABYLON[key] = (<any>proceduralTexture)[key];\r\n }\r\n}\r\n\r\nexport * from \"../wood/index\";"]}
|
package/legacy/legacy.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as ProceduralTexturesLib from "../index";
|
|
1
|
+
import * as ProceduralTexturesLib from "../index.js";
|
|
2
2
|
/**
|
|
3
3
|
* Legacy support, defining window.BABYLON.GridMaterial... (global variable).
|
|
4
4
|
*
|
|
@@ -12,5 +12,5 @@ if (typeof globalObject !== "undefined") {
|
|
|
12
12
|
globalObject.BABYLON[mat] = ProceduralTexturesLib[mat];
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
-
export * from "../index";
|
|
15
|
+
export * from "../index.js";
|
|
16
16
|
//# sourceMappingURL=legacy.js.map
|
package/marble/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./marbleProceduralTexture";
|
|
1
|
+
export * from "./marbleProceduralTexture.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -2,13 +2,14 @@ import { Color3 } from "@babylonjs/core/Maths/math.color";
|
|
|
2
2
|
import { Texture } from "@babylonjs/core/Materials/Textures/texture";
|
|
3
3
|
import { ProceduralTexture } from "@babylonjs/core/Materials/Textures/Procedurals/proceduralTexture";
|
|
4
4
|
import { Scene } from "@babylonjs/core/scene";
|
|
5
|
+
import { Nullable } from "@babylonjs/core/types";
|
|
5
6
|
import "./marbleProceduralTexture.fragment";
|
|
6
7
|
export declare class MarbleProceduralTexture extends ProceduralTexture {
|
|
7
8
|
private _numberOfTilesHeight;
|
|
8
9
|
private _numberOfTilesWidth;
|
|
9
10
|
private _amplitude;
|
|
10
11
|
private _jointColor;
|
|
11
|
-
constructor(name: string, size: number, scene
|
|
12
|
+
constructor(name: string, size: number, scene?: Nullable<Scene>, fallbackTexture?: Texture, generateMipMaps?: boolean);
|
|
12
13
|
updateShaderUniforms(): void;
|
|
13
14
|
get numberOfTilesHeight(): number;
|
|
14
15
|
set numberOfTilesHeight(value: number);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ShaderStore } from "@babylonjs/core/Engines/shaderStore.js";
|
|
2
2
|
var name = 'marbleProceduralTexturePixelShader';
|
|
3
3
|
var shader = "precision highp float;\nvarying vec2 vPosition;\nvarying vec2 vUV;\nuniform float numberOfTilesHeight;\nuniform float numberOfTilesWidth;\nuniform float amplitude;\nuniform vec3 marbleColor;\nuniform vec3 jointColor;\nconst vec3 tileSize=vec3(1.1,1.0,1.1);\nconst vec3 tilePct=vec3(0.98,1.0,0.98);\nfloat rand(vec2 n) {\nreturn fract(cos(dot(n,vec2(12.9898,4.1414)))*43758.5453);\n}\nfloat noise(vec2 n) {\nconst vec2 d=vec2(0.0,1.0);\nvec2 b=floor(n),f=smoothstep(vec2(0.0),vec2(1.0),fract(n));\nreturn mix(mix(rand(b),rand(b+d.yx),f.x),mix(rand(b+d.xy),rand(b+d.yy),f.x),f.y);\n}\nfloat turbulence(vec2 P)\n{\nfloat val=0.0;\nfloat freq=1.0;\nfor (int i=0; i<4; i++)\n{\nval+=abs(noise(P*freq)/freq);\nfreq*=2.07;\n}\nreturn val;\n}\nfloat roundF(float number){\nreturn sign(number)*floor(abs(number)+0.5);\n}\nvec3 marble_color(float x)\n{\nvec3 col;\nx=0.5*(x+1.);\nx=sqrt(x);\nx=sqrt(x);\nx=sqrt(x);\ncol=vec3(.2+.75*x);\ncol.b*=0.95;\nreturn col;\n}\nvoid main()\n{\nfloat brickW=1.0/numberOfTilesWidth;\nfloat brickH=1.0/numberOfTilesHeight;\nfloat jointWPercentage=0.01;\nfloat jointHPercentage=0.01;\nvec3 color=marbleColor;\nfloat yi=vUV.y/brickH;\nfloat nyi=roundF(yi);\nfloat xi=vUV.x/brickW;\nif (mod(floor(yi),2.0) == 0.0){\nxi=xi-0.5;\n}\nfloat nxi=roundF(xi);\nvec2 brickvUV=vec2((xi-floor(xi))/brickH,(yi-floor(yi))/brickW);\nif (yi<nyi+jointHPercentage && yi>nyi-jointHPercentage){\ncolor=mix(jointColor,vec3(0.37,0.25,0.25),(yi-nyi)/jointHPercentage+0.2);\n}\nelse if (xi<nxi+jointWPercentage && xi>nxi-jointWPercentage){\ncolor=mix(jointColor,vec3(0.44,0.44,0.44),(xi-nxi)/jointWPercentage+0.2);\n}\nelse {\nfloat t=6.28*brickvUV.x/(tileSize.x+noise(vec2(vUV)*6.0));\nt+=amplitude*turbulence(brickvUV.xy);\nt=sin(t);\ncolor=marble_color(t);\n}\ngl_FragColor=vec4(color,0.0);\n}";
|
|
4
|
-
|
|
4
|
+
ShaderStore.ShadersStore[name] = shader;
|
|
5
5
|
/** @hidden */
|
|
6
6
|
export var marbleProceduralTexturePixelShader = { name: name, shader: shader };
|
|
7
7
|
//# sourceMappingURL=marbleProceduralTexture.fragment.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"marbleProceduralTexture.fragment.js","sourceRoot":"","sources":["../../../sourceES6/proceduralTexturesLibrary/src/marble/marbleProceduralTexture.fragment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"marbleProceduralTexture.fragment.js","sourceRoot":"","sources":["../../../sourceES6/proceduralTexturesLibrary/src/marble/marbleProceduralTexture.fragment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAElE,IAAI,IAAI,GAAG,oCAAoC,CAAC;AAChD,IAAI,MAAM,GAAG,uwDAuEX,CAAC;AAEH,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACxC,cAAc;AACd,MAAM,CAAC,IAAI,kCAAkC,GAAG,EAAE,IAAI,MAAA,EAAE,MAAM,QAAA,EAAE,CAAC","sourcesContent":["import { ShaderStore } from \"@babylonjs/core/Engines/shaderStore\";\n\nlet name = 'marbleProceduralTexturePixelShader';\nlet shader = `precision highp float;\nvarying vec2 vPosition;\nvarying vec2 vUV;\nuniform float numberOfTilesHeight;\nuniform float numberOfTilesWidth;\nuniform float amplitude;\nuniform vec3 marbleColor;\nuniform vec3 jointColor;\nconst vec3 tileSize=vec3(1.1,1.0,1.1);\nconst vec3 tilePct=vec3(0.98,1.0,0.98);\nfloat rand(vec2 n) {\nreturn fract(cos(dot(n,vec2(12.9898,4.1414)))*43758.5453);\n}\nfloat noise(vec2 n) {\nconst vec2 d=vec2(0.0,1.0);\nvec2 b=floor(n),f=smoothstep(vec2(0.0),vec2(1.0),fract(n));\nreturn mix(mix(rand(b),rand(b+d.yx),f.x),mix(rand(b+d.xy),rand(b+d.yy),f.x),f.y);\n}\nfloat turbulence(vec2 P)\n{\nfloat val=0.0;\nfloat freq=1.0;\nfor (int i=0; i<4; i++)\n{\nval+=abs(noise(P*freq)/freq);\nfreq*=2.07;\n}\nreturn val;\n}\nfloat roundF(float number){\nreturn sign(number)*floor(abs(number)+0.5);\n}\nvec3 marble_color(float x)\n{\nvec3 col;\nx=0.5*(x+1.);\nx=sqrt(x);\nx=sqrt(x);\nx=sqrt(x);\ncol=vec3(.2+.75*x);\ncol.b*=0.95;\nreturn col;\n}\nvoid main()\n{\nfloat brickW=1.0/numberOfTilesWidth;\nfloat brickH=1.0/numberOfTilesHeight;\nfloat jointWPercentage=0.01;\nfloat jointHPercentage=0.01;\nvec3 color=marbleColor;\nfloat yi=vUV.y/brickH;\nfloat nyi=roundF(yi);\nfloat xi=vUV.x/brickW;\nif (mod(floor(yi),2.0) == 0.0){\nxi=xi-0.5;\n}\nfloat nxi=roundF(xi);\nvec2 brickvUV=vec2((xi-floor(xi))/brickH,(yi-floor(yi))/brickW);\nif (yi<nyi+jointHPercentage && yi>nyi-jointHPercentage){\ncolor=mix(jointColor,vec3(0.37,0.25,0.25),(yi-nyi)/jointHPercentage+0.2);\n}\nelse if (xi<nxi+jointWPercentage && xi>nxi-jointWPercentage){\ncolor=mix(jointColor,vec3(0.44,0.44,0.44),(xi-nxi)/jointWPercentage+0.2);\n}\nelse {\nfloat t=6.28*brickvUV.x/(tileSize.x+noise(vec2(vUV)*6.0));\nt+=amplitude*turbulence(brickvUV.xy);\nt=sin(t);\ncolor=marble_color(t);\n}\ngl_FragColor=vec4(color,0.0);\n}`;\n\nShaderStore.ShadersStore[name] = shader;\n/** @hidden */\nexport var marbleProceduralTexturePixelShader = { name, shader };\n"]}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { __decorate, __extends } from "tslib";
|
|
2
|
-
import { serialize, SerializationHelper } from "@babylonjs/core/Misc/decorators";
|
|
3
|
-
import { Color3 } from "@babylonjs/core/Maths/math.color";
|
|
4
|
-
import { ProceduralTexture } from "@babylonjs/core/Materials/Textures/Procedurals/proceduralTexture";
|
|
5
|
-
import {
|
|
6
|
-
import "./marbleProceduralTexture.fragment";
|
|
2
|
+
import { serialize, 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 "./marbleProceduralTexture.fragment.js";
|
|
7
7
|
var MarbleProceduralTexture = /** @class */ (function (_super) {
|
|
8
8
|
__extends(MarbleProceduralTexture, _super);
|
|
9
9
|
function MarbleProceduralTexture(name, size, scene, fallbackTexture, generateMipMaps) {
|
|
10
|
+
if (scene === void 0) { scene = null; }
|
|
10
11
|
var _this = _super.call(this, name, size, "marbleProceduralTexture", scene, fallbackTexture, generateMipMaps) || this;
|
|
11
12
|
_this._numberOfTilesHeight = 3;
|
|
12
13
|
_this._numberOfTilesWidth = 3;
|
|
@@ -100,5 +101,5 @@ var MarbleProceduralTexture = /** @class */ (function (_super) {
|
|
|
100
101
|
return MarbleProceduralTexture;
|
|
101
102
|
}(ProceduralTexture));
|
|
102
103
|
export { MarbleProceduralTexture };
|
|
103
|
-
|
|
104
|
+
RegisterClass("BABYLON.MarbleProceduralTexture", MarbleProceduralTexture);
|
|
104
105
|
//# sourceMappingURL=marbleProceduralTexture.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"marbleProceduralTexture.js","sourceRoot":"","sources":["../../../sourceES6/proceduralTexturesLibrary/src/marble/marbleProceduralTexture.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACjF,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAE1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kEAAkE,CAAC;AAErG,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"marbleProceduralTexture.js","sourceRoot":"","sources":["../../../sourceES6/proceduralTexturesLibrary/src/marble/marbleProceduralTexture.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACjF,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAE1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kEAAkE,CAAC;AAErG,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAG/D,OAAO,oCAAoC,CAAC;AAE5C;IAA6C,2CAAiB;IAM1D,iCAAY,IAAY,EAAE,IAAY,EAAE,KAA6B,EAAE,eAAyB,EAAE,eAAyB;QAAnF,sBAAA,EAAA,YAA6B;QAArE,YACI,kBAAM,IAAI,EAAE,IAAI,EAAE,yBAAyB,EAAE,KAAK,EAAE,eAAe,EAAE,eAAe,CAAC,SAExF;QARO,0BAAoB,GAAW,CAAC,CAAC;QACjC,yBAAmB,GAAW,CAAC,CAAC;QAChC,gBAAU,GAAW,GAAG,CAAC;QACzB,iBAAW,GAAG,IAAI,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QAI/C,KAAI,CAAC,oBAAoB,EAAE,CAAC;;IAChC,CAAC;IAEM,sDAAoB,GAA3B;QACI,IAAI,CAAC,QAAQ,CAAC,qBAAqB,EAAE,IAAI,CAAC,oBAAoB,CAAC,CAAC;QAChE,IAAI,CAAC,QAAQ,CAAC,oBAAoB,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;QAC9D,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QAC5C,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IACnD,CAAC;IAGD,sBAAW,wDAAmB;aAA9B;YACI,OAAO,IAAI,CAAC,oBAAoB,CAAC;QACrC,CAAC;aAED,UAA+B,KAAa;YACxC,IAAI,CAAC,oBAAoB,GAAG,KAAK,CAAC;YAClC,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAChC,CAAC;;;OALA;IAQD,sBAAW,8CAAS;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;IAQD,sBAAW,uDAAkB;aAA7B;YACI,OAAO,IAAI,CAAC,mBAAmB,CAAC;QACpC,CAAC;aAED,UAA8B,KAAa;YACvC,IAAI,CAAC,mBAAmB,GAAG,KAAK,CAAC;YACjC,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAChC,CAAC;;;OALA;IAQD,sBAAW,+CAAU;aAArB;YACI,OAAO,IAAI,CAAC,WAAW,CAAC;QAC5B,CAAC;aAED,UAAsB,KAAa;YAC/B,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;YACzB,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAChC,CAAC;;;OALA;IAOD;;;OAGG;IACI,2CAAS,GAAhB;QACI,IAAI,mBAAmB,GAAG,mBAAmB,CAAC,SAAS,CAAC,IAAI,EAAE,iBAAM,SAAS,WAAE,CAAC,CAAC;QACjF,mBAAmB,CAAC,UAAU,GAAG,iCAAiC,CAAC;QAEnE,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAED;;;;;;OAMG;IACW,6BAAK,GAAnB,UAAoB,aAAkB,EAAE,KAAY,EAAE,OAAe;QACjE,IAAI,OAAO,GAAG,mBAAmB,CAAC,KAAK,CAAC,cAAM,OAAA,IAAI,uBAAuB,CAAC,aAAa,CAAC,IAAI,EAAE,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,aAAa,CAAC,gBAAgB,CAAC,EAAtH,CAAsH,EAAE,aAAa,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;QAErM,OAAO,OAAO,CAAC;IACnB,CAAC;IA7DD;QADC,SAAS,EAAE;sEAGX;IAQD;QADC,SAAS,EAAE;4DAGX;IAQD;QADC,SAAS,EAAE;qEAGX;IAQD;QADC,SAAS,EAAE;6DAGX;IA8BL,8BAAC;CAAA,AAjFD,CAA6C,iBAAiB,GAiF7D;SAjFY,uBAAuB;AAmFpC,aAAa,CAAC,iCAAiC,EAAE,uBAAuB,CAAC,CAAC","sourcesContent":["import { serialize, 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\n\r\nimport \"./marbleProceduralTexture.fragment\";\r\n\r\nexport class MarbleProceduralTexture extends ProceduralTexture {\r\n private _numberOfTilesHeight: number = 3;\r\n private _numberOfTilesWidth: number = 3;\r\n private _amplitude: number = 9.0;\r\n private _jointColor = new Color3(0.72, 0.72, 0.72);\r\n\r\n constructor(name: string, size: number, scene: Nullable<Scene> = null, fallbackTexture?: Texture, generateMipMaps?: boolean) {\r\n super(name, size, \"marbleProceduralTexture\", scene, fallbackTexture, generateMipMaps);\r\n this.updateShaderUniforms();\r\n }\r\n\r\n public updateShaderUniforms() {\r\n this.setFloat(\"numberOfTilesHeight\", this._numberOfTilesHeight);\r\n this.setFloat(\"numberOfTilesWidth\", this._numberOfTilesWidth);\r\n this.setFloat(\"amplitude\", this._amplitude);\r\n this.setColor3(\"jointColor\", this._jointColor);\r\n }\r\n\r\n @serialize()\r\n public get numberOfTilesHeight(): number {\r\n return this._numberOfTilesHeight;\r\n }\r\n\r\n public set numberOfTilesHeight(value: number) {\r\n this._numberOfTilesHeight = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n @serialize()\r\n public get amplitude(): number {\r\n return this._amplitude;\r\n }\r\n\r\n public set amplitude(value: number) {\r\n this._amplitude = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n @serialize()\r\n public get numberOfTilesWidth(): number {\r\n return this._numberOfTilesWidth;\r\n }\r\n\r\n public set numberOfTilesWidth(value: number) {\r\n this._numberOfTilesWidth = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n @serialize()\r\n public get jointColor(): Color3 {\r\n return this._jointColor;\r\n }\r\n\r\n public set jointColor(value: Color3) {\r\n this._jointColor = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n /**\r\n * Serializes this marble procedural texture\r\n * @returns a serialized marble procedural texture object\r\n */\r\n public serialize(): any {\r\n var serializationObject = SerializationHelper.Serialize(this, super.serialize());\r\n serializationObject.customType = \"BABYLON.MarbleProceduralTexture\";\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Creates a Marble Procedural Texture from parsed marble procedural texture data\r\n * @param parsedTexture defines parsed texture data\r\n * @param scene defines the current scene\r\n * @param rootUrl defines the root URL containing marble procedural texture information\r\n * @returns a parsed Marble Procedural Texture\r\n */\r\n public static Parse(parsedTexture: any, scene: Scene, rootUrl: string): MarbleProceduralTexture {\r\n var texture = SerializationHelper.Parse(() => new MarbleProceduralTexture(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.MarbleProceduralTexture\", MarbleProceduralTexture);"]}
|
package/normalMap/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./normalMapProceduralTexture";
|
|
1
|
+
export * from "./normalMapProceduralTexture.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { Texture } from "@babylonjs/core/Materials/Textures/texture";
|
|
2
2
|
import { ProceduralTexture } from "@babylonjs/core/Materials/Textures/Procedurals/proceduralTexture";
|
|
3
3
|
import { Scene } from "@babylonjs/core/scene";
|
|
4
|
+
import { Nullable } from "@babylonjs/core/types";
|
|
4
5
|
import "./normalMapProceduralTexture.fragment";
|
|
5
6
|
export declare class NormalMapProceduralTexture extends ProceduralTexture {
|
|
6
7
|
private _baseTexture;
|
|
7
|
-
constructor(name: string, size: number, scene
|
|
8
|
+
constructor(name: string, size: number, scene?: Nullable<Scene>, fallbackTexture?: Texture, generateMipMaps?: boolean);
|
|
8
9
|
updateShaderUniforms(): void;
|
|
9
10
|
render(useCameraPostProcess?: boolean): void;
|
|
10
11
|
resize(size: any, generateMipMaps: any): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ShaderStore } from "@babylonjs/core/Engines/shaderStore.js";
|
|
2
2
|
var name = 'normalMapProceduralTexturePixelShader';
|
|
3
3
|
var shader = "precision highp float;\n\nuniform sampler2D baseSampler;\nuniform float size;\n\nvarying vec2 vUV;\n\nconst vec3 LUMA_COEFFICIENT=vec3(0.2126,0.7152,0.0722);\nfloat lumaAtCoord(vec2 coord)\n{\nvec3 pixel=texture2D(baseSampler,coord).rgb;\nfloat luma=dot(pixel,LUMA_COEFFICIENT);\nreturn luma;\n}\nvoid main()\n{\nfloat lumaU0=lumaAtCoord(vUV+vec2(-1.0,0.0)/size);\nfloat lumaU1=lumaAtCoord(vUV+vec2( 1.0,0.0)/size);\nfloat lumaV0=lumaAtCoord(vUV+vec2( 0.0,-1.0)/size);\nfloat lumaV1=lumaAtCoord(vUV+vec2( 0.0,1.0)/size);\nvec2 slope=(vec2(lumaU0-lumaU1,lumaV0-lumaV1)+1.0)*0.5;\ngl_FragColor=vec4(slope,1.0,1.0);\n}\n";
|
|
4
|
-
|
|
4
|
+
ShaderStore.ShadersStore[name] = shader;
|
|
5
5
|
/** @hidden */
|
|
6
6
|
export var normalMapProceduralTexturePixelShader = { name: name, shader: shader };
|
|
7
7
|
//# sourceMappingURL=normalMapProceduralTexture.fragment.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalMapProceduralTexture.fragment.js","sourceRoot":"","sources":["../../../sourceES6/proceduralTexturesLibrary/src/normalMap/normalMapProceduralTexture.fragment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"normalMapProceduralTexture.fragment.js","sourceRoot":"","sources":["../../../sourceES6/proceduralTexturesLibrary/src/normalMap/normalMapProceduralTexture.fragment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAElE,IAAI,IAAI,GAAG,uCAAuC,CAAC;AACnD,IAAI,MAAM,GAAG,2mBAuBZ,CAAC;AAEF,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 = 'normalMapProceduralTexturePixelShader';\nlet shader = `precision highp float;\n\nuniform sampler2D baseSampler;\nuniform float size;\n\nvarying vec2 vUV;\n\nconst vec3 LUMA_COEFFICIENT=vec3(0.2126,0.7152,0.0722);\nfloat lumaAtCoord(vec2 coord)\n{\nvec3 pixel=texture2D(baseSampler,coord).rgb;\nfloat luma=dot(pixel,LUMA_COEFFICIENT);\nreturn luma;\n}\nvoid main()\n{\nfloat lumaU0=lumaAtCoord(vUV+vec2(-1.0,0.0)/size);\nfloat lumaU1=lumaAtCoord(vUV+vec2( 1.0,0.0)/size);\nfloat lumaV0=lumaAtCoord(vUV+vec2( 0.0,-1.0)/size);\nfloat lumaV1=lumaAtCoord(vUV+vec2( 0.0,1.0)/size);\nvec2 slope=(vec2(lumaU0-lumaU1,lumaV0-lumaV1)+1.0)*0.5;\ngl_FragColor=vec4(slope,1.0,1.0);\n}\n`;\n\nShaderStore.ShadersStore[name] = shader;\n/** @hidden */\nexport var normalMapProceduralTexturePixelShader = { name, shader };\n"]}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { __decorate, __extends } from "tslib";
|
|
2
|
-
import { serializeAsTexture, SerializationHelper } from "@babylonjs/core/Misc/decorators";
|
|
3
|
-
import { ProceduralTexture } from "@babylonjs/core/Materials/Textures/Procedurals/proceduralTexture";
|
|
4
|
-
import {
|
|
5
|
-
import "./normalMapProceduralTexture.fragment";
|
|
2
|
+
import { serializeAsTexture, 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 "./normalMapProceduralTexture.fragment.js";
|
|
6
6
|
var NormalMapProceduralTexture = /** @class */ (function (_super) {
|
|
7
7
|
__extends(NormalMapProceduralTexture, _super);
|
|
8
8
|
function NormalMapProceduralTexture(name, size, scene, fallbackTexture, generateMipMaps) {
|
|
9
|
+
if (scene === void 0) { scene = null; }
|
|
9
10
|
var _this = _super.call(this, name, size, "normalMapProceduralTexture", scene, fallbackTexture, generateMipMaps) || this;
|
|
10
11
|
_this.updateShaderUniforms();
|
|
11
12
|
return _this;
|
|
@@ -65,5 +66,5 @@ var NormalMapProceduralTexture = /** @class */ (function (_super) {
|
|
|
65
66
|
return NormalMapProceduralTexture;
|
|
66
67
|
}(ProceduralTexture));
|
|
67
68
|
export { NormalMapProceduralTexture };
|
|
68
|
-
|
|
69
|
+
RegisterClass("BABYLON.NormalMapProceduralTexture", NormalMapProceduralTexture);
|
|
69
70
|
//# sourceMappingURL=normalMapProceduralTexture.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalMapProceduralTexture.js","sourceRoot":"","sources":["../../../sourceES6/proceduralTexturesLibrary/src/normalMap/normalMapProceduralTexture.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAE1F,OAAO,EAAE,iBAAiB,EAAE,MAAM,kEAAkE,CAAC;AAErG,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"normalMapProceduralTexture.js","sourceRoot":"","sources":["../../../sourceES6/proceduralTexturesLibrary/src/normalMap/normalMapProceduralTexture.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAE1F,OAAO,EAAE,iBAAiB,EAAE,MAAM,kEAAkE,CAAC;AAErG,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAE/D,OAAO,uCAAuC,CAAC;AAE/C;IAAgD,8CAAiB;IAG7D,oCAAY,IAAY,EAAE,IAAY,EAAE,KAA6B,EAAE,eAAyB,EAAE,eAAyB;QAAnF,sBAAA,EAAA,YAA6B;QAArE,YACI,kBAAM,IAAI,EAAE,IAAI,EAAE,4BAA4B,EAAE,KAAK,EAAE,eAAe,EAAE,eAAe,CAAC,SAE3F;QADG,KAAI,CAAC,oBAAoB,EAAE,CAAC;;IAChC,CAAC;IAEM,yDAAoB,GAA3B;QACI,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QAClD,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,aAAa,EAAY,CAAC,CAAC;IAC1D,CAAC;IAEM,2CAAM,GAAb,UAAc,oBAA8B;QACxC,iBAAM,MAAM,YAAC,oBAAoB,CAAC,CAAC;IACvC,CAAC;IAEM,2CAAM,GAAb,UAAc,IAAS,EAAE,eAAoB;QACzC,iBAAM,MAAM,YAAC,IAAI,EAAE,eAAe,CAAC,CAAC;QAEpC,uCAAuC;QACvC,IAAI,CAAC,oBAAoB,EAAE,CAAC;IAChC,CAAC;IAEM,4CAAO,GAAd;QACI,IAAI,CAAC,IAAI,CAAC,YAAY,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,EAAE;YACpD,OAAO,KAAK,CAAC;SAChB;QAED,OAAO,iBAAM,OAAO,WAAE,CAAC;IAC3B,CAAC;IAGD,sBAAW,mDAAW;aAAtB;YACI,OAAO,IAAI,CAAC,YAAY,CAAC;QAC7B,CAAC;aAED,UAAuB,OAAgB;YACnC,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC;YAC5B,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAChC,CAAC;;;OALA;IAOD;;;OAGG;IACI,8CAAS,GAAhB;QACI,IAAI,mBAAmB,GAAG,mBAAmB,CAAC,SAAS,CAAC,IAAI,EAAE,iBAAM,SAAS,WAAE,CAAC,CAAC;QACjF,mBAAmB,CAAC,UAAU,GAAG,oCAAoC,CAAC;QAEtE,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAED;;;;;;OAMG;IACW,gCAAK,GAAnB,UAAoB,aAAkB,EAAE,KAAY,EAAE,OAAe;QACjE,IAAI,OAAO,GAAG,mBAAmB,CAAC,KAAK,CAAC,cAAM,OAAA,IAAI,0BAA0B,CAAC,aAAa,CAAC,IAAI,EAAE,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,aAAa,CAAC,gBAAgB,CAAC,EAAzH,CAAyH,EAAE,aAAa,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;QAExM,OAAO,OAAO,CAAC;IACnB,CAAC;IA/BD;QADC,kBAAkB,EAAE;iEAGpB;IA8BL,iCAAC;CAAA,AAjED,CAAgD,iBAAiB,GAiEhE;SAjEY,0BAA0B;AAmEvC,aAAa,CAAC,oCAAoC,EAAE,0BAA0B,CAAC,CAAC","sourcesContent":["import { serializeAsTexture, 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 \"./normalMapProceduralTexture.fragment\";\n\nexport class NormalMapProceduralTexture extends ProceduralTexture {\n private _baseTexture: Texture;\n\n constructor(name: string, size: number, scene: Nullable<Scene> = null, fallbackTexture?: Texture, generateMipMaps?: boolean) {\n super(name, size, \"normalMapProceduralTexture\", scene, fallbackTexture, generateMipMaps);\n this.updateShaderUniforms();\n }\n\n public updateShaderUniforms() {\n this.setTexture(\"baseSampler\", this._baseTexture);\n this.setFloat(\"size\", this.getRenderSize() as number);\n }\n\n public render(useCameraPostProcess?: boolean) {\n super.render(useCameraPostProcess);\n }\n\n public resize(size: any, generateMipMaps: any): void {\n super.resize(size, generateMipMaps);\n\n // We need to update the \"size\" uniform\n this.updateShaderUniforms();\n }\n\n public isReady(): boolean {\n if (!this._baseTexture || !this._baseTexture.isReady()) {\n return false;\n }\n\n return super.isReady();\n }\n\n @serializeAsTexture()\n public get baseTexture(): Texture {\n return this._baseTexture;\n }\n\n public set baseTexture(texture: Texture) {\n this._baseTexture = texture;\n this.updateShaderUniforms();\n }\n\n /**\n * Serializes this normal map procedural texture\n * @returns a serialized normal map procedural texture object\n */\n public serialize(): any {\n var serializationObject = SerializationHelper.Serialize(this, super.serialize());\n serializationObject.customType = \"BABYLON.NormalMapProceduralTexture\";\n\n return serializationObject;\n }\n\n /**\n * Creates a Normal Map Procedural Texture from parsed normal map 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 normal map procedural texture information\n * @returns a parsed Normal Map Procedural Texture\n */\n public static Parse(parsedTexture: any, scene: Scene, rootUrl: string): NormalMapProceduralTexture {\n var texture = SerializationHelper.Parse(() => new NormalMapProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps), parsedTexture, scene, rootUrl);\n\n return texture;\n }\n}\n\nRegisterClass(\"BABYLON.NormalMapProceduralTexture\", NormalMapProceduralTexture);"]}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
},
|
|
5
5
|
"name": "@babylonjs/procedural-textures",
|
|
6
6
|
"description": "The Babylon.js materials library is a collection of advanced materials to be used in a Babylon.js scene.",
|
|
7
|
-
"version": "5.0.0-
|
|
7
|
+
"version": "5.0.0-beta.11",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
10
10
|
"url": "https://github.com/BabylonJS/Babylon.js.git"
|
|
@@ -149,8 +149,8 @@
|
|
|
149
149
|
],
|
|
150
150
|
"license": "Apache-2.0",
|
|
151
151
|
"dependencies": {
|
|
152
|
-
"@babylonjs/core": "5.0.0-
|
|
153
|
-
"tslib": "
|
|
152
|
+
"@babylonjs/core": "5.0.0-beta.11",
|
|
153
|
+
"tslib": "^2.3.1"
|
|
154
154
|
},
|
|
155
155
|
"engines": {
|
|
156
156
|
"node": "*"
|
package/perlinNoise/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./perlinNoiseProceduralTexture";
|
|
1
|
+
export * from "./perlinNoiseProceduralTexture.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { Texture } from "@babylonjs/core/Materials/Textures/texture";
|
|
2
2
|
import { ProceduralTexture } from "@babylonjs/core/Materials/Textures/Procedurals/proceduralTexture";
|
|
3
3
|
import { Scene } from "@babylonjs/core/scene";
|
|
4
|
+
import { Nullable } from "@babylonjs/core/types";
|
|
4
5
|
import "./perlinNoiseProceduralTexture.fragment";
|
|
5
6
|
export declare class PerlinNoiseProceduralTexture extends ProceduralTexture {
|
|
6
7
|
time: number;
|
|
7
8
|
timeScale: number;
|
|
8
9
|
translationSpeed: number;
|
|
9
10
|
private _currentTranslation;
|
|
10
|
-
constructor(name: string, size: number, scene
|
|
11
|
+
constructor(name: string, size: number, scene?: Nullable<Scene>, fallbackTexture?: Texture, generateMipMaps?: boolean);
|
|
11
12
|
updateShaderUniforms(): void;
|
|
12
13
|
render(useCameraPostProcess?: boolean): void;
|
|
13
14
|
resize(size: any, generateMipMaps: any): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ShaderStore } from "@babylonjs/core/Engines/shaderStore.js";
|
|
2
2
|
var name = 'perlinNoiseProceduralTexturePixelShader';
|
|
3
|
-
var shader = "\nprecision highp float;\n\nuniform float size;\nuniform float time;\nuniform float translationSpeed;\n\nvarying vec2 vUV;\n\nfloat r(float n)\n{\nreturn fract(cos(n*89.42)*343.42);\n}\nvec2 r(vec2 n)\n{\nreturn vec2(r(n.x*23.62-300.0+n.y*34.35),r(n.x*45.13+256.0+n.y*38.89));\n}\nfloat worley(vec2 n,float s)\n{\nfloat dis=1.0;\nfor(int x=-1; x<=1; x++)\n{\nfor(int y=-1; y<=1; y++)\n{\nvec2 p=floor(n/s)+vec2(x,y);\nfloat d=length(r(p)+vec2(x,y)-fract(n/s));\nif (dis>d)\ndis=d;\n}\n}\nreturn 1.0-dis;\n}\nvec3 hash33(vec3 p3)\n{\np3=fract(p3*vec3(0.1031,0.11369,0.13787));\np3+=dot(p3,p3.yxz+19.19);\nreturn -1.0+2.0*fract(vec3((p3.x+p3.y)*p3.z,(p3.x+p3.z)*p3.y,(p3.y+p3.z)*p3.x));\n}\nfloat perlinNoise(vec3 p)\n{\nvec3 pi=floor(p);\nvec3 pf=p-pi;\nvec3 w=pf*pf*(3.0-2.0*pf);\nreturn mix(\nmix(\nmix(\ndot(pf-vec3(0,0,0),hash33(pi+vec3(0,0,0))),\ndot(pf-vec3(1,0,0),hash33(pi+vec3(1,0,0))),\nw.x\n),\nmix(\ndot(pf-vec3(0,0,1),hash33(pi+vec3(0,0,1))),\ndot(pf-vec3(1,0,1),hash33(pi+vec3(1,0,1))),\nw.x\n),\nw.z\n),\nmix(\nmix(\ndot(pf-vec3(0,1,0),hash33(pi+vec3(0,1,0))),\ndot(pf-vec3(1,1,0),hash33(pi+vec3(1,1,0))),\nw.x\n),\nmix(\ndot(pf-vec3(0,1,1),hash33(pi+vec3(0,1,1))),\ndot(pf-vec3(1,1,1),hash33(pi+vec3(1,1,1))),\nw.x\n),\nw.z\n),\nw.y\n);\n}\n\nvoid main(void)\n{\nvec2 uv=gl_FragCoord.xy+translationSpeed;\nfloat dis=(\n1.0+perlinNoise(vec3(uv/vec2(size,size),time*0.05)*8.0))\n*(1.0+(worley(uv,32.0)+ 0.5*worley(2.0*uv,32.0)+0.25*worley(4.0*uv,32.0))\n);\ngl_FragColor=vec4(vec3(dis/4.0),1.0);\n}\n";
|
|
4
|
-
|
|
3
|
+
var shader = "\nprecision highp float;\n\nuniform float size;\nuniform float time;\nuniform float translationSpeed;\n\nvarying vec2 vUV;\n\nfloat r(float n)\n{\nreturn fract(cos(n*89.42)*343.42);\n}\nvec2 r(vec2 n)\n{\nreturn vec2(r(n.x*23.62-300.0+n.y*34.35),r(n.x*45.13+256.0+n.y*38.89));\n}\nfloat worley(vec2 n,float s)\n{\nfloat dis=1.0;\nfor(int x=-1; x<=1; x++)\n{\nfor(int y=-1; y<=1; y++)\n{\nvec2 p=floor(n/s)+vec2(x,y);\nfloat d=length(r(p)+vec2(x,y)-fract(n/s));\nif (dis>d)\ndis=d;\n}\n}\nreturn 1.0-dis;\n}\nvec3 hash33(vec3 p3)\n{\np3=fract(p3*vec3(0.1031,0.11369,0.13787));\np3+=dot(p3,p3.yxz+19.19);\nreturn -1.0+2.0*fract(vec3((p3.x+p3.y)*p3.z,(p3.x+p3.z)*p3.y,(p3.y+p3.z)*p3.x));\n}\nfloat perlinNoise(vec3 p)\n{\nvec3 pi=floor(p);\nvec3 pf=p-pi;\nvec3 w=pf*pf*(3.0-2.0*pf);\nreturn mix(\nmix(\nmix(\ndot(pf-vec3(0,0,0),hash33(pi+vec3(0,0,0))),\ndot(pf-vec3(1,0,0),hash33(pi+vec3(1,0,0))),\nw.x\n),\nmix(\ndot(pf-vec3(0,0,1),hash33(pi+vec3(0,0,1))),\ndot(pf-vec3(1,0,1),hash33(pi+vec3(1,0,1))),\nw.x\n),\nw.z\n),\nmix(\nmix(\ndot(pf-vec3(0,1,0),hash33(pi+vec3(0,1,0))),\ndot(pf-vec3(1,1,0),hash33(pi+vec3(1,1,0))),\nw.x\n),\nmix(\ndot(pf-vec3(0,1,1),hash33(pi+vec3(0,1,1))),\ndot(pf-vec3(1,1,1),hash33(pi+vec3(1,1,1))),\nw.x\n),\nw.z\n),\nw.y\n);\n}\n\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void)\n{\nvec2 uv=gl_FragCoord.xy+translationSpeed;\nfloat dis=(\n1.0+perlinNoise(vec3(uv/vec2(size,size),time*0.05)*8.0))\n*(1.0+(worley(uv,32.0)+ 0.5*worley(2.0*uv,32.0)+0.25*worley(4.0*uv,32.0))\n);\ngl_FragColor=vec4(vec3(dis/4.0),1.0);\n}\n";
|
|
4
|
+
ShaderStore.ShadersStore[name] = shader;
|
|
5
5
|
/** @hidden */
|
|
6
6
|
export var perlinNoiseProceduralTexturePixelShader = { name: name, shader: shader };
|
|
7
7
|
//# sourceMappingURL=perlinNoiseProceduralTexture.fragment.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"perlinNoiseProceduralTexture.fragment.js","sourceRoot":"","sources":["../../../sourceES6/proceduralTexturesLibrary/src/perlinNoise/perlinNoiseProceduralTexture.fragment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"perlinNoiseProceduralTexture.fragment.js","sourceRoot":"","sources":["../../../sourceES6/proceduralTexturesLibrary/src/perlinNoise/perlinNoiseProceduralTexture.fragment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAElE,IAAI,IAAI,GAAG,yCAAyC,CAAC;AACrD,IAAI,MAAM,GAAG,ghDAoFZ,CAAC;AAEF,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACxC,cAAc;AACd,MAAM,CAAC,IAAI,uCAAuC,GAAG,EAAE,IAAI,MAAA,EAAE,MAAM,QAAA,EAAE,CAAC","sourcesContent":["import { ShaderStore } from \"@babylonjs/core/Engines/shaderStore\";\n\nlet name = 'perlinNoiseProceduralTexturePixelShader';\nlet shader = `\nprecision highp float;\n\nuniform float size;\nuniform float time;\nuniform float translationSpeed;\n\nvarying vec2 vUV;\n\nfloat r(float n)\n{\nreturn fract(cos(n*89.42)*343.42);\n}\nvec2 r(vec2 n)\n{\nreturn vec2(r(n.x*23.62-300.0+n.y*34.35),r(n.x*45.13+256.0+n.y*38.89));\n}\nfloat worley(vec2 n,float s)\n{\nfloat dis=1.0;\nfor(int x=-1; x<=1; x++)\n{\nfor(int y=-1; y<=1; y++)\n{\nvec2 p=floor(n/s)+vec2(x,y);\nfloat d=length(r(p)+vec2(x,y)-fract(n/s));\nif (dis>d)\ndis=d;\n}\n}\nreturn 1.0-dis;\n}\nvec3 hash33(vec3 p3)\n{\np3=fract(p3*vec3(0.1031,0.11369,0.13787));\np3+=dot(p3,p3.yxz+19.19);\nreturn -1.0+2.0*fract(vec3((p3.x+p3.y)*p3.z,(p3.x+p3.z)*p3.y,(p3.y+p3.z)*p3.x));\n}\nfloat perlinNoise(vec3 p)\n{\nvec3 pi=floor(p);\nvec3 pf=p-pi;\nvec3 w=pf*pf*(3.0-2.0*pf);\nreturn mix(\nmix(\nmix(\ndot(pf-vec3(0,0,0),hash33(pi+vec3(0,0,0))),\ndot(pf-vec3(1,0,0),hash33(pi+vec3(1,0,0))),\nw.x\n),\nmix(\ndot(pf-vec3(0,0,1),hash33(pi+vec3(0,0,1))),\ndot(pf-vec3(1,0,1),hash33(pi+vec3(1,0,1))),\nw.x\n),\nw.z\n),\nmix(\nmix(\ndot(pf-vec3(0,1,0),hash33(pi+vec3(0,1,0))),\ndot(pf-vec3(1,1,0),hash33(pi+vec3(1,1,0))),\nw.x\n),\nmix(\ndot(pf-vec3(0,1,1),hash33(pi+vec3(0,1,1))),\ndot(pf-vec3(1,1,1),hash33(pi+vec3(1,1,1))),\nw.x\n),\nw.z\n),\nw.y\n);\n}\n\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void)\n{\nvec2 uv=gl_FragCoord.xy+translationSpeed;\nfloat dis=(\n1.0+perlinNoise(vec3(uv/vec2(size,size),time*0.05)*8.0))\n*(1.0+(worley(uv,32.0)+ 0.5*worley(2.0*uv,32.0)+0.25*worley(4.0*uv,32.0))\n);\ngl_FragColor=vec4(vec3(dis/4.0),1.0);\n}\n`;\n\nShaderStore.ShadersStore[name] = shader;\n/** @hidden */\nexport var perlinNoiseProceduralTexturePixelShader = { name, shader };\n"]}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { __decorate, __extends } from "tslib";
|
|
2
|
-
import { serialize, SerializationHelper } from "@babylonjs/core/Misc/decorators";
|
|
3
|
-
import { ProceduralTexture } from "@babylonjs/core/Materials/Textures/Procedurals/proceduralTexture";
|
|
4
|
-
import {
|
|
5
|
-
import "./perlinNoiseProceduralTexture.fragment";
|
|
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
6
|
var PerlinNoiseProceduralTexture = /** @class */ (function (_super) {
|
|
7
7
|
__extends(PerlinNoiseProceduralTexture, _super);
|
|
8
8
|
function PerlinNoiseProceduralTexture(name, size, scene, fallbackTexture, generateMipMaps) {
|
|
9
|
+
if (scene === void 0) { scene = null; }
|
|
9
10
|
var _this = _super.call(this, name, size, "perlinNoiseProceduralTexture", scene, fallbackTexture, generateMipMaps) || this;
|
|
10
11
|
_this.time = 0.0;
|
|
11
12
|
_this.timeScale = 1.0;
|
|
@@ -65,5 +66,5 @@ var PerlinNoiseProceduralTexture = /** @class */ (function (_super) {
|
|
|
65
66
|
return PerlinNoiseProceduralTexture;
|
|
66
67
|
}(ProceduralTexture));
|
|
67
68
|
export { PerlinNoiseProceduralTexture };
|
|
68
|
-
|
|
69
|
+
RegisterClass("BABYLON.PerlinNoiseProceduralTexture", PerlinNoiseProceduralTexture);
|
|
69
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,
|
|
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);"]}
|