UNPKG

@woosh/meep-engine

Version:

Pure JavaScript game engine. Fully featured and production ready.

23 lines (21 loc) 546 B
import { RedFormat, RGBAFormat, RGFormat } from "three"; import { GL_RGBFormat } from "./GL_RGBFormat.js"; /** * * @param {number} count * @return {number} */ export function channelCountToThreeTextureFormat(count) { switch (count) { case 1: return RedFormat; case 2: return RGFormat; case 3: return GL_RGBFormat; case 4: return RGBAFormat; default: throw new Error(`Unsupported channel count '${count}'`); } }