From e5853b01c4e3eece8c34185ea80261a9df9f7a9f Mon Sep 17 00:00:00 2001 From: Christoph Diehl <1614333+posidron@users.noreply.github.com> Date: Tue, 20 Feb 2018 02:04:37 +0100 Subject: [PATCH] Add texture formats for WebGL --- lib/make/webgl.js | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 lib/make/webgl.js diff --git a/lib/make/webgl.js b/lib/make/webgl.js new file mode 100644 index 0000000..46414f5 --- /dev/null +++ b/lib/make/webgl.js @@ -0,0 +1,37 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + make.webgl = { + internalFormat: { + 'RGB': {format: 'RGB', type: ['UNSIGNED_BYTE', 'UNSIGNED_SHORT_5_6_5']}, + 'RGBA': {format: 'RGBA', type: ['UNSIGNED_BYTE', 'UNSIGNED_SHORT_4_4_4_4', 'UNSIGNED_SHORT_5_5_5_1']}, + 'LUMINANCE_ALPHA': {format: 'LUMINANCE_ALPHA', type: ['UNSIGNED_BYTE']}, + 'LUMINANCE': {format: 'LUMINANCE', type: ['UNSIGNED_BYTE']}, + 'ALPHA': {format: 'ALPHA', type: ['UNSIGNED_BYTE']}, + 'R8': {format: 'RED', type: ['UNSIGNED_BYTE']}, + 'R16F': {format: 'RED', type: ['HALF_FLOAT', 'FLOAT']}, + 'R32F': {format: 'RED', type: ['FLOAT']}, + 'R8UI': {format: 'RED_INTEGER', type: ['UNSIGNED_BYTE']}, + 'RG8': {format: 'RG', type: ['UNSIGNED_BYTE']}, + 'RG16F': {format: 'RG', type: ['HALF_FLOAT', 'FLOAT']}, + 'RG32F': {format: 'RG', type: ['FLOAT']}, + 'RG8UI': {format: 'RG_INTEGER', type: ['UNSIGNED_BYTE']}, + 'RGB8': {format: 'RGB', type: ['UNSIGNED_BYTE']}, + 'SRGB8': {format: 'RGB', type: ['UNSIGNED_BYTE']}, + 'RGB565': {format: 'RGB', type: ['RGB', 'UNSIGNED_BYTE', 'UNSIGNED_SHORT_5_6_5']}, + 'R11F_G11F_B10F': {format: 'RGB', type: ['UNSIGNED_INT_10F_11F_11F_REV', 'HALF_FLOAT', 'FLOAT']}, + 'RGB9_E5': {format: 'RGB', type: ['HALF_FLOAT', 'FLOAT']}, + 'RGB16F': {format: 'RGB', type: ['HALF_FLOAT', 'FLOAT']}, + 'RGB32F': {format: 'RGB', type: ['FLOAT']}, + 'RGB8UI': {format: 'RGB_INTEGER', type: ['UNSIGNED_BYTE']}, + 'RGBA8': {format: 'RGBA', type: ['UNSIGNED_BYTE']}, + 'SRGB8_ALPHA8': {format: 'RGBA', type: ['UNSIGNED_BYTE']}, + 'RGB5_A1': {format: 'RGBA', type: ['UNSIGNED_BYTE', 'UNSIGNED_SHORT_5_5_5_1']}, + 'RGB10_A2': {format: 'RGBA', type: ['UNSIGNED_INT_2_10_10_10_REV']}, + 'RGBA4': {format: 'RGBA', type: ['UNSIGNED_BYTE', 'UNSIGNED_SHORT_4_4_4_4']}, + 'RGBA16F': {format: 'RGBA', type: ['HALF_FLOAT', 'FLOAT']}, + 'RGBA32F': {format: 'RGBA', type: ['FLOAT']}, + 'RGBA8UI': {format: 'RGBA_INTEGER', type: ['UNSIGNED_BYTE']} + } + }