createPattern(image, repeat) {
		this.setCompositor("quad");

		if (
			renderer.WebGLVersion === 1 &&
			(!isPowerOfTwo(image.width) || !isPowerOfTwo(image.height))
		) {
			const src = typeof image.src !== "undefined" ? image.src : image;
			throw new Error(
				"[WebGL Renderer] " +
					src +
					" is not a POT texture " +
					"(" +
					image.width +
					"x" +
					image.height +
					")",
			);
		}

		const texture = new TextureAtlas(
			createAtlas(image.width, image.height, "pattern", repeat),
			image,
		);

		// FIXME: Remove old cache entry and texture when changing the repeat mode
		this.currentCompositor.uploadTexture(texture);

		return texture;
	}
Create a pattern with the specified repetition
@param {HTMLImageElement|SVGImageElement|HTMLVideoElement|HTMLCanvasElement|ImageBitmap|OffscreenCanvas|VideoFrame} image - Source image to be used as the pattern's image
@param {string} repeat - Define how the pattern should be repeated
@returns {TextureAtlas} the patterned texture created
@see ImageLayer#repeat
@example
let tileable   = renderer.createPattern(image, "repeat");
let horizontal = renderer.createPattern(image, "repeat-x");
let vertical   = renderer.createPattern(image, "repeat-y");
let basic      = renderer.createPattern(image, "no-repeat");