@renderlayer/textures 0.0.1 → 0.0.5
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/dist/textures.esm-bundler.js +47 -3
- package/package.json +3 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ImageUtils, ClampToEdgeWrapping, LinearFilter, LinearMipmapLinearFilter, RGBAFormat, UnsignedByteType, NoColorSpace, UVMapping, MirroredRepeatWrapping, RepeatWrapping } from '@renderlayer/shared';
|
|
2
|
-
import { generateUUID, Vector2, Matrix3 } from '@renderlayer/math';
|
|
1
|
+
import { ImageUtils, ClampToEdgeWrapping, LinearFilter, LinearMipmapLinearFilter, RGBAFormat, UnsignedByteType, NoColorSpace, UVMapping, MirroredRepeatWrapping, RepeatWrapping, CubeReflectionMapping, NearestFilter } from '@renderlayer/shared';
|
|
3
2
|
import { EventDispatcher } from '@renderlayer/core';
|
|
3
|
+
import { generateUUID, Vector2, Matrix3 } from '@renderlayer/math';
|
|
4
4
|
|
|
5
5
|
class Source {
|
|
6
6
|
constructor(data = null) {
|
|
@@ -246,4 +246,48 @@ Texture.DEFAULT_IMAGE = null;
|
|
|
246
246
|
Texture.DEFAULT_MAPPING = UVMapping;
|
|
247
247
|
Texture.DEFAULT_ANISOTROPY = 1;
|
|
248
248
|
|
|
249
|
-
|
|
249
|
+
class CubeTexture extends Texture {
|
|
250
|
+
constructor(images, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, colorSpace) {
|
|
251
|
+
images = images !== void 0 ? images : [];
|
|
252
|
+
mapping = mapping !== void 0 ? mapping : CubeReflectionMapping;
|
|
253
|
+
super(images, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, colorSpace);
|
|
254
|
+
this.isCubeTexture = true;
|
|
255
|
+
this.flipY = false;
|
|
256
|
+
}
|
|
257
|
+
get images() {
|
|
258
|
+
return this.image;
|
|
259
|
+
}
|
|
260
|
+
set images(value) {
|
|
261
|
+
this.image = value;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
class Data3DTexture extends Texture {
|
|
266
|
+
constructor(data = null, width = 1, height = 1, depth = 1) {
|
|
267
|
+
super(null);
|
|
268
|
+
this.isData3DTexture = true;
|
|
269
|
+
this.image = { data, width, height, depth };
|
|
270
|
+
this.magFilter = NearestFilter;
|
|
271
|
+
this.minFilter = NearestFilter;
|
|
272
|
+
this.wrapR = ClampToEdgeWrapping;
|
|
273
|
+
this.generateMipmaps = false;
|
|
274
|
+
this.flipY = false;
|
|
275
|
+
this.unpackAlignment = 1;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
class DataArrayTexture extends Texture {
|
|
280
|
+
constructor(data = null, width = 1, height = 1, depth = 1) {
|
|
281
|
+
super(null);
|
|
282
|
+
this.isDataArrayTexture = true;
|
|
283
|
+
this.image = { data, width, height, depth };
|
|
284
|
+
this.magFilter = NearestFilter;
|
|
285
|
+
this.minFilter = NearestFilter;
|
|
286
|
+
this.wrapR = ClampToEdgeWrapping;
|
|
287
|
+
this.generateMipmaps = false;
|
|
288
|
+
this.flipY = false;
|
|
289
|
+
this.unpackAlignment = 1;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
export { CubeTexture, Data3DTexture, DataArrayTexture, Source, Texture };
|
package/package.json
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@renderlayer/textures",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "@renderlayer/textures",
|
|
5
5
|
"type": "module",
|
|
6
|
+
"module": "dist/textures.esm-bundler.js",
|
|
7
|
+
"exports": "./dist/textures.esm-bundler.js",
|
|
6
8
|
"files": [
|
|
7
9
|
"dist"
|
|
8
10
|
],
|