Skip to content

Commit

Permalink
feat: support manual miomap loading in cubetexture
Browse files Browse the repository at this point in the history
  • Loading branch information
bhouston committed Jul 16, 2020
1 parent 0e7bb2d commit 212d8d5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/textures/CubeTexture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ export class CubeMapTexture extends VirtualTexture implements IPoolUser {
anisotropicLevels = 1,
) {
super(level, magFilter, minFilter, pixelFormat, dataType, generateMipmaps, anisotropicLevels);
if (this.images.length !== 6) {
throw new Error("images must be of length 6");
if (this.images.length % 6 !== 0 || this.images.length === 0) {
throw new Error(`images.length (${this.images.length}) must be a positive multiple of 6`);
}
this.size = new Vector2(images[0].width, images[0].height);
}
Expand Down

0 comments on commit 212d8d5

Please sign in to comment.