@renderlayer/textures 0.0.5 → 0.0.7

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.
@@ -2,9 +2,11 @@ import { ImageUtils, ClampToEdgeWrapping, LinearFilter, LinearMipmapLinearFilter
2
2
  import { EventDispatcher } from '@renderlayer/core';
3
3
  import { generateUUID, Vector2, Matrix3 } from '@renderlayer/math';
4
4
 
5
+ let sourceid = 0;
5
6
  class Source {
6
7
  constructor(data = null) {
7
8
  this.isSource = true;
9
+ Object.defineProperty(this, "id", { value: sourceid++ });
8
10
  this.uuid = generateUUID();
9
11
  this.data = data;
10
12
  this.version = 0;
@@ -290,4 +292,15 @@ class DataArrayTexture extends Texture {
290
292
  }
291
293
  }
292
294
 
293
- export { CubeTexture, Data3DTexture, DataArrayTexture, Source, Texture };
295
+ class DataTexture extends Texture {
296
+ constructor(data = null, width = 1, height = 1, format, type, mapping, wrapS, wrapT, magFilter = NearestFilter, minFilter = NearestFilter, anisotropy, colorSpace) {
297
+ super(null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, colorSpace);
298
+ this.isDataTexture = true;
299
+ this.image = { data, width, height };
300
+ this.generateMipmaps = false;
301
+ this.flipY = false;
302
+ this.unpackAlignment = 1;
303
+ }
304
+ }
305
+
306
+ export { CubeTexture, Data3DTexture, DataArrayTexture, DataTexture, Source, Texture };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@renderlayer/textures",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "description": "@renderlayer/textures",
5
5
  "type": "module",
6
6
  "module": "dist/textures.esm-bundler.js",