@babylonjs/procedural-textures 5.0.0-beta.9 → 5.0.0-rc.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/brick/brickProceduralTexture.d.ts +35 -35
- package/brick/brickProceduralTexture.fragment.d.ts +5 -5
- package/brick/brickProceduralTexture.fragment.js +8 -6
- package/brick/brickProceduralTexture.fragment.js.map +1 -1
- 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/brick/index.js.map +1 -1
- package/cloud/cloudProceduralTexture.d.ts +35 -35
- package/cloud/cloudProceduralTexture.fragment.d.ts +5 -5
- package/cloud/cloudProceduralTexture.fragment.js +8 -6
- package/cloud/cloudProceduralTexture.fragment.js.map +1 -1
- 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/cloud/index.js.map +1 -1
- package/fire/fireProceduralTexture.d.ts +44 -44
- package/fire/fireProceduralTexture.fragment.d.ts +5 -5
- package/fire/fireProceduralTexture.fragment.js +8 -6
- package/fire/fireProceduralTexture.fragment.js.map +1 -1
- package/fire/fireProceduralTexture.js +166 -194
- package/fire/fireProceduralTexture.js.map +1 -1
- package/fire/index.d.ts +1 -1
- package/fire/index.js +1 -1
- package/fire/index.js.map +1 -1
- package/grass/grassProceduralTexture.d.ts +29 -29
- package/grass/grassProceduralTexture.fragment.d.ts +5 -5
- package/grass/grassProceduralTexture.fragment.js +8 -6
- package/grass/grassProceduralTexture.fragment.js.map +1 -1
- package/grass/grassProceduralTexture.js +80 -84
- package/grass/grassProceduralTexture.js.map +1 -1
- package/grass/index.d.ts +1 -1
- package/grass/index.js +1 -1
- package/grass/index.js.map +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/marble/index.d.ts +1 -1
- package/marble/index.js +1 -1
- package/marble/index.js.map +1 -1
- package/marble/marbleProceduralTexture.d.ts +35 -35
- package/marble/marbleProceduralTexture.fragment.d.ts +5 -5
- package/marble/marbleProceduralTexture.fragment.js +8 -6
- package/marble/marbleProceduralTexture.fragment.js.map +1 -1
- 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/index.js.map +1 -1
- package/normalMap/normalMapProceduralTexture.d.ts +28 -28
- package/normalMap/normalMapProceduralTexture.fragment.d.ts +5 -5
- package/normalMap/normalMapProceduralTexture.fragment.js +8 -6
- package/normalMap/normalMapProceduralTexture.fragment.js.map +1 -1
- package/normalMap/normalMapProceduralTexture.js +69 -69
- package/normalMap/normalMapProceduralTexture.js.map +1 -1
- package/package.json +22 -152
- package/perlinNoise/index.d.ts +1 -1
- package/perlinNoise/index.js +1 -1
- package/perlinNoise/index.js.map +1 -1
- package/perlinNoise/perlinNoiseProceduralTexture.d.ts +28 -28
- package/perlinNoise/perlinNoiseProceduralTexture.fragment.d.ts +5 -5
- package/perlinNoise/perlinNoiseProceduralTexture.fragment.js +8 -6
- package/perlinNoise/perlinNoiseProceduralTexture.fragment.js.map +1 -1
- package/perlinNoise/perlinNoiseProceduralTexture.js +69 -69
- package/perlinNoise/perlinNoiseProceduralTexture.js.map +1 -1
- package/readme.md +2 -2
- package/road/index.d.ts +1 -1
- package/road/index.js +1 -1
- package/road/index.js.map +1 -1
- package/road/roadProceduralTexture.d.ts +26 -26
- package/road/roadProceduralTexture.fragment.d.ts +5 -5
- package/road/roadProceduralTexture.fragment.js +8 -6
- package/road/roadProceduralTexture.fragment.js.map +1 -1
- 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/index.js.map +1 -1
- package/starfield/starfieldProceduralTexture.d.ts +55 -55
- package/starfield/starfieldProceduralTexture.fragment.d.ts +5 -5
- package/starfield/starfieldProceduralTexture.fragment.js +8 -6
- package/starfield/starfieldProceduralTexture.fragment.js.map +1 -1
- 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/index.js.map +1 -1
- package/wood/woodProceduralTexture.d.ts +29 -29
- package/wood/woodProceduralTexture.fragment.d.ts +5 -5
- package/wood/woodProceduralTexture.fragment.js +8 -6
- package/wood/woodProceduralTexture.fragment.js.map +1 -1
- package/wood/woodProceduralTexture.js +72 -72
- package/wood/woodProceduralTexture.js.map +1 -1
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { Texture } from "@babylonjs/core/Materials/Textures/texture";
|
|
2
|
-
import { ProceduralTexture } from "@babylonjs/core/Materials/Textures/Procedurals/proceduralTexture";
|
|
3
|
-
import { Scene } from "@babylonjs/core/scene";
|
|
4
|
-
import { Nullable } from "@babylonjs/core/types";
|
|
5
|
-
import "./normalMapProceduralTexture.fragment";
|
|
6
|
-
export declare class NormalMapProceduralTexture extends ProceduralTexture {
|
|
7
|
-
private _baseTexture;
|
|
8
|
-
constructor(name: string, size: number, scene?: Nullable<Scene>, fallbackTexture?: Texture, generateMipMaps?: boolean);
|
|
9
|
-
updateShaderUniforms(): void;
|
|
10
|
-
render(useCameraPostProcess?: boolean): void;
|
|
11
|
-
resize(size: any, generateMipMaps: any): void;
|
|
12
|
-
isReady(): boolean;
|
|
13
|
-
get baseTexture(): Texture;
|
|
14
|
-
set baseTexture(texture: Texture);
|
|
15
|
-
/**
|
|
16
|
-
* Serializes this normal map procedural texture
|
|
17
|
-
* @returns a serialized normal map procedural texture object
|
|
18
|
-
*/
|
|
19
|
-
serialize(): any;
|
|
20
|
-
/**
|
|
21
|
-
* Creates a Normal Map Procedural Texture from parsed normal map procedural texture data
|
|
22
|
-
* @param parsedTexture defines parsed texture data
|
|
23
|
-
* @param scene defines the current scene
|
|
24
|
-
* @param rootUrl defines the root URL containing normal map procedural texture information
|
|
25
|
-
* @returns a parsed Normal Map Procedural Texture
|
|
26
|
-
*/
|
|
27
|
-
static Parse(parsedTexture: any, scene: Scene, rootUrl: string): NormalMapProceduralTexture;
|
|
28
|
-
}
|
|
1
|
+
import type { Texture } from "@babylonjs/core/Materials/Textures/texture.js";
|
|
2
|
+
import { ProceduralTexture } from "@babylonjs/core/Materials/Textures/Procedurals/proceduralTexture.js";
|
|
3
|
+
import type { Scene } from "@babylonjs/core/scene.js";
|
|
4
|
+
import type { Nullable } from "@babylonjs/core/types.js";
|
|
5
|
+
import "./normalMapProceduralTexture.fragment";
|
|
6
|
+
export declare class NormalMapProceduralTexture extends ProceduralTexture {
|
|
7
|
+
private _baseTexture;
|
|
8
|
+
constructor(name: string, size: number, scene?: Nullable<Scene>, fallbackTexture?: Texture, generateMipMaps?: boolean);
|
|
9
|
+
updateShaderUniforms(): void;
|
|
10
|
+
render(useCameraPostProcess?: boolean): void;
|
|
11
|
+
resize(size: any, generateMipMaps: any): void;
|
|
12
|
+
isReady(): boolean;
|
|
13
|
+
get baseTexture(): Texture;
|
|
14
|
+
set baseTexture(texture: Texture);
|
|
15
|
+
/**
|
|
16
|
+
* Serializes this normal map procedural texture
|
|
17
|
+
* @returns a serialized normal map procedural texture object
|
|
18
|
+
*/
|
|
19
|
+
serialize(): any;
|
|
20
|
+
/**
|
|
21
|
+
* Creates a Normal Map Procedural Texture from parsed normal map procedural texture data
|
|
22
|
+
* @param parsedTexture defines parsed texture data
|
|
23
|
+
* @param scene defines the current scene
|
|
24
|
+
* @param rootUrl defines the root URL containing normal map procedural texture information
|
|
25
|
+
* @returns a parsed Normal Map Procedural Texture
|
|
26
|
+
*/
|
|
27
|
+
static Parse(parsedTexture: any, scene: Scene, rootUrl: string): NormalMapProceduralTexture;
|
|
28
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/** @hidden */
|
|
2
|
-
export declare
|
|
3
|
-
name: string;
|
|
4
|
-
shader: string;
|
|
5
|
-
};
|
|
1
|
+
/** @hidden */
|
|
2
|
+
export declare const normalMapProceduralTexturePixelShader: {
|
|
3
|
+
name: string;
|
|
4
|
+
shader: string;
|
|
5
|
+
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
// Do not edit.
|
|
2
|
+
import { ShaderStore } from "@babylonjs/core/Engines/shaderStore.js";
|
|
3
|
+
var name = "normalMapProceduralTexturePixelShader";
|
|
4
|
+
var shader = "precision highp float;uniform sampler2D baseSampler;uniform float size;varying vec2 vUV;const vec3 LUMA_COEFFICIENT=vec3(0.2126,0.7152,0.0722);float lumaAtCoord(vec2 coord)\n{vec3 pixel=texture2D(baseSampler,coord).rgb;float luma=dot(pixel,LUMA_COEFFICIENT);return luma;}\nvoid main()\n{float lumaU0=lumaAtCoord(vUV+vec2(-1.0, 0.0)/size);float lumaU1=lumaAtCoord(vUV+vec2( 1.0, 0.0)/size);float lumaV0=lumaAtCoord(vUV+vec2( 0.0,-1.0)/size);float lumaV1=lumaAtCoord(vUV+vec2( 0.0, 1.0)/size);vec2 slope=(vec2(lumaU0-lumaU1,lumaV0-lumaV1)+1.0)*0.5;gl_FragColor=vec4(slope,1.0,1.0);}\n";
|
|
5
|
+
// Sideeffect
|
|
6
|
+
ShaderStore.ShadersStore[name] = shader;
|
|
7
|
+
/** @hidden */
|
|
8
|
+
export var normalMapProceduralTexturePixelShader = { name: name, shader: shader };
|
|
7
9
|
//# sourceMappingURL=normalMapProceduralTexture.fragment.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalMapProceduralTexture.fragment.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"normalMapProceduralTexture.fragment.js","sourceRoot":"","sources":["../../../../../lts/proceduralTextures/generated/normalMap/normalMapProceduralTexture.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,+CAAiC;AAEvD,IAAM,IAAI,GAAG,uCAAuC,CAAC;AACrD,IAAM,MAAM,GAAG,wkBAId,CAAC;AACF,aAAa;AACb,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACxC,cAAc;AACd,MAAM,CAAC,IAAM,qCAAqC,GAAG,EAAE,IAAI,MAAA,EAAE,MAAM,QAAA,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"core/Engines/shaderStore\";\n\nconst name = \"normalMapProceduralTexturePixelShader\";\nconst shader = `precision highp float;uniform sampler2D baseSampler;uniform float size;varying vec2 vUV;const vec3 LUMA_COEFFICIENT=vec3(0.2126,0.7152,0.0722);float lumaAtCoord(vec2 coord)\n{vec3 pixel=texture2D(baseSampler,coord).rgb;float luma=dot(pixel,LUMA_COEFFICIENT);return luma;}\nvoid main()\n{float lumaU0=lumaAtCoord(vUV+vec2(-1.0, 0.0)/size);float lumaU1=lumaAtCoord(vUV+vec2( 1.0, 0.0)/size);float lumaV0=lumaAtCoord(vUV+vec2( 0.0,-1.0)/size);float lumaV1=lumaAtCoord(vUV+vec2( 0.0, 1.0)/size);vec2 slope=(vec2(lumaU0-lumaU1,lumaV0-lumaV1)+1.0)*0.5;gl_FragColor=vec4(slope,1.0,1.0);}\n`;\n// Sideeffect\nShaderStore.ShadersStore[name] = shader;\n/** @hidden */\nexport const normalMapProceduralTexturePixelShader = { name, shader };\n"]}
|
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
import { __decorate, __extends } from "tslib";
|
|
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
|
|
5
|
-
import "./normalMapProceduralTexture.fragment
|
|
6
|
-
var NormalMapProceduralTexture = /** @class */ (function (_super) {
|
|
7
|
-
__extends(NormalMapProceduralTexture, _super);
|
|
8
|
-
function NormalMapProceduralTexture(name, size, scene, fallbackTexture, generateMipMaps) {
|
|
9
|
-
if (scene === void 0) { scene = null; }
|
|
10
|
-
var _this = _super.call(this, name, size, "normalMapProceduralTexture", scene, fallbackTexture, generateMipMaps) || this;
|
|
11
|
-
_this.updateShaderUniforms();
|
|
12
|
-
return _this;
|
|
13
|
-
}
|
|
14
|
-
NormalMapProceduralTexture.prototype.updateShaderUniforms = function () {
|
|
15
|
-
this.setTexture("baseSampler", this._baseTexture);
|
|
16
|
-
this.setFloat("size", this.getRenderSize());
|
|
17
|
-
};
|
|
18
|
-
NormalMapProceduralTexture.prototype.render = function (useCameraPostProcess) {
|
|
19
|
-
_super.prototype.render.call(this, useCameraPostProcess);
|
|
20
|
-
};
|
|
21
|
-
NormalMapProceduralTexture.prototype.resize = function (size, generateMipMaps) {
|
|
22
|
-
_super.prototype.resize.call(this, size, generateMipMaps);
|
|
23
|
-
// We need to update the "size" uniform
|
|
24
|
-
this.updateShaderUniforms();
|
|
25
|
-
};
|
|
26
|
-
NormalMapProceduralTexture.prototype.isReady = function () {
|
|
27
|
-
if (!this._baseTexture || !this._baseTexture.isReady()) {
|
|
28
|
-
return false;
|
|
29
|
-
}
|
|
30
|
-
return _super.prototype.isReady.call(this);
|
|
31
|
-
};
|
|
32
|
-
Object.defineProperty(NormalMapProceduralTexture.prototype, "baseTexture", {
|
|
33
|
-
get: function () {
|
|
34
|
-
return this._baseTexture;
|
|
35
|
-
},
|
|
36
|
-
set: function (texture) {
|
|
37
|
-
this._baseTexture = texture;
|
|
38
|
-
this.updateShaderUniforms();
|
|
39
|
-
},
|
|
40
|
-
enumerable: false,
|
|
41
|
-
configurable: true
|
|
42
|
-
});
|
|
43
|
-
/**
|
|
44
|
-
* Serializes this normal map procedural texture
|
|
45
|
-
* @returns a serialized normal map procedural texture object
|
|
46
|
-
*/
|
|
47
|
-
NormalMapProceduralTexture.prototype.serialize = function () {
|
|
48
|
-
var serializationObject = SerializationHelper.Serialize(this, _super.prototype.serialize.call(this));
|
|
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
|
-
NormalMapProceduralTexture.Parse = function (parsedTexture, scene, rootUrl) {
|
|
60
|
-
var texture = SerializationHelper.Parse(function () { return new NormalMapProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps); }, parsedTexture, scene, rootUrl);
|
|
61
|
-
return texture;
|
|
62
|
-
};
|
|
63
|
-
__decorate([
|
|
64
|
-
serializeAsTexture()
|
|
65
|
-
], NormalMapProceduralTexture.prototype, "baseTexture", null);
|
|
66
|
-
return NormalMapProceduralTexture;
|
|
67
|
-
}(ProceduralTexture));
|
|
68
|
-
export { NormalMapProceduralTexture };
|
|
69
|
-
RegisterClass("BABYLON.NormalMapProceduralTexture", NormalMapProceduralTexture);
|
|
1
|
+
import { __decorate, __extends } from "tslib";
|
|
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";
|
|
6
|
+
var NormalMapProceduralTexture = /** @class */ (function (_super) {
|
|
7
|
+
__extends(NormalMapProceduralTexture, _super);
|
|
8
|
+
function NormalMapProceduralTexture(name, size, scene, fallbackTexture, generateMipMaps) {
|
|
9
|
+
if (scene === void 0) { scene = null; }
|
|
10
|
+
var _this = _super.call(this, name, size, "normalMapProceduralTexture", scene, fallbackTexture, generateMipMaps) || this;
|
|
11
|
+
_this.updateShaderUniforms();
|
|
12
|
+
return _this;
|
|
13
|
+
}
|
|
14
|
+
NormalMapProceduralTexture.prototype.updateShaderUniforms = function () {
|
|
15
|
+
this.setTexture("baseSampler", this._baseTexture);
|
|
16
|
+
this.setFloat("size", this.getRenderSize());
|
|
17
|
+
};
|
|
18
|
+
NormalMapProceduralTexture.prototype.render = function (useCameraPostProcess) {
|
|
19
|
+
_super.prototype.render.call(this, useCameraPostProcess);
|
|
20
|
+
};
|
|
21
|
+
NormalMapProceduralTexture.prototype.resize = function (size, generateMipMaps) {
|
|
22
|
+
_super.prototype.resize.call(this, size, generateMipMaps);
|
|
23
|
+
// We need to update the "size" uniform
|
|
24
|
+
this.updateShaderUniforms();
|
|
25
|
+
};
|
|
26
|
+
NormalMapProceduralTexture.prototype.isReady = function () {
|
|
27
|
+
if (!this._baseTexture || !this._baseTexture.isReady()) {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
return _super.prototype.isReady.call(this);
|
|
31
|
+
};
|
|
32
|
+
Object.defineProperty(NormalMapProceduralTexture.prototype, "baseTexture", {
|
|
33
|
+
get: function () {
|
|
34
|
+
return this._baseTexture;
|
|
35
|
+
},
|
|
36
|
+
set: function (texture) {
|
|
37
|
+
this._baseTexture = texture;
|
|
38
|
+
this.updateShaderUniforms();
|
|
39
|
+
},
|
|
40
|
+
enumerable: false,
|
|
41
|
+
configurable: true
|
|
42
|
+
});
|
|
43
|
+
/**
|
|
44
|
+
* Serializes this normal map procedural texture
|
|
45
|
+
* @returns a serialized normal map procedural texture object
|
|
46
|
+
*/
|
|
47
|
+
NormalMapProceduralTexture.prototype.serialize = function () {
|
|
48
|
+
var serializationObject = SerializationHelper.Serialize(this, _super.prototype.serialize.call(this));
|
|
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
|
+
NormalMapProceduralTexture.Parse = function (parsedTexture, scene, rootUrl) {
|
|
60
|
+
var texture = SerializationHelper.Parse(function () { return new NormalMapProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps); }, parsedTexture, scene, rootUrl);
|
|
61
|
+
return texture;
|
|
62
|
+
};
|
|
63
|
+
__decorate([
|
|
64
|
+
serializeAsTexture()
|
|
65
|
+
], NormalMapProceduralTexture.prototype, "baseTexture", null);
|
|
66
|
+
return NormalMapProceduralTexture;
|
|
67
|
+
}(ProceduralTexture));
|
|
68
|
+
export { NormalMapProceduralTexture };
|
|
69
|
+
RegisterClass("BABYLON.NormalMapProceduralTexture", NormalMapProceduralTexture);
|
|
70
70
|
//# sourceMappingURL=normalMapProceduralTexture.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalMapProceduralTexture.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"normalMapProceduralTexture.js","sourceRoot":"","sources":["../../../../../lts/proceduralTextures/generated/normalMap/normalMapProceduralTexture.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,2CAA6B;AAE/E,OAAO,EAAE,iBAAiB,EAAE,4EAA8D;AAE1F,OAAO,EAAE,aAAa,EAAE,0CAA4B;AAEpD,OAAO,uCAAuC,CAAC;AAE/C;IAAgD,8CAAiB;IAG7D,oCAAY,IAAY,EAAE,IAAY,EAAE,KAA6B,EAAE,eAAyB,EAAE,eAAyB;QAAnF,sBAAA,EAAA,YAA6B;QAArE,YACI,kBAAM,IAAI,EAAE,IAAI,EAAE,4BAA4B,EAAE,KAAK,EAAE,eAAe,EAAE,eAAe,CAAC,SAE3F;QADG,KAAI,CAAC,oBAAoB,EAAE,CAAC;;IAChC,CAAC;IAEM,yDAAoB,GAA3B;QACI,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QAClD,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,aAAa,EAAY,CAAC,CAAC;IAC1D,CAAC;IAEM,2CAAM,GAAb,UAAc,oBAA8B;QACxC,iBAAM,MAAM,YAAC,oBAAoB,CAAC,CAAC;IACvC,CAAC;IAEM,2CAAM,GAAb,UAAc,IAAS,EAAE,eAAoB;QACzC,iBAAM,MAAM,YAAC,IAAI,EAAE,eAAe,CAAC,CAAC;QAEpC,uCAAuC;QACvC,IAAI,CAAC,oBAAoB,EAAE,CAAC;IAChC,CAAC;IAEM,4CAAO,GAAd;QACI,IAAI,CAAC,IAAI,CAAC,YAAY,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,EAAE;YACpD,OAAO,KAAK,CAAC;SAChB;QAED,OAAO,iBAAM,OAAO,WAAE,CAAC;IAC3B,CAAC;IAGD,sBAAW,mDAAW;aAAtB;YACI,OAAO,IAAI,CAAC,YAAY,CAAC;QAC7B,CAAC;aAED,UAAuB,OAAgB;YACnC,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC;YAC5B,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAChC,CAAC;;;OALA;IAOD;;;OAGG;IACI,8CAAS,GAAhB;QACI,IAAM,mBAAmB,GAAG,mBAAmB,CAAC,SAAS,CAAC,IAAI,EAAE,iBAAM,SAAS,WAAE,CAAC,CAAC;QACnF,mBAAmB,CAAC,UAAU,GAAG,oCAAoC,CAAC;QAEtE,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAED;;;;;;OAMG;IACW,gCAAK,GAAnB,UAAoB,aAAkB,EAAE,KAAY,EAAE,OAAe;QACjE,IAAM,OAAO,GAAG,mBAAmB,CAAC,KAAK,CACrC,cAAM,OAAA,IAAI,0BAA0B,CAAC,aAAa,CAAC,IAAI,EAAE,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,aAAa,CAAC,gBAAgB,CAAC,EAAzH,CAAyH,EAC/H,aAAa,EACb,KAAK,EACL,OAAO,CACV,CAAC;QAEF,OAAO,OAAO,CAAC;IACnB,CAAC;IApCD;QADC,kBAAkB,EAAE;iEAGpB;IAmCL,iCAAC;CAAA,AAtED,CAAgD,iBAAiB,GAsEhE;SAtEY,0BAA0B;AAwEvC,aAAa,CAAC,oCAAoC,EAAE,0BAA0B,CAAC,CAAC","sourcesContent":["import { serializeAsTexture, SerializationHelper } from \"core/Misc/decorators\";\r\nimport type { Texture } from \"core/Materials/Textures/texture\";\r\nimport { ProceduralTexture } from \"core/Materials/Textures/Procedurals/proceduralTexture\";\r\nimport type { Scene } from \"core/scene\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport type { Nullable } from \"core/types\";\r\nimport \"./normalMapProceduralTexture.fragment\";\r\n\r\nexport class NormalMapProceduralTexture extends ProceduralTexture {\r\n private _baseTexture: Texture;\r\n\r\n constructor(name: string, size: number, scene: Nullable<Scene> = null, fallbackTexture?: Texture, generateMipMaps?: boolean) {\r\n super(name, size, \"normalMapProceduralTexture\", scene, fallbackTexture, generateMipMaps);\r\n this.updateShaderUniforms();\r\n }\r\n\r\n public updateShaderUniforms() {\r\n this.setTexture(\"baseSampler\", this._baseTexture);\r\n this.setFloat(\"size\", this.getRenderSize() as number);\r\n }\r\n\r\n public render(useCameraPostProcess?: boolean) {\r\n super.render(useCameraPostProcess);\r\n }\r\n\r\n public resize(size: any, generateMipMaps: any): void {\r\n super.resize(size, generateMipMaps);\r\n\r\n // We need to update the \"size\" uniform\r\n this.updateShaderUniforms();\r\n }\r\n\r\n public isReady(): boolean {\r\n if (!this._baseTexture || !this._baseTexture.isReady()) {\r\n return false;\r\n }\r\n\r\n return super.isReady();\r\n }\r\n\r\n @serializeAsTexture()\r\n public get baseTexture(): Texture {\r\n return this._baseTexture;\r\n }\r\n\r\n public set baseTexture(texture: Texture) {\r\n this._baseTexture = texture;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n /**\r\n * Serializes this normal map procedural texture\r\n * @returns a serialized normal map procedural texture object\r\n */\r\n public serialize(): any {\r\n const serializationObject = SerializationHelper.Serialize(this, super.serialize());\r\n serializationObject.customType = \"BABYLON.NormalMapProceduralTexture\";\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Creates a Normal Map Procedural Texture from parsed normal map procedural texture data\r\n * @param parsedTexture defines parsed texture data\r\n * @param scene defines the current scene\r\n * @param rootUrl defines the root URL containing normal map procedural texture information\r\n * @returns a parsed Normal Map Procedural Texture\r\n */\r\n public static Parse(parsedTexture: any, scene: Scene, rootUrl: string): NormalMapProceduralTexture {\r\n const texture = SerializationHelper.Parse(\r\n () => new NormalMapProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps),\r\n parsedTexture,\r\n scene,\r\n rootUrl\r\n );\r\n\r\n return texture;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NormalMapProceduralTexture\", NormalMapProceduralTexture);\r\n"]}
|
package/package.json
CHANGED
|
@@ -1,161 +1,31 @@
|
|
|
1
1
|
{
|
|
2
|
-
"author": {
|
|
3
|
-
"name": "David CATUHE"
|
|
4
|
-
},
|
|
5
2
|
"name": "@babylonjs/procedural-textures",
|
|
6
|
-
"
|
|
7
|
-
"version": "5.0.0-beta.9",
|
|
8
|
-
"repository": {
|
|
9
|
-
"type": "git",
|
|
10
|
-
"url": "https://github.com/BabylonJS/Babylon.js.git"
|
|
11
|
-
},
|
|
3
|
+
"version": "5.0.0-rc.10",
|
|
12
4
|
"main": "index.js",
|
|
5
|
+
"module": "index.js",
|
|
6
|
+
"types": "index.d.ts",
|
|
13
7
|
"files": [
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"brick/brickProceduralTexture.js",
|
|
19
|
-
"brick/brickProceduralTexture.js.map",
|
|
20
|
-
"brick/index.d.ts",
|
|
21
|
-
"brick/index.js",
|
|
22
|
-
"brick/index.js.map",
|
|
23
|
-
"cloud/cloudProceduralTexture.d.ts",
|
|
24
|
-
"cloud/cloudProceduralTexture.fragment.d.ts",
|
|
25
|
-
"cloud/cloudProceduralTexture.fragment.js",
|
|
26
|
-
"cloud/cloudProceduralTexture.fragment.js.map",
|
|
27
|
-
"cloud/cloudProceduralTexture.js",
|
|
28
|
-
"cloud/cloudProceduralTexture.js.map",
|
|
29
|
-
"cloud/index.d.ts",
|
|
30
|
-
"cloud/index.js",
|
|
31
|
-
"cloud/index.js.map",
|
|
32
|
-
"fire/fireProceduralTexture.d.ts",
|
|
33
|
-
"fire/fireProceduralTexture.fragment.d.ts",
|
|
34
|
-
"fire/fireProceduralTexture.fragment.js",
|
|
35
|
-
"fire/fireProceduralTexture.fragment.js.map",
|
|
36
|
-
"fire/fireProceduralTexture.js",
|
|
37
|
-
"fire/fireProceduralTexture.js.map",
|
|
38
|
-
"fire/index.d.ts",
|
|
39
|
-
"fire/index.js",
|
|
40
|
-
"fire/index.js.map",
|
|
41
|
-
"grass/grassProceduralTexture.d.ts",
|
|
42
|
-
"grass/grassProceduralTexture.fragment.d.ts",
|
|
43
|
-
"grass/grassProceduralTexture.fragment.js",
|
|
44
|
-
"grass/grassProceduralTexture.fragment.js.map",
|
|
45
|
-
"grass/grassProceduralTexture.js",
|
|
46
|
-
"grass/grassProceduralTexture.js.map",
|
|
47
|
-
"grass/index.d.ts",
|
|
48
|
-
"grass/index.js",
|
|
49
|
-
"grass/index.js.map",
|
|
50
|
-
"index.d.ts",
|
|
51
|
-
"index.js",
|
|
52
|
-
"index.js.map",
|
|
53
|
-
"legacy/legacy-brick.d.ts",
|
|
54
|
-
"legacy/legacy-brick.js",
|
|
55
|
-
"legacy/legacy-brick.js.map",
|
|
56
|
-
"legacy/legacy-cloud.d.ts",
|
|
57
|
-
"legacy/legacy-cloud.js",
|
|
58
|
-
"legacy/legacy-cloud.js.map",
|
|
59
|
-
"legacy/legacy-fire.d.ts",
|
|
60
|
-
"legacy/legacy-fire.js",
|
|
61
|
-
"legacy/legacy-fire.js.map",
|
|
62
|
-
"legacy/legacy-grass.d.ts",
|
|
63
|
-
"legacy/legacy-grass.js",
|
|
64
|
-
"legacy/legacy-grass.js.map",
|
|
65
|
-
"legacy/legacy-marble.d.ts",
|
|
66
|
-
"legacy/legacy-marble.js",
|
|
67
|
-
"legacy/legacy-marble.js.map",
|
|
68
|
-
"legacy/legacy-normalMap.d.ts",
|
|
69
|
-
"legacy/legacy-normalMap.js",
|
|
70
|
-
"legacy/legacy-normalMap.js.map",
|
|
71
|
-
"legacy/legacy-perlinNoise.d.ts",
|
|
72
|
-
"legacy/legacy-perlinNoise.js",
|
|
73
|
-
"legacy/legacy-perlinNoise.js.map",
|
|
74
|
-
"legacy/legacy-road.d.ts",
|
|
75
|
-
"legacy/legacy-road.js",
|
|
76
|
-
"legacy/legacy-road.js.map",
|
|
77
|
-
"legacy/legacy-starfield.d.ts",
|
|
78
|
-
"legacy/legacy-starfield.js",
|
|
79
|
-
"legacy/legacy-starfield.js.map",
|
|
80
|
-
"legacy/legacy-wood.d.ts",
|
|
81
|
-
"legacy/legacy-wood.js",
|
|
82
|
-
"legacy/legacy-wood.js.map",
|
|
83
|
-
"legacy/legacy.d.ts",
|
|
84
|
-
"legacy/legacy.js",
|
|
85
|
-
"legacy/legacy.js.map",
|
|
86
|
-
"marble/index.d.ts",
|
|
87
|
-
"marble/index.js",
|
|
88
|
-
"marble/index.js.map",
|
|
89
|
-
"marble/marbleProceduralTexture.d.ts",
|
|
90
|
-
"marble/marbleProceduralTexture.fragment.d.ts",
|
|
91
|
-
"marble/marbleProceduralTexture.fragment.js",
|
|
92
|
-
"marble/marbleProceduralTexture.fragment.js.map",
|
|
93
|
-
"marble/marbleProceduralTexture.js",
|
|
94
|
-
"marble/marbleProceduralTexture.js.map",
|
|
95
|
-
"normalMap/index.d.ts",
|
|
96
|
-
"normalMap/index.js",
|
|
97
|
-
"normalMap/index.js.map",
|
|
98
|
-
"normalMap/normalMapProceduralTexture.d.ts",
|
|
99
|
-
"normalMap/normalMapProceduralTexture.fragment.d.ts",
|
|
100
|
-
"normalMap/normalMapProceduralTexture.fragment.js",
|
|
101
|
-
"normalMap/normalMapProceduralTexture.fragment.js.map",
|
|
102
|
-
"normalMap/normalMapProceduralTexture.js",
|
|
103
|
-
"normalMap/normalMapProceduralTexture.js.map",
|
|
104
|
-
"perlinNoise/index.d.ts",
|
|
105
|
-
"perlinNoise/index.js",
|
|
106
|
-
"perlinNoise/index.js.map",
|
|
107
|
-
"perlinNoise/perlinNoiseProceduralTexture.d.ts",
|
|
108
|
-
"perlinNoise/perlinNoiseProceduralTexture.fragment.d.ts",
|
|
109
|
-
"perlinNoise/perlinNoiseProceduralTexture.fragment.js",
|
|
110
|
-
"perlinNoise/perlinNoiseProceduralTexture.fragment.js.map",
|
|
111
|
-
"perlinNoise/perlinNoiseProceduralTexture.js",
|
|
112
|
-
"perlinNoise/perlinNoiseProceduralTexture.js.map",
|
|
113
|
-
"readme.md",
|
|
114
|
-
"road/index.d.ts",
|
|
115
|
-
"road/index.js",
|
|
116
|
-
"road/index.js.map",
|
|
117
|
-
"road/roadProceduralTexture.d.ts",
|
|
118
|
-
"road/roadProceduralTexture.fragment.d.ts",
|
|
119
|
-
"road/roadProceduralTexture.fragment.js",
|
|
120
|
-
"road/roadProceduralTexture.fragment.js.map",
|
|
121
|
-
"road/roadProceduralTexture.js",
|
|
122
|
-
"road/roadProceduralTexture.js.map",
|
|
123
|
-
"starfield/index.d.ts",
|
|
124
|
-
"starfield/index.js",
|
|
125
|
-
"starfield/index.js.map",
|
|
126
|
-
"starfield/starfieldProceduralTexture.d.ts",
|
|
127
|
-
"starfield/starfieldProceduralTexture.fragment.d.ts",
|
|
128
|
-
"starfield/starfieldProceduralTexture.fragment.js",
|
|
129
|
-
"starfield/starfieldProceduralTexture.fragment.js.map",
|
|
130
|
-
"starfield/starfieldProceduralTexture.js",
|
|
131
|
-
"starfield/starfieldProceduralTexture.js.map",
|
|
132
|
-
"wood/index.d.ts",
|
|
133
|
-
"wood/index.js",
|
|
134
|
-
"wood/index.js.map",
|
|
135
|
-
"wood/woodProceduralTexture.d.ts",
|
|
136
|
-
"wood/woodProceduralTexture.fragment.d.ts",
|
|
137
|
-
"wood/woodProceduralTexture.fragment.js",
|
|
138
|
-
"wood/woodProceduralTexture.fragment.js.map",
|
|
139
|
-
"wood/woodProceduralTexture.js",
|
|
140
|
-
"wood/woodProceduralTexture.js.map"
|
|
8
|
+
"**/*.js",
|
|
9
|
+
"**/*.d.ts",
|
|
10
|
+
"**/*.map",
|
|
11
|
+
"readme.md"
|
|
141
12
|
],
|
|
142
|
-
"
|
|
143
|
-
|
|
144
|
-
"
|
|
145
|
-
"
|
|
146
|
-
"
|
|
147
|
-
"
|
|
148
|
-
|
|
149
|
-
],
|
|
150
|
-
"license": "Apache-2.0",
|
|
13
|
+
"scripts": {
|
|
14
|
+
"build": "npm run clean && npm run compile",
|
|
15
|
+
"clean": "rimraf dist && rimraf *.tsbuildinfo && rimraf \"./**/*.!(md|json|build.json)\"",
|
|
16
|
+
"compile": "tsc -b tsconfig.build.json",
|
|
17
|
+
"postcompile": "build-tools -c add-js-to-es6 --path ./dist/**/*.js",
|
|
18
|
+
"prepublishOnly": "build-tools -c prepare-es6-build"
|
|
19
|
+
},
|
|
151
20
|
"dependencies": {
|
|
152
|
-
"@babylonjs/core": "5.0.0-
|
|
21
|
+
"@babylonjs/core": "^5.0.0-rc.10",
|
|
153
22
|
"tslib": "^2.3.1"
|
|
154
23
|
},
|
|
155
|
-
"
|
|
156
|
-
"
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@dev/build-tools": "^1.0.0",
|
|
26
|
+
"@lts/procedural-textures": "^1.0.0",
|
|
27
|
+
"rimraf": "^3.0.2",
|
|
28
|
+
"typescript": "^4.4.4"
|
|
157
29
|
},
|
|
158
|
-
"
|
|
159
|
-
|
|
160
|
-
"type": "module"
|
|
161
|
-
}
|
|
30
|
+
"sideEffects": true
|
|
31
|
+
}
|
package/perlinNoise/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./perlinNoiseProceduralTexture";
|
|
1
|
+
export * from "./perlinNoiseProceduralTexture";
|
package/perlinNoise/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./perlinNoiseProceduralTexture
|
|
1
|
+
export * from "./perlinNoiseProceduralTexture";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/perlinNoise/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../lts/proceduralTextures/generated/perlinNoise/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC","sourcesContent":["export * from \"./perlinNoiseProceduralTexture\";\r\n"]}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { Texture } from "@babylonjs/core/Materials/Textures/texture";
|
|
2
|
-
import { ProceduralTexture } from "@babylonjs/core/Materials/Textures/Procedurals/proceduralTexture";
|
|
3
|
-
import { Scene } from "@babylonjs/core/scene";
|
|
4
|
-
import { Nullable } from "@babylonjs/core/types";
|
|
5
|
-
import "./perlinNoiseProceduralTexture.fragment";
|
|
6
|
-
export declare class PerlinNoiseProceduralTexture extends ProceduralTexture {
|
|
7
|
-
time: number;
|
|
8
|
-
timeScale: number;
|
|
9
|
-
translationSpeed: number;
|
|
10
|
-
private _currentTranslation;
|
|
11
|
-
constructor(name: string, size: number, scene?: Nullable<Scene>, fallbackTexture?: Texture, generateMipMaps?: boolean);
|
|
12
|
-
updateShaderUniforms(): void;
|
|
13
|
-
render(useCameraPostProcess?: boolean): void;
|
|
14
|
-
resize(size: any, generateMipMaps: any): void;
|
|
15
|
-
/**
|
|
16
|
-
* Serializes this perlin noise procedural texture
|
|
17
|
-
* @returns a serialized perlin noise procedural texture object
|
|
18
|
-
*/
|
|
19
|
-
serialize(): any;
|
|
20
|
-
/**
|
|
21
|
-
* Creates a Perlin Noise Procedural Texture from parsed perlin noise procedural texture data
|
|
22
|
-
* @param parsedTexture defines parsed texture data
|
|
23
|
-
* @param scene defines the current scene
|
|
24
|
-
* @param rootUrl defines the root URL containing perlin noise procedural texture information
|
|
25
|
-
* @returns a parsed Perlin Noise Procedural Texture
|
|
26
|
-
*/
|
|
27
|
-
static Parse(parsedTexture: any, scene: Scene, rootUrl: string): PerlinNoiseProceduralTexture;
|
|
28
|
-
}
|
|
1
|
+
import type { Texture } from "@babylonjs/core/Materials/Textures/texture.js";
|
|
2
|
+
import { ProceduralTexture } from "@babylonjs/core/Materials/Textures/Procedurals/proceduralTexture.js";
|
|
3
|
+
import type { Scene } from "@babylonjs/core/scene.js";
|
|
4
|
+
import type { Nullable } from "@babylonjs/core/types.js";
|
|
5
|
+
import "./perlinNoiseProceduralTexture.fragment";
|
|
6
|
+
export declare class PerlinNoiseProceduralTexture extends ProceduralTexture {
|
|
7
|
+
time: number;
|
|
8
|
+
timeScale: number;
|
|
9
|
+
translationSpeed: number;
|
|
10
|
+
private _currentTranslation;
|
|
11
|
+
constructor(name: string, size: number, scene?: Nullable<Scene>, fallbackTexture?: Texture, generateMipMaps?: boolean);
|
|
12
|
+
updateShaderUniforms(): void;
|
|
13
|
+
render(useCameraPostProcess?: boolean): void;
|
|
14
|
+
resize(size: any, generateMipMaps: any): void;
|
|
15
|
+
/**
|
|
16
|
+
* Serializes this perlin noise procedural texture
|
|
17
|
+
* @returns a serialized perlin noise procedural texture object
|
|
18
|
+
*/
|
|
19
|
+
serialize(): any;
|
|
20
|
+
/**
|
|
21
|
+
* Creates a Perlin Noise Procedural Texture from parsed perlin noise procedural texture data
|
|
22
|
+
* @param parsedTexture defines parsed texture data
|
|
23
|
+
* @param scene defines the current scene
|
|
24
|
+
* @param rootUrl defines the root URL containing perlin noise procedural texture information
|
|
25
|
+
* @returns a parsed Perlin Noise Procedural Texture
|
|
26
|
+
*/
|
|
27
|
+
static Parse(parsedTexture: any, scene: Scene, rootUrl: string): PerlinNoiseProceduralTexture;
|
|
28
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/** @hidden */
|
|
2
|
-
export declare
|
|
3
|
-
name: string;
|
|
4
|
-
shader: string;
|
|
5
|
-
};
|
|
1
|
+
/** @hidden */
|
|
2
|
+
export declare const perlinNoiseProceduralTexturePixelShader: {
|
|
3
|
+
name: string;
|
|
4
|
+
shader: string;
|
|
5
|
+
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
// Do not edit.
|
|
2
|
+
import { ShaderStore } from "@babylonjs/core/Engines/shaderStore.js";
|
|
3
|
+
var name = "perlinNoiseProceduralTexturePixelShader";
|
|
4
|
+
var shader = "precision highp float;uniform float size;uniform float time;uniform float translationSpeed;varying vec2 vUV;float r(float n)\n{return fract(cos(n*89.42)*343.42);}\nvec2 r(vec2 n)\n{return vec2(r(n.x*23.62-300.0+n.y*34.35),r(n.x*45.13+256.0+n.y*38.89)); }\nfloat worley(vec2 n,float s)\n{float dis=1.0;for(int x=-1; x<=1; x++)\n{for(int y=-1; y<=1; y++)\n{vec2 p=floor(n/s)+vec2(x,y);float d=length(r(p)+vec2(x,y)-fract(n/s));if (dis>d)\ndis=d;}}\nreturn 1.0-dis;}\nvec3 hash33(vec3 p3)\n{p3=fract(p3*vec3(0.1031,0.11369,0.13787));p3+=dot(p3,p3.yxz+19.19);return -1.0+2.0*fract(vec3((p3.x+p3.y)*p3.z,(p3.x+p3.z)*p3.y,(p3.y+p3.z)*p3.x));}\nfloat perlinNoise(vec3 p)\n{vec3 pi=floor(p);vec3 pf=p-pi;vec3 w=pf*pf*(3.0-2.0*pf);return mix(\nmix(\nmix(\ndot(pf-vec3(0,0,0),hash33(pi+vec3(0,0,0))),\ndot(pf-vec3(1,0,0),hash33(pi+vec3(1,0,0))),w.x\n),mix(\ndot(pf-vec3(0,0,1),hash33(pi+vec3(0,0,1))),\ndot(pf-vec3(1,0,1),hash33(pi+vec3(1,0,1))),w.x\n),w.z\n),mix(\nmix(\ndot(pf-vec3(0,1,0),hash33(pi+vec3(0,1,0))),\ndot(pf-vec3(1,1,0),hash33(pi+vec3(1,1,0))),w.x\n),mix(\ndot(pf-vec3(0,1,1),hash33(pi+vec3(0,1,1))),\ndot(pf-vec3(1,1,1),hash33(pi+vec3(1,1,1))),w.x\n),w.z\n),w.y\n);}\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void)\n{vec2 uv=gl_FragCoord.xy+translationSpeed;float dis=(\n1.0+perlinNoise(vec3(uv/vec2(size,size),time*0.05)*8.0))\n* (1.0+(worley(uv,32.0)+ 0.5*worley(2.0*uv,32.0)+0.25*worley(4.0*uv,32.0))\n);gl_FragColor=vec4(vec3(dis/4.0),1.0);}\n";
|
|
5
|
+
// Sideeffect
|
|
6
|
+
ShaderStore.ShadersStore[name] = shader;
|
|
7
|
+
/** @hidden */
|
|
8
|
+
export var perlinNoiseProceduralTexturePixelShader = { name: name, shader: shader };
|
|
7
9
|
//# sourceMappingURL=perlinNoiseProceduralTexture.fragment.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"perlinNoiseProceduralTexture.fragment.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"perlinNoiseProceduralTexture.fragment.js","sourceRoot":"","sources":["../../../../../lts/proceduralTextures/generated/perlinNoise/perlinNoiseProceduralTexture.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,+CAAiC;AAEvD,IAAM,IAAI,GAAG,yCAAyC,CAAC;AACvD,IAAM,MAAM,GAAG,s7CAsCd,CAAC;AACF,aAAa;AACb,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACxC,cAAc;AACd,MAAM,CAAC,IAAM,uCAAuC,GAAG,EAAE,IAAI,MAAA,EAAE,MAAM,QAAA,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"core/Engines/shaderStore\";\n\nconst name = \"perlinNoiseProceduralTexturePixelShader\";\nconst shader = `precision highp float;uniform float size;uniform float time;uniform float translationSpeed;varying vec2 vUV;float r(float n)\n{return fract(cos(n*89.42)*343.42);}\nvec2 r(vec2 n)\n{return vec2(r(n.x*23.62-300.0+n.y*34.35),r(n.x*45.13+256.0+n.y*38.89)); }\nfloat worley(vec2 n,float s)\n{float dis=1.0;for(int x=-1; x<=1; x++)\n{for(int y=-1; y<=1; y++)\n{vec2 p=floor(n/s)+vec2(x,y);float d=length(r(p)+vec2(x,y)-fract(n/s));if (dis>d)\ndis=d;}}\nreturn 1.0-dis;}\nvec3 hash33(vec3 p3)\n{p3=fract(p3*vec3(0.1031,0.11369,0.13787));p3+=dot(p3,p3.yxz+19.19);return -1.0+2.0*fract(vec3((p3.x+p3.y)*p3.z,(p3.x+p3.z)*p3.y,(p3.y+p3.z)*p3.x));}\nfloat perlinNoise(vec3 p)\n{vec3 pi=floor(p);vec3 pf=p-pi;vec3 w=pf*pf*(3.0-2.0*pf);return mix(\nmix(\nmix(\ndot(pf-vec3(0,0,0),hash33(pi+vec3(0,0,0))),\ndot(pf-vec3(1,0,0),hash33(pi+vec3(1,0,0))),w.x\n),mix(\ndot(pf-vec3(0,0,1),hash33(pi+vec3(0,0,1))),\ndot(pf-vec3(1,0,1),hash33(pi+vec3(1,0,1))),w.x\n),w.z\n),mix(\nmix(\ndot(pf-vec3(0,1,0),hash33(pi+vec3(0,1,0))),\ndot(pf-vec3(1,1,0),hash33(pi+vec3(1,1,0))),w.x\n),mix(\ndot(pf-vec3(0,1,1),hash33(pi+vec3(0,1,1))),\ndot(pf-vec3(1,1,1),hash33(pi+vec3(1,1,1))),w.x\n),w.z\n),w.y\n);}\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void)\n{vec2 uv=gl_FragCoord.xy+translationSpeed;float dis=(\n1.0+perlinNoise(vec3(uv/vec2(size,size),time*0.05)*8.0))\n* (1.0+(worley(uv,32.0)+ 0.5*worley(2.0*uv,32.0)+0.25*worley(4.0*uv,32.0))\n);gl_FragColor=vec4(vec3(dis/4.0),1.0);}\n`;\n// Sideeffect\nShaderStore.ShadersStore[name] = shader;\n/** @hidden */\nexport const perlinNoiseProceduralTexturePixelShader = { name, shader };\n"]}
|