function getPixelFormat(channelCount, webgl2) {
  if (channelCount === 1) {
    return webgl2 ? PixelFormat.RED : PixelFormat.LUMINANCE;
  } else if (channelCount === 2) {
    return webgl2 ? PixelFormat.RG : PixelFormat.LUMINANCE_ALPHA;
  } else if (channelCount === 3) {
    return PixelFormat.RGB;
  } else if (channelCount === 4) {
    return PixelFormat.RGBA;
  }
}
Get the pixel format to use for a megatexture.

@param {number} channelCount The number of channels in the metadata. Must be 1 to 4.
@param {boolean} webgl2 true if the context is using webgl2
@returns {PixelFormat} The pixel format to use for a megatexture.

@private