+ if (pixel_format == FORMAT_R) {
+ internal_format = GL_R32F;
+ } else if (pixel_format == FORMAT_RG) {
+ internal_format = GL_RG32F;
+ } else if (pixel_format == FORMAT_RGB) {
+ internal_format = GL_RGB32F;
+ } else {
+ internal_format = GL_RGBA32F;
+ }
+ } else if (type == GL_HALF_FLOAT) {
+ if (pixel_format == FORMAT_R) {
+ internal_format = GL_R16F;
+ } else if (pixel_format == FORMAT_RG) {
+ internal_format = GL_RG16F;
+ } else if (pixel_format == FORMAT_RGB) {
+ internal_format = GL_RGB16F;
+ } else {
+ internal_format = GL_RGBA16F;
+ }
+ } else if (type == GL_UNSIGNED_SHORT) {
+ if (pixel_format == FORMAT_R) {
+ internal_format = GL_R16;
+ } else if (pixel_format == FORMAT_RG) {
+ internal_format = GL_RG16;
+ } else if (pixel_format == FORMAT_RGB) {
+ internal_format = GL_RGB16;
+ } else {
+ internal_format = GL_RGBA16;
+ }