@babylonjs/procedural-textures 5.0.0-rc.6 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/brick/brickProceduralTexture.d.ts +35 -35
- package/brick/brickProceduralTexture.fragment.d.ts +5 -5
- package/brick/brickProceduralTexture.fragment.js +8 -8
- package/brick/brickProceduralTexture.js +104 -104
- package/brick/brickProceduralTexture.js.map +1 -1
- package/brick/index.d.ts +1 -1
- package/brick/index.js +1 -1
- package/cloud/cloudProceduralTexture.d.ts +35 -35
- package/cloud/cloudProceduralTexture.fragment.d.ts +5 -5
- package/cloud/cloudProceduralTexture.fragment.js +8 -8
- package/cloud/cloudProceduralTexture.js +104 -104
- package/cloud/cloudProceduralTexture.js.map +1 -1
- package/cloud/index.d.ts +1 -1
- package/cloud/index.js +1 -1
- package/fire/fireProceduralTexture.d.ts +44 -44
- package/fire/fireProceduralTexture.fragment.d.ts +5 -5
- package/fire/fireProceduralTexture.fragment.js +8 -8
- package/fire/fireProceduralTexture.js +166 -166
- package/fire/fireProceduralTexture.js.map +1 -1
- package/fire/index.d.ts +1 -1
- package/fire/index.js +1 -1
- package/grass/grassProceduralTexture.d.ts +29 -29
- package/grass/grassProceduralTexture.fragment.d.ts +5 -5
- package/grass/grassProceduralTexture.fragment.js +8 -8
- package/grass/grassProceduralTexture.js +80 -80
- package/grass/grassProceduralTexture.js.map +1 -1
- package/grass/index.d.ts +1 -1
- package/grass/index.js +1 -1
- package/index.d.ts +10 -10
- package/index.js +11 -10
- package/index.js.map +1 -1
- package/legacy/legacy-brick.d.ts +1 -1
- package/legacy/legacy-brick.js +13 -12
- package/legacy/legacy-brick.js.map +1 -1
- package/legacy/legacy-cloud.d.ts +1 -1
- package/legacy/legacy-cloud.js +13 -12
- package/legacy/legacy-cloud.js.map +1 -1
- package/legacy/legacy-fire.d.ts +1 -1
- package/legacy/legacy-fire.js +13 -12
- package/legacy/legacy-fire.js.map +1 -1
- package/legacy/legacy-grass.d.ts +1 -1
- package/legacy/legacy-grass.js +13 -12
- package/legacy/legacy-grass.js.map +1 -1
- package/legacy/legacy-marble.d.ts +1 -1
- package/legacy/legacy-marble.js +13 -12
- package/legacy/legacy-marble.js.map +1 -1
- package/legacy/legacy-normalMap.d.ts +1 -1
- package/legacy/legacy-normalMap.js +13 -12
- package/legacy/legacy-normalMap.js.map +1 -1
- package/legacy/legacy-perlinNoise.d.ts +1 -1
- package/legacy/legacy-perlinNoise.js +13 -12
- package/legacy/legacy-perlinNoise.js.map +1 -1
- package/legacy/legacy-road.d.ts +1 -1
- package/legacy/legacy-road.js +13 -12
- package/legacy/legacy-road.js.map +1 -1
- package/legacy/legacy-starfield.d.ts +1 -1
- package/legacy/legacy-starfield.js +13 -12
- package/legacy/legacy-starfield.js.map +1 -1
- package/legacy/legacy-wood.d.ts +1 -1
- package/legacy/legacy-wood.js +13 -12
- package/legacy/legacy-wood.js.map +1 -1
- package/legacy/legacy.d.ts +1 -1
- package/legacy/legacy.js +16 -15
- package/legacy/legacy.js.map +1 -1
- package/license.md +71 -0
- package/marble/index.d.ts +1 -1
- package/marble/index.js +1 -1
- package/marble/marbleProceduralTexture.d.ts +35 -35
- package/marble/marbleProceduralTexture.fragment.d.ts +5 -5
- package/marble/marbleProceduralTexture.fragment.js +8 -8
- package/marble/marbleProceduralTexture.js +104 -104
- package/marble/marbleProceduralTexture.js.map +1 -1
- package/normalMap/index.d.ts +1 -1
- package/normalMap/index.js +1 -1
- package/normalMap/normalMapProceduralTexture.d.ts +28 -28
- package/normalMap/normalMapProceduralTexture.fragment.d.ts +5 -5
- package/normalMap/normalMapProceduralTexture.fragment.js +8 -8
- package/normalMap/normalMapProceduralTexture.js +69 -69
- package/normalMap/normalMapProceduralTexture.js.map +1 -1
- package/package.json +24 -5
- package/perlinNoise/index.d.ts +1 -1
- package/perlinNoise/index.js +1 -1
- package/perlinNoise/perlinNoiseProceduralTexture.d.ts +28 -28
- package/perlinNoise/perlinNoiseProceduralTexture.fragment.d.ts +5 -5
- package/perlinNoise/perlinNoiseProceduralTexture.fragment.js +8 -8
- package/perlinNoise/perlinNoiseProceduralTexture.js +69 -69
- package/perlinNoise/perlinNoiseProceduralTexture.js.map +1 -1
- package/road/index.d.ts +1 -1
- package/road/index.js +1 -1
- package/road/roadProceduralTexture.d.ts +26 -26
- package/road/roadProceduralTexture.fragment.d.ts +5 -5
- package/road/roadProceduralTexture.fragment.js +8 -8
- package/road/roadProceduralTexture.js +56 -56
- package/road/roadProceduralTexture.js.map +1 -1
- package/starfield/index.d.ts +1 -1
- package/starfield/index.js +1 -1
- package/starfield/starfieldProceduralTexture.d.ts +55 -55
- package/starfield/starfieldProceduralTexture.fragment.d.ts +5 -5
- package/starfield/starfieldProceduralTexture.fragment.js +8 -8
- package/starfield/starfieldProceduralTexture.js +215 -215
- package/starfield/starfieldProceduralTexture.js.map +1 -1
- package/wood/index.d.ts +1 -1
- package/wood/index.js +1 -1
- package/wood/woodProceduralTexture.d.ts +29 -29
- package/wood/woodProceduralTexture.fragment.d.ts +5 -5
- package/wood/woodProceduralTexture.fragment.js +8 -8
- package/wood/woodProceduralTexture.js +72 -72
- package/wood/woodProceduralTexture.js.map +1 -1
|
@@ -1,216 +1,216 @@
|
|
|
1
|
-
import { __decorate, __extends } from "tslib";
|
|
2
|
-
import { serialize, SerializationHelper } from "@babylonjs/core/Misc/decorators.js";
|
|
3
|
-
import { ProceduralTexture } from "@babylonjs/core/Materials/Textures/Procedurals/proceduralTexture.js";
|
|
4
|
-
import { RegisterClass } from "@babylonjs/core/Misc/typeStore.js";
|
|
5
|
-
import "./starfieldProceduralTexture.fragment.js";
|
|
6
|
-
var StarfieldProceduralTexture = /** @class */ (function (_super) {
|
|
7
|
-
__extends(StarfieldProceduralTexture, _super);
|
|
8
|
-
function StarfieldProceduralTexture(name, size, scene, fallbackTexture, generateMipMaps) {
|
|
9
|
-
if (scene === void 0) { scene = null; }
|
|
10
|
-
var _this = _super.call(this, name, size, "starfieldProceduralTexture", scene, fallbackTexture, generateMipMaps) || this;
|
|
11
|
-
_this._time = 1;
|
|
12
|
-
_this._alpha = 0.5;
|
|
13
|
-
_this._beta = 0.8;
|
|
14
|
-
_this._zoom = 0.8;
|
|
15
|
-
_this._formuparam = 0.53;
|
|
16
|
-
_this._stepsize = 0.1;
|
|
17
|
-
_this._tile = 0.85;
|
|
18
|
-
_this._brightness = 0.0015;
|
|
19
|
-
_this._darkmatter = 0.4;
|
|
20
|
-
_this._distfading = 0.73;
|
|
21
|
-
_this._saturation = 0.85;
|
|
22
|
-
_this.updateShaderUniforms();
|
|
23
|
-
return _this;
|
|
24
|
-
}
|
|
25
|
-
StarfieldProceduralTexture.prototype.updateShaderUniforms = function () {
|
|
26
|
-
this.setFloat("time", this._time);
|
|
27
|
-
this.setFloat("alpha", this._alpha);
|
|
28
|
-
this.setFloat("beta", this._beta);
|
|
29
|
-
this.setFloat("zoom", this._zoom);
|
|
30
|
-
this.setFloat("formuparam", this._formuparam);
|
|
31
|
-
this.setFloat("stepsize", this._stepsize);
|
|
32
|
-
this.setFloat("tile", this._tile);
|
|
33
|
-
this.setFloat("brightness", this._brightness);
|
|
34
|
-
this.setFloat("darkmatter", this._darkmatter);
|
|
35
|
-
this.setFloat("distfading", this._distfading);
|
|
36
|
-
this.setFloat("saturation", this._saturation);
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(StarfieldProceduralTexture.prototype, "time", {
|
|
39
|
-
get: function () {
|
|
40
|
-
return this._time;
|
|
41
|
-
},
|
|
42
|
-
set: function (value) {
|
|
43
|
-
this._time = value;
|
|
44
|
-
this.updateShaderUniforms();
|
|
45
|
-
},
|
|
46
|
-
enumerable: false,
|
|
47
|
-
configurable: true
|
|
48
|
-
});
|
|
49
|
-
Object.defineProperty(StarfieldProceduralTexture.prototype, "alpha", {
|
|
50
|
-
get: function () {
|
|
51
|
-
return this._alpha;
|
|
52
|
-
},
|
|
53
|
-
set: function (value) {
|
|
54
|
-
this._alpha = value;
|
|
55
|
-
this.updateShaderUniforms();
|
|
56
|
-
},
|
|
57
|
-
enumerable: false,
|
|
58
|
-
configurable: true
|
|
59
|
-
});
|
|
60
|
-
Object.defineProperty(StarfieldProceduralTexture.prototype, "beta", {
|
|
61
|
-
get: function () {
|
|
62
|
-
return this._beta;
|
|
63
|
-
},
|
|
64
|
-
set: function (value) {
|
|
65
|
-
this._beta = value;
|
|
66
|
-
this.updateShaderUniforms();
|
|
67
|
-
},
|
|
68
|
-
enumerable: false,
|
|
69
|
-
configurable: true
|
|
70
|
-
});
|
|
71
|
-
Object.defineProperty(StarfieldProceduralTexture.prototype, "formuparam", {
|
|
72
|
-
get: function () {
|
|
73
|
-
return this._formuparam;
|
|
74
|
-
},
|
|
75
|
-
set: function (value) {
|
|
76
|
-
this._formuparam = value;
|
|
77
|
-
this.updateShaderUniforms();
|
|
78
|
-
},
|
|
79
|
-
enumerable: false,
|
|
80
|
-
configurable: true
|
|
81
|
-
});
|
|
82
|
-
Object.defineProperty(StarfieldProceduralTexture.prototype, "stepsize", {
|
|
83
|
-
get: function () {
|
|
84
|
-
return this._stepsize;
|
|
85
|
-
},
|
|
86
|
-
set: function (value) {
|
|
87
|
-
this._stepsize = value;
|
|
88
|
-
this.updateShaderUniforms();
|
|
89
|
-
},
|
|
90
|
-
enumerable: false,
|
|
91
|
-
configurable: true
|
|
92
|
-
});
|
|
93
|
-
Object.defineProperty(StarfieldProceduralTexture.prototype, "zoom", {
|
|
94
|
-
get: function () {
|
|
95
|
-
return this._zoom;
|
|
96
|
-
},
|
|
97
|
-
set: function (value) {
|
|
98
|
-
this._zoom = value;
|
|
99
|
-
this.updateShaderUniforms();
|
|
100
|
-
},
|
|
101
|
-
enumerable: false,
|
|
102
|
-
configurable: true
|
|
103
|
-
});
|
|
104
|
-
Object.defineProperty(StarfieldProceduralTexture.prototype, "tile", {
|
|
105
|
-
get: function () {
|
|
106
|
-
return this._tile;
|
|
107
|
-
},
|
|
108
|
-
set: function (value) {
|
|
109
|
-
this._tile = value;
|
|
110
|
-
this.updateShaderUniforms();
|
|
111
|
-
},
|
|
112
|
-
enumerable: false,
|
|
113
|
-
configurable: true
|
|
114
|
-
});
|
|
115
|
-
Object.defineProperty(StarfieldProceduralTexture.prototype, "brightness", {
|
|
116
|
-
get: function () {
|
|
117
|
-
return this._brightness;
|
|
118
|
-
},
|
|
119
|
-
set: function (value) {
|
|
120
|
-
this._brightness = value;
|
|
121
|
-
this.updateShaderUniforms();
|
|
122
|
-
},
|
|
123
|
-
enumerable: false,
|
|
124
|
-
configurable: true
|
|
125
|
-
});
|
|
126
|
-
Object.defineProperty(StarfieldProceduralTexture.prototype, "darkmatter", {
|
|
127
|
-
get: function () {
|
|
128
|
-
return this._darkmatter;
|
|
129
|
-
},
|
|
130
|
-
set: function (value) {
|
|
131
|
-
this._darkmatter = value;
|
|
132
|
-
this.updateShaderUniforms();
|
|
133
|
-
},
|
|
134
|
-
enumerable: false,
|
|
135
|
-
configurable: true
|
|
136
|
-
});
|
|
137
|
-
Object.defineProperty(StarfieldProceduralTexture.prototype, "distfading", {
|
|
138
|
-
get: function () {
|
|
139
|
-
return this._distfading;
|
|
140
|
-
},
|
|
141
|
-
set: function (value) {
|
|
142
|
-
this._distfading = value;
|
|
143
|
-
this.updateShaderUniforms();
|
|
144
|
-
},
|
|
145
|
-
enumerable: false,
|
|
146
|
-
configurable: true
|
|
147
|
-
});
|
|
148
|
-
Object.defineProperty(StarfieldProceduralTexture.prototype, "saturation", {
|
|
149
|
-
get: function () {
|
|
150
|
-
return this._saturation;
|
|
151
|
-
},
|
|
152
|
-
set: function (value) {
|
|
153
|
-
this._saturation = value;
|
|
154
|
-
this.updateShaderUniforms();
|
|
155
|
-
},
|
|
156
|
-
enumerable: false,
|
|
157
|
-
configurable: true
|
|
158
|
-
});
|
|
159
|
-
/**
|
|
160
|
-
* Serializes this starfield procedural texture
|
|
161
|
-
* @returns a serialized starfield procedural texture object
|
|
162
|
-
*/
|
|
163
|
-
StarfieldProceduralTexture.prototype.serialize = function () {
|
|
164
|
-
var serializationObject = SerializationHelper.Serialize(this, _super.prototype.serialize.call(this));
|
|
165
|
-
serializationObject.customType = "BABYLON.StarfieldProceduralTexture";
|
|
166
|
-
return serializationObject;
|
|
167
|
-
};
|
|
168
|
-
/**
|
|
169
|
-
* Creates a Starfield Procedural Texture from parsed startfield procedural texture data
|
|
170
|
-
* @param parsedTexture defines parsed texture data
|
|
171
|
-
* @param scene defines the current scene
|
|
172
|
-
* @param rootUrl defines the root URL containing startfield procedural texture information
|
|
173
|
-
* @returns a parsed Starfield Procedural Texture
|
|
174
|
-
*/
|
|
175
|
-
StarfieldProceduralTexture.Parse = function (parsedTexture, scene, rootUrl) {
|
|
176
|
-
var texture = SerializationHelper.Parse(function () { return new StarfieldProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps); }, parsedTexture, scene, rootUrl);
|
|
177
|
-
return texture;
|
|
178
|
-
};
|
|
179
|
-
__decorate([
|
|
180
|
-
serialize()
|
|
181
|
-
], StarfieldProceduralTexture.prototype, "time", null);
|
|
182
|
-
__decorate([
|
|
183
|
-
serialize()
|
|
184
|
-
], StarfieldProceduralTexture.prototype, "alpha", null);
|
|
185
|
-
__decorate([
|
|
186
|
-
serialize()
|
|
187
|
-
], StarfieldProceduralTexture.prototype, "beta", null);
|
|
188
|
-
__decorate([
|
|
189
|
-
serialize()
|
|
190
|
-
], StarfieldProceduralTexture.prototype, "formuparam", null);
|
|
191
|
-
__decorate([
|
|
192
|
-
serialize()
|
|
193
|
-
], StarfieldProceduralTexture.prototype, "stepsize", null);
|
|
194
|
-
__decorate([
|
|
195
|
-
serialize()
|
|
196
|
-
], StarfieldProceduralTexture.prototype, "zoom", null);
|
|
197
|
-
__decorate([
|
|
198
|
-
serialize()
|
|
199
|
-
], StarfieldProceduralTexture.prototype, "tile", null);
|
|
200
|
-
__decorate([
|
|
201
|
-
serialize()
|
|
202
|
-
], StarfieldProceduralTexture.prototype, "brightness", null);
|
|
203
|
-
__decorate([
|
|
204
|
-
serialize()
|
|
205
|
-
], StarfieldProceduralTexture.prototype, "darkmatter", null);
|
|
206
|
-
__decorate([
|
|
207
|
-
serialize()
|
|
208
|
-
], StarfieldProceduralTexture.prototype, "distfading", null);
|
|
209
|
-
__decorate([
|
|
210
|
-
serialize()
|
|
211
|
-
], StarfieldProceduralTexture.prototype, "saturation", null);
|
|
212
|
-
return StarfieldProceduralTexture;
|
|
213
|
-
}(ProceduralTexture));
|
|
214
|
-
export { StarfieldProceduralTexture };
|
|
215
|
-
RegisterClass("BABYLON.StarfieldProceduralTexture", StarfieldProceduralTexture);
|
|
1
|
+
import { __decorate, __extends } from "tslib";
|
|
2
|
+
import { serialize, SerializationHelper } from "@babylonjs/core/Misc/decorators.js";
|
|
3
|
+
import { ProceduralTexture } from "@babylonjs/core/Materials/Textures/Procedurals/proceduralTexture.js";
|
|
4
|
+
import { RegisterClass } from "@babylonjs/core/Misc/typeStore.js";
|
|
5
|
+
import "./starfieldProceduralTexture.fragment.js";
|
|
6
|
+
var StarfieldProceduralTexture = /** @class */ (function (_super) {
|
|
7
|
+
__extends(StarfieldProceduralTexture, _super);
|
|
8
|
+
function StarfieldProceduralTexture(name, size, scene, fallbackTexture, generateMipMaps) {
|
|
9
|
+
if (scene === void 0) { scene = null; }
|
|
10
|
+
var _this = _super.call(this, name, size, "starfieldProceduralTexture", scene, fallbackTexture, generateMipMaps) || this;
|
|
11
|
+
_this._time = 1;
|
|
12
|
+
_this._alpha = 0.5;
|
|
13
|
+
_this._beta = 0.8;
|
|
14
|
+
_this._zoom = 0.8;
|
|
15
|
+
_this._formuparam = 0.53;
|
|
16
|
+
_this._stepsize = 0.1;
|
|
17
|
+
_this._tile = 0.85;
|
|
18
|
+
_this._brightness = 0.0015;
|
|
19
|
+
_this._darkmatter = 0.4;
|
|
20
|
+
_this._distfading = 0.73;
|
|
21
|
+
_this._saturation = 0.85;
|
|
22
|
+
_this.updateShaderUniforms();
|
|
23
|
+
return _this;
|
|
24
|
+
}
|
|
25
|
+
StarfieldProceduralTexture.prototype.updateShaderUniforms = function () {
|
|
26
|
+
this.setFloat("time", this._time);
|
|
27
|
+
this.setFloat("alpha", this._alpha);
|
|
28
|
+
this.setFloat("beta", this._beta);
|
|
29
|
+
this.setFloat("zoom", this._zoom);
|
|
30
|
+
this.setFloat("formuparam", this._formuparam);
|
|
31
|
+
this.setFloat("stepsize", this._stepsize);
|
|
32
|
+
this.setFloat("tile", this._tile);
|
|
33
|
+
this.setFloat("brightness", this._brightness);
|
|
34
|
+
this.setFloat("darkmatter", this._darkmatter);
|
|
35
|
+
this.setFloat("distfading", this._distfading);
|
|
36
|
+
this.setFloat("saturation", this._saturation);
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(StarfieldProceduralTexture.prototype, "time", {
|
|
39
|
+
get: function () {
|
|
40
|
+
return this._time;
|
|
41
|
+
},
|
|
42
|
+
set: function (value) {
|
|
43
|
+
this._time = value;
|
|
44
|
+
this.updateShaderUniforms();
|
|
45
|
+
},
|
|
46
|
+
enumerable: false,
|
|
47
|
+
configurable: true
|
|
48
|
+
});
|
|
49
|
+
Object.defineProperty(StarfieldProceduralTexture.prototype, "alpha", {
|
|
50
|
+
get: function () {
|
|
51
|
+
return this._alpha;
|
|
52
|
+
},
|
|
53
|
+
set: function (value) {
|
|
54
|
+
this._alpha = value;
|
|
55
|
+
this.updateShaderUniforms();
|
|
56
|
+
},
|
|
57
|
+
enumerable: false,
|
|
58
|
+
configurable: true
|
|
59
|
+
});
|
|
60
|
+
Object.defineProperty(StarfieldProceduralTexture.prototype, "beta", {
|
|
61
|
+
get: function () {
|
|
62
|
+
return this._beta;
|
|
63
|
+
},
|
|
64
|
+
set: function (value) {
|
|
65
|
+
this._beta = value;
|
|
66
|
+
this.updateShaderUniforms();
|
|
67
|
+
},
|
|
68
|
+
enumerable: false,
|
|
69
|
+
configurable: true
|
|
70
|
+
});
|
|
71
|
+
Object.defineProperty(StarfieldProceduralTexture.prototype, "formuparam", {
|
|
72
|
+
get: function () {
|
|
73
|
+
return this._formuparam;
|
|
74
|
+
},
|
|
75
|
+
set: function (value) {
|
|
76
|
+
this._formuparam = value;
|
|
77
|
+
this.updateShaderUniforms();
|
|
78
|
+
},
|
|
79
|
+
enumerable: false,
|
|
80
|
+
configurable: true
|
|
81
|
+
});
|
|
82
|
+
Object.defineProperty(StarfieldProceduralTexture.prototype, "stepsize", {
|
|
83
|
+
get: function () {
|
|
84
|
+
return this._stepsize;
|
|
85
|
+
},
|
|
86
|
+
set: function (value) {
|
|
87
|
+
this._stepsize = value;
|
|
88
|
+
this.updateShaderUniforms();
|
|
89
|
+
},
|
|
90
|
+
enumerable: false,
|
|
91
|
+
configurable: true
|
|
92
|
+
});
|
|
93
|
+
Object.defineProperty(StarfieldProceduralTexture.prototype, "zoom", {
|
|
94
|
+
get: function () {
|
|
95
|
+
return this._zoom;
|
|
96
|
+
},
|
|
97
|
+
set: function (value) {
|
|
98
|
+
this._zoom = value;
|
|
99
|
+
this.updateShaderUniforms();
|
|
100
|
+
},
|
|
101
|
+
enumerable: false,
|
|
102
|
+
configurable: true
|
|
103
|
+
});
|
|
104
|
+
Object.defineProperty(StarfieldProceduralTexture.prototype, "tile", {
|
|
105
|
+
get: function () {
|
|
106
|
+
return this._tile;
|
|
107
|
+
},
|
|
108
|
+
set: function (value) {
|
|
109
|
+
this._tile = value;
|
|
110
|
+
this.updateShaderUniforms();
|
|
111
|
+
},
|
|
112
|
+
enumerable: false,
|
|
113
|
+
configurable: true
|
|
114
|
+
});
|
|
115
|
+
Object.defineProperty(StarfieldProceduralTexture.prototype, "brightness", {
|
|
116
|
+
get: function () {
|
|
117
|
+
return this._brightness;
|
|
118
|
+
},
|
|
119
|
+
set: function (value) {
|
|
120
|
+
this._brightness = value;
|
|
121
|
+
this.updateShaderUniforms();
|
|
122
|
+
},
|
|
123
|
+
enumerable: false,
|
|
124
|
+
configurable: true
|
|
125
|
+
});
|
|
126
|
+
Object.defineProperty(StarfieldProceduralTexture.prototype, "darkmatter", {
|
|
127
|
+
get: function () {
|
|
128
|
+
return this._darkmatter;
|
|
129
|
+
},
|
|
130
|
+
set: function (value) {
|
|
131
|
+
this._darkmatter = value;
|
|
132
|
+
this.updateShaderUniforms();
|
|
133
|
+
},
|
|
134
|
+
enumerable: false,
|
|
135
|
+
configurable: true
|
|
136
|
+
});
|
|
137
|
+
Object.defineProperty(StarfieldProceduralTexture.prototype, "distfading", {
|
|
138
|
+
get: function () {
|
|
139
|
+
return this._distfading;
|
|
140
|
+
},
|
|
141
|
+
set: function (value) {
|
|
142
|
+
this._distfading = value;
|
|
143
|
+
this.updateShaderUniforms();
|
|
144
|
+
},
|
|
145
|
+
enumerable: false,
|
|
146
|
+
configurable: true
|
|
147
|
+
});
|
|
148
|
+
Object.defineProperty(StarfieldProceduralTexture.prototype, "saturation", {
|
|
149
|
+
get: function () {
|
|
150
|
+
return this._saturation;
|
|
151
|
+
},
|
|
152
|
+
set: function (value) {
|
|
153
|
+
this._saturation = value;
|
|
154
|
+
this.updateShaderUniforms();
|
|
155
|
+
},
|
|
156
|
+
enumerable: false,
|
|
157
|
+
configurable: true
|
|
158
|
+
});
|
|
159
|
+
/**
|
|
160
|
+
* Serializes this starfield procedural texture
|
|
161
|
+
* @returns a serialized starfield procedural texture object
|
|
162
|
+
*/
|
|
163
|
+
StarfieldProceduralTexture.prototype.serialize = function () {
|
|
164
|
+
var serializationObject = SerializationHelper.Serialize(this, _super.prototype.serialize.call(this));
|
|
165
|
+
serializationObject.customType = "BABYLON.StarfieldProceduralTexture";
|
|
166
|
+
return serializationObject;
|
|
167
|
+
};
|
|
168
|
+
/**
|
|
169
|
+
* Creates a Starfield Procedural Texture from parsed startfield procedural texture data
|
|
170
|
+
* @param parsedTexture defines parsed texture data
|
|
171
|
+
* @param scene defines the current scene
|
|
172
|
+
* @param rootUrl defines the root URL containing startfield procedural texture information
|
|
173
|
+
* @returns a parsed Starfield Procedural Texture
|
|
174
|
+
*/
|
|
175
|
+
StarfieldProceduralTexture.Parse = function (parsedTexture, scene, rootUrl) {
|
|
176
|
+
var texture = SerializationHelper.Parse(function () { return new StarfieldProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps); }, parsedTexture, scene, rootUrl);
|
|
177
|
+
return texture;
|
|
178
|
+
};
|
|
179
|
+
__decorate([
|
|
180
|
+
serialize()
|
|
181
|
+
], StarfieldProceduralTexture.prototype, "time", null);
|
|
182
|
+
__decorate([
|
|
183
|
+
serialize()
|
|
184
|
+
], StarfieldProceduralTexture.prototype, "alpha", null);
|
|
185
|
+
__decorate([
|
|
186
|
+
serialize()
|
|
187
|
+
], StarfieldProceduralTexture.prototype, "beta", null);
|
|
188
|
+
__decorate([
|
|
189
|
+
serialize()
|
|
190
|
+
], StarfieldProceduralTexture.prototype, "formuparam", null);
|
|
191
|
+
__decorate([
|
|
192
|
+
serialize()
|
|
193
|
+
], StarfieldProceduralTexture.prototype, "stepsize", null);
|
|
194
|
+
__decorate([
|
|
195
|
+
serialize()
|
|
196
|
+
], StarfieldProceduralTexture.prototype, "zoom", null);
|
|
197
|
+
__decorate([
|
|
198
|
+
serialize()
|
|
199
|
+
], StarfieldProceduralTexture.prototype, "tile", null);
|
|
200
|
+
__decorate([
|
|
201
|
+
serialize()
|
|
202
|
+
], StarfieldProceduralTexture.prototype, "brightness", null);
|
|
203
|
+
__decorate([
|
|
204
|
+
serialize()
|
|
205
|
+
], StarfieldProceduralTexture.prototype, "darkmatter", null);
|
|
206
|
+
__decorate([
|
|
207
|
+
serialize()
|
|
208
|
+
], StarfieldProceduralTexture.prototype, "distfading", null);
|
|
209
|
+
__decorate([
|
|
210
|
+
serialize()
|
|
211
|
+
], StarfieldProceduralTexture.prototype, "saturation", null);
|
|
212
|
+
return StarfieldProceduralTexture;
|
|
213
|
+
}(ProceduralTexture));
|
|
214
|
+
export { StarfieldProceduralTexture };
|
|
215
|
+
RegisterClass("BABYLON.StarfieldProceduralTexture", StarfieldProceduralTexture);
|
|
216
216
|
//# sourceMappingURL=starfieldProceduralTexture.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"starfieldProceduralTexture.js","sourceRoot":"","sources":["../../../../../lts/proceduralTextures/generated/starfield/starfieldProceduralTexture.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,2CAA6B;AAEtE,OAAO,EAAE,iBAAiB,EAAE,4EAA8D;AAE1F,OAAO,EAAE,aAAa,EAAE,0CAA4B;AAEpD,OAAO,uCAAuC,CAAC;AAE/C;IAAgD,8CAAiB;IAa7D,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;QAfO,WAAK,GAAG,CAAC,CAAC;QACV,YAAM,GAAG,GAAG,CAAC;QACb,WAAK,GAAG,GAAG,CAAC;QACZ,WAAK,GAAG,GAAG,CAAC;QACZ,iBAAW,GAAG,IAAI,CAAC;QACnB,eAAS,GAAG,GAAG,CAAC;QAChB,WAAK,GAAG,IAAI,CAAC;QACb,iBAAW,GAAG,MAAM,CAAC;QACrB,iBAAW,GAAG,GAAG,CAAC;QAClB,iBAAW,GAAG,IAAI,CAAC;QACnB,iBAAW,GAAG,IAAI,CAAC;QAIvB,KAAI,CAAC,oBAAoB,EAAE,CAAC;;IAChC,CAAC;IAEM,yDAAoB,GAA3B;QACI,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;QAClC,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QACpC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;QAClC,IAAI,CAAC,QAAQ,C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C,EAAE,0BAA0B,CAAC,CAAC","sourcesContent":["import { serialize, SerializationHelper } from \"core/Misc/decorators\";\r\nimport { Texture } from \"core/Materials/Textures/texture\";\r\nimport { ProceduralTexture } from \"core/Materials/Textures/Procedurals/proceduralTexture\";\r\nimport { Scene } from \"core/scene\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport { Nullable } from \"core/types\";\r\nimport \"./starfieldProceduralTexture.fragment\";\r\n\r\nexport class StarfieldProceduralTexture extends ProceduralTexture {\r\n private _time = 1;\r\n private _alpha = 0.5;\r\n private _beta = 0.8;\r\n private _zoom = 0.8;\r\n private _formuparam = 0.53;\r\n private _stepsize = 0.1;\r\n private _tile = 0.85;\r\n private _brightness = 0.0015;\r\n private _darkmatter = 0.4;\r\n private _distfading = 0.73;\r\n private _saturation = 0.85;\r\n\r\n constructor(name: string, size: number, scene: Nullable<Scene> = null, fallbackTexture?: Texture, generateMipMaps?: boolean) {\r\n super(name, size, \"starfieldProceduralTexture\", scene, fallbackTexture, generateMipMaps);\r\n this.updateShaderUniforms();\r\n }\r\n\r\n public updateShaderUniforms() {\r\n this.setFloat(\"time\", this._time);\r\n this.setFloat(\"alpha\", this._alpha);\r\n this.setFloat(\"beta\", this._beta);\r\n this.setFloat(\"zoom\", this._zoom);\r\n this.setFloat(\"formuparam\", this._formuparam);\r\n this.setFloat(\"stepsize\", this._stepsize);\r\n this.setFloat(\"tile\", this._tile);\r\n this.setFloat(\"brightness\", this._brightness);\r\n this.setFloat(\"darkmatter\", this._darkmatter);\r\n this.setFloat(\"distfading\", this._distfading);\r\n this.setFloat(\"saturation\", this._saturation);\r\n }\r\n\r\n @serialize()\r\n public get time(): number {\r\n return this._time;\r\n }\r\n\r\n public set time(value: number) {\r\n this._time = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n @serialize()\r\n public get alpha(): number {\r\n return this._alpha;\r\n }\r\n\r\n public set alpha(value: number) {\r\n this._alpha = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n @serialize()\r\n public get beta(): number {\r\n return this._beta;\r\n }\r\n\r\n public set beta(value: number) {\r\n this._beta = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n @serialize()\r\n public get formuparam(): number {\r\n return this._formuparam;\r\n }\r\n\r\n public set formuparam(value: number) {\r\n this._formuparam = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n @serialize()\r\n public get stepsize(): number {\r\n return this._stepsize;\r\n }\r\n\r\n public set stepsize(value: number) {\r\n this._stepsize = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n @serialize()\r\n public get zoom(): number {\r\n return this._zoom;\r\n }\r\n\r\n public set zoom(value: number) {\r\n this._zoom = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n @serialize()\r\n public get tile(): number {\r\n return this._tile;\r\n }\r\n\r\n public set tile(value: number) {\r\n this._tile = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n @serialize()\r\n public get brightness(): number {\r\n return this._brightness;\r\n }\r\n\r\n public set brightness(value: number) {\r\n this._brightness = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n @serialize()\r\n public get darkmatter(): number {\r\n return this._darkmatter;\r\n }\r\n\r\n public set darkmatter(value: number) {\r\n this._darkmatter = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n @serialize()\r\n public get distfading(): number {\r\n return this._distfading;\r\n }\r\n\r\n public set distfading(value: number) {\r\n this._distfading = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n @serialize()\r\n public get saturation(): number {\r\n return this._saturation;\r\n }\r\n\r\n public set saturation(value: number) {\r\n this._saturation = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n /**\r\n * Serializes this starfield procedural texture\r\n * @returns a serialized starfield procedural texture object\r\n */\r\n public serialize(): any {\r\n const serializationObject = SerializationHelper.Serialize(this, super.serialize());\r\n serializationObject.customType = \"BABYLON.StarfieldProceduralTexture\";\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Creates a Starfield Procedural Texture from parsed startfield 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 startfield procedural texture information\r\n * @returns a parsed Starfield Procedural Texture\r\n */\r\n public static Parse(parsedTexture: any, scene: Scene, rootUrl: string): StarfieldProceduralTexture {\r\n const texture = SerializationHelper.Parse(\r\n () => new StarfieldProceduralTexture(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.StarfieldProceduralTexture\", StarfieldProceduralTexture);\r\n"]}
|
|
1
|
+
{"version":3,"file":"starfieldProceduralTexture.js","sourceRoot":"","sources":["../../../../../lts/proceduralTextures/generated/starfield/starfieldProceduralTexture.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,2CAA6B;AAEtE,OAAO,EAAE,iBAAiB,EAAE,4EAA8D;AAE1F,OAAO,EAAE,aAAa,EAAE,0CAA4B;AAEpD,OAAO,uCAAuC,CAAC;AAE/C;IAAgD,8CAAiB;IAa7D,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;QAfO,WAAK,GAAG,CAAC,CAAC;QACV,YAAM,GAAG,GAAG,CAAC;QACb,WAAK,GAAG,GAAG,CAAC;QACZ,WAAK,GAAG,GAAG,CAAC;QACZ,iBAAW,GAAG,IAAI,CAAC;QACnB,eAAS,GAAG,GAAG,CAAC;QAChB,WAAK,GAAG,IAAI,CAAC;QACb,iBAAW,GAAG,MAAM,CAAC;QACrB,iBAAW,GAAG,GAAG,CAAC;QAClB,iBAAW,GAAG,IAAI,CAAC;Q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S,EAAE;0DAGX;IAQD;QADC,SAAS,EAAE;gEAGX;IAQD;QADC,SAAS,EAAE;8DAGX;IAQD;QADC,SAAS,EAAE;0DAGX;IAQD;QADC,SAAS,EAAE;0DAGX;IAQD;QADC,SAAS,EAAE;gEAGX;IAQD;QADC,SAAS,EAAE;gEAGX;IAQD;QADC,SAAS,EAAE;gEAGX;IAQD;QADC,SAAS,EAAE;gEAGX;IAmCL,iCAAC;CAAA,AA1KD,CAAgD,iBAAiB,GA0KhE;SA1KY,0BAA0B;AA4KvC,aAAa,CAAC,oCAAoC,EAAE,0BAA0B,CAAC,CAAC","sourcesContent":["import { serialize, SerializationHelper } from \"core/Misc/decorators\";\r\nimport type { Texture } from \"core/Materials/Textures/texture\";\r\nimport { ProceduralTexture } from \"core/Materials/Textures/Procedurals/proceduralTexture\";\r\nimport type { Scene } from \"core/scene\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport type { Nullable } from \"core/types\";\r\nimport \"./starfieldProceduralTexture.fragment\";\r\n\r\nexport class StarfieldProceduralTexture extends ProceduralTexture {\r\n private _time = 1;\r\n private _alpha = 0.5;\r\n private _beta = 0.8;\r\n private _zoom = 0.8;\r\n private _formuparam = 0.53;\r\n private _stepsize = 0.1;\r\n private _tile = 0.85;\r\n private _brightness = 0.0015;\r\n private _darkmatter = 0.4;\r\n private _distfading = 0.73;\r\n private _saturation = 0.85;\r\n\r\n constructor(name: string, size: number, scene: Nullable<Scene> = null, fallbackTexture?: Texture, generateMipMaps?: boolean) {\r\n super(name, size, \"starfieldProceduralTexture\", scene, fallbackTexture, generateMipMaps);\r\n this.updateShaderUniforms();\r\n }\r\n\r\n public updateShaderUniforms() {\r\n this.setFloat(\"time\", this._time);\r\n this.setFloat(\"alpha\", this._alpha);\r\n this.setFloat(\"beta\", this._beta);\r\n this.setFloat(\"zoom\", this._zoom);\r\n this.setFloat(\"formuparam\", this._formuparam);\r\n this.setFloat(\"stepsize\", this._stepsize);\r\n this.setFloat(\"tile\", this._tile);\r\n this.setFloat(\"brightness\", this._brightness);\r\n this.setFloat(\"darkmatter\", this._darkmatter);\r\n this.setFloat(\"distfading\", this._distfading);\r\n this.setFloat(\"saturation\", this._saturation);\r\n }\r\n\r\n @serialize()\r\n public get time(): number {\r\n return this._time;\r\n }\r\n\r\n public set time(value: number) {\r\n this._time = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n @serialize()\r\n public get alpha(): number {\r\n return this._alpha;\r\n }\r\n\r\n public set alpha(value: number) {\r\n this._alpha = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n @serialize()\r\n public get beta(): number {\r\n return this._beta;\r\n }\r\n\r\n public set beta(value: number) {\r\n this._beta = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n @serialize()\r\n public get formuparam(): number {\r\n return this._formuparam;\r\n }\r\n\r\n public set formuparam(value: number) {\r\n this._formuparam = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n @serialize()\r\n public get stepsize(): number {\r\n return this._stepsize;\r\n }\r\n\r\n public set stepsize(value: number) {\r\n this._stepsize = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n @serialize()\r\n public get zoom(): number {\r\n return this._zoom;\r\n }\r\n\r\n public set zoom(value: number) {\r\n this._zoom = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n @serialize()\r\n public get tile(): number {\r\n return this._tile;\r\n }\r\n\r\n public set tile(value: number) {\r\n this._tile = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n @serialize()\r\n public get brightness(): number {\r\n return this._brightness;\r\n }\r\n\r\n public set brightness(value: number) {\r\n this._brightness = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n @serialize()\r\n public get darkmatter(): number {\r\n return this._darkmatter;\r\n }\r\n\r\n public set darkmatter(value: number) {\r\n this._darkmatter = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n @serialize()\r\n public get distfading(): number {\r\n return this._distfading;\r\n }\r\n\r\n public set distfading(value: number) {\r\n this._distfading = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n @serialize()\r\n public get saturation(): number {\r\n return this._saturation;\r\n }\r\n\r\n public set saturation(value: number) {\r\n this._saturation = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n /**\r\n * Serializes this starfield procedural texture\r\n * @returns a serialized starfield procedural texture object\r\n */\r\n public serialize(): any {\r\n const serializationObject = SerializationHelper.Serialize(this, super.serialize());\r\n serializationObject.customType = \"BABYLON.StarfieldProceduralTexture\";\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Creates a Starfield Procedural Texture from parsed startfield 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 startfield procedural texture information\r\n * @returns a parsed Starfield Procedural Texture\r\n */\r\n public static Parse(parsedTexture: any, scene: Scene, rootUrl: string): StarfieldProceduralTexture {\r\n const texture = SerializationHelper.Parse(\r\n () => new StarfieldProceduralTexture(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.StarfieldProceduralTexture\", StarfieldProceduralTexture);\r\n"]}
|
package/wood/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./woodProceduralTexture";
|
|
1
|
+
export * from "./woodProceduralTexture";
|
package/wood/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./woodProceduralTexture.js";
|
|
1
|
+
export * from "./woodProceduralTexture.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { Color3 } from "@babylonjs/core/Maths/math.color.js";
|
|
2
|
-
import { Texture } from "@babylonjs/core/Materials/Textures/texture.js";
|
|
3
|
-
import { ProceduralTexture } from "@babylonjs/core/Materials/Textures/Procedurals/proceduralTexture.js";
|
|
4
|
-
import { Scene } from "@babylonjs/core/scene.js";
|
|
5
|
-
import { Nullable } from "@babylonjs/core/types.js";
|
|
6
|
-
import "./woodProceduralTexture.fragment";
|
|
7
|
-
export declare class WoodProceduralTexture extends ProceduralTexture {
|
|
8
|
-
private _ampScale;
|
|
9
|
-
private _woodColor;
|
|
10
|
-
constructor(name: string, size: number, scene?: Nullable<Scene>, fallbackTexture?: Texture, generateMipMaps?: boolean);
|
|
11
|
-
updateShaderUniforms(): void;
|
|
12
|
-
get ampScale(): number;
|
|
13
|
-
set ampScale(value: number);
|
|
14
|
-
get woodColor(): Color3;
|
|
15
|
-
set woodColor(value: Color3);
|
|
16
|
-
/**
|
|
17
|
-
* Serializes this wood procedural texture
|
|
18
|
-
* @returns a serialized wood procedural texture object
|
|
19
|
-
*/
|
|
20
|
-
serialize(): any;
|
|
21
|
-
/**
|
|
22
|
-
* Creates a Wood Procedural Texture from parsed wood procedural texture data
|
|
23
|
-
* @param parsedTexture defines parsed texture data
|
|
24
|
-
* @param scene defines the current scene
|
|
25
|
-
* @param rootUrl defines the root URL containing wood procedural texture information
|
|
26
|
-
* @returns a parsed Wood Procedural Texture
|
|
27
|
-
*/
|
|
28
|
-
static Parse(parsedTexture: any, scene: Scene, rootUrl: string): WoodProceduralTexture;
|
|
29
|
-
}
|
|
1
|
+
import { Color3 } from "@babylonjs/core/Maths/math.color.js";
|
|
2
|
+
import type { Texture } from "@babylonjs/core/Materials/Textures/texture.js";
|
|
3
|
+
import { ProceduralTexture } from "@babylonjs/core/Materials/Textures/Procedurals/proceduralTexture.js";
|
|
4
|
+
import type { Scene } from "@babylonjs/core/scene.js";
|
|
5
|
+
import type { Nullable } from "@babylonjs/core/types.js";
|
|
6
|
+
import "./woodProceduralTexture.fragment";
|
|
7
|
+
export declare class WoodProceduralTexture extends ProceduralTexture {
|
|
8
|
+
private _ampScale;
|
|
9
|
+
private _woodColor;
|
|
10
|
+
constructor(name: string, size: number, scene?: Nullable<Scene>, fallbackTexture?: Texture, generateMipMaps?: boolean);
|
|
11
|
+
updateShaderUniforms(): void;
|
|
12
|
+
get ampScale(): number;
|
|
13
|
+
set ampScale(value: number);
|
|
14
|
+
get woodColor(): Color3;
|
|
15
|
+
set woodColor(value: Color3);
|
|
16
|
+
/**
|
|
17
|
+
* Serializes this wood procedural texture
|
|
18
|
+
* @returns a serialized wood procedural texture object
|
|
19
|
+
*/
|
|
20
|
+
serialize(): any;
|
|
21
|
+
/**
|
|
22
|
+
* Creates a Wood Procedural Texture from parsed wood procedural texture data
|
|
23
|
+
* @param parsedTexture defines parsed texture data
|
|
24
|
+
* @param scene defines the current scene
|
|
25
|
+
* @param rootUrl defines the root URL containing wood procedural texture information
|
|
26
|
+
* @returns a parsed Wood Procedural Texture
|
|
27
|
+
*/
|
|
28
|
+
static Parse(parsedTexture: any, scene: Scene, rootUrl: string): WoodProceduralTexture;
|
|
29
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/** @hidden */
|
|
2
|
-
export declare const woodProceduralTexturePixelShader: {
|
|
3
|
-
name: string;
|
|
4
|
-
shader: string;
|
|
5
|
-
};
|
|
1
|
+
/** @hidden */
|
|
2
|
+
export declare const woodProceduralTexturePixelShader: {
|
|
3
|
+
name: string;
|
|
4
|
+
shader: string;
|
|
5
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
// Do not edit.
|
|
2
|
-
import { ShaderStore } from "@babylonjs/core/Engines/shaderStore.js";
|
|
3
|
-
var name = "woodProceduralTexturePixelShader";
|
|
4
|
-
var shader = "precision highp float;varying vec2 vPosition;varying vec2 vUV;uniform float ampScale;uniform vec3 woodColor;float rand(vec2 n) {return fract(cos(dot(n,vec2(12.9898,4.1414)))*43758.5453);}\nfloat noise(vec2 n) {const vec2 d=vec2(0.0,1.0);vec2 b=floor(n),f=smoothstep(vec2(0.0),vec2(1.0),fract(n));return mix(mix(rand(b),rand(b+d.yx),f.x),mix(rand(b+d.xy),rand(b+d.yy),f.x),f.y);}\nfloat fbm(vec2 n) {float total=0.0,amplitude=1.0;for (int i=0; i<4; i++) {total+=noise(n)*amplitude;n+=n;amplitude*=0.5;}\nreturn total;}\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\nfloat ratioy=mod(vUV.x*ampScale,2.0+fbm(vUV*0.8));vec3 wood=woodColor*ratioy;gl_FragColor=vec4(wood,1.0);\n#define CUSTOM_FRAGMENT_MAIN_END\n}";
|
|
5
|
-
// Sideeffect
|
|
6
|
-
ShaderStore.ShadersStore[name] = shader;
|
|
7
|
-
/** @hidden */
|
|
8
|
-
export var woodProceduralTexturePixelShader = { name: name, shader: shader };
|
|
1
|
+
// Do not edit.
|
|
2
|
+
import { ShaderStore } from "@babylonjs/core/Engines/shaderStore.js";
|
|
3
|
+
var name = "woodProceduralTexturePixelShader";
|
|
4
|
+
var shader = "precision highp float;varying vec2 vPosition;varying vec2 vUV;uniform float ampScale;uniform vec3 woodColor;float rand(vec2 n) {return fract(cos(dot(n,vec2(12.9898,4.1414)))*43758.5453);}\nfloat noise(vec2 n) {const vec2 d=vec2(0.0,1.0);vec2 b=floor(n),f=smoothstep(vec2(0.0),vec2(1.0),fract(n));return mix(mix(rand(b),rand(b+d.yx),f.x),mix(rand(b+d.xy),rand(b+d.yy),f.x),f.y);}\nfloat fbm(vec2 n) {float total=0.0,amplitude=1.0;for (int i=0; i<4; i++) {total+=noise(n)*amplitude;n+=n;amplitude*=0.5;}\nreturn total;}\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\nfloat ratioy=mod(vUV.x*ampScale,2.0+fbm(vUV*0.8));vec3 wood=woodColor*ratioy;gl_FragColor=vec4(wood,1.0);\n#define CUSTOM_FRAGMENT_MAIN_END\n}";
|
|
5
|
+
// Sideeffect
|
|
6
|
+
ShaderStore.ShadersStore[name] = shader;
|
|
7
|
+
/** @hidden */
|
|
8
|
+
export var woodProceduralTexturePixelShader = { name: name, shader: shader };
|
|
9
9
|
//# sourceMappingURL=woodProceduralTexture.fragment.js.map
|