@woosh/meep-engine
Version:
Pure JavaScript game engine. Fully featured and production ready.
18 lines (16 loc) • 576 B
JavaScript
import { RedIntegerFormat, RGBAIntegerFormat, RGIntegerFormat } from "three";
import { GL_RGBIntegerFormat } from "./GL_RGBIntegerFormat.js";
export function channelCountToThreIntegerTextureType(channel_count) {
switch (channel_count) {
case 1:
return RedIntegerFormat;
case 2:
return RGIntegerFormat;
case 3:
return GL_RGBIntegerFormat;
case 4:
return RGBAIntegerFormat;
default:
throw new Error(`Unsupported channel count '${channel_count}'`);
}
}