TextureFormat

View source

Selects a WebGL texture format or sized internal format.

Use the channel formats with texture upload calls and the sized formats as internal storage formats. Floating-point, integer, and sized formats may require a WebGL 2 context or the corresponding extension.

Examples

import { TextureFormat } from '@wimaengine/render-webgl'

gl.texImage2D(
  gl.TEXTURE_2D,
  0,
  TextureFormat.RGBA8,
  width,
  height,
  0,
  TextureFormat.RGBA,
  gl.UNSIGNED_BYTE,
  pixels
)

Variants


Depth

View source

Depth-component texture format (0x1902, DEPTH_COMPONENT).

Red

View source

Single red-channel texture format (0x1903, RED).

Alpha

View source

Alpha-channel texture format (0x1906, ALPHA).

RGB

View source

Three-channel RGB texture format (0x1907, RGB).

RGBA

View source

Four-channel RGBA texture format (0x1908, RGBA).

Luminance

View source

Luminance texture format (0x1909, LUMINANCE).

LuminanceAlpha

View source

Luminance-plus-alpha texture format (0x190A, LUMINANCE_ALPHA).

RGB8

View source

Eight-bit normalized RGB internal format (0x8051, RGB8).

RGBA8

View source

Eight-bit normalized RGBA internal format (0x8058, RGBA8).

RGBA16F

View source

Sixteen-bit floating-point RGBA internal format (0x881A, RGBA16F).

RGB16F

View source

Sixteen-bit floating-point RGB internal format (0x881B, RGB16F).

RGBA32F

View source

Thirty-two-bit floating-point RGBA internal format (0x8814, RGBA32F).

RGB32F

View source

Thirty-two-bit floating-point RGB internal format (0x8815, RGB32F).

RGBA32I

View source

Thirty-two-bit signed-integer RGBA internal format (0x8D82, RGBA32I).

RGB32I

View source

Thirty-two-bit signed-integer RGB internal format (0x8D83, RGB32I).

RGBA16I

View source

Sixteen-bit signed-integer RGBA internal format (0x8D88, RGBA16I).

RGB16I

View source

Sixteen-bit signed-integer RGB internal format (0x8D89, RGB16I).

RGBA8I

View source

Eight-bit signed-integer RGBA internal format (0x8D8E, RGBA8I).

RGB8I

View source

Eight-bit signed-integer RGB internal format (0x8D8F, RGB8I).