luma.gl/docs/api-guide/textures.mdx
2022-02-06 13:21:32 -08:00

27 lines
2.3 KiB
Plaintext

import {DeviceTabs, Format as Ft, Filter as L, Render as R} from '@luma.gl/react-website';
# Textures
GPUs support a wide range of texture formats. In luma.gl, each format is identified with a string (the `TextureFormat` type).
Support for a specific format generally has three levels. luma provides `Device` functions to help
applications determine the capabilities of a texture format.
| Texture Format Capability | Check using |
| ---------------------------------------------------------------------------------------------- | ------------------------------------------ |
| Can textures with the format be **created and sampled** (using `nearest` filters)? | `Device.isTextureFormatSupported(format)` |
| Can textures with the format be sampled using **linear filtering**? | `Device.isTextureFormatFilterable(format)` |
| Can textures with the format be rendered into? I.e used as render targets / color attachments? | `Device.isTextureFormatRenderable(format)` |
| Can textures with the format be used for storage bindings? | N/A |
| Can textures with the format be blended? | Yes if sampler type 1float` is supported |
| Do textures with the format support multisampling? | N/A |
Remarks
- Mipmaps can only be auto created for formats that are both filterable and renderable.
- A renderable format is either a color renderable format, or a depth-or-stencil format
- All depth/stencil formats are renderable.
- Less than 4 components, sampler reads the missing red, green and blue components as 0.0, alpha is 1.0
- The capabilities reported by luma.gl represent the minimal specification of the underlying API. Occasionally a driver may provide additional capabilities, such as a WebGL2 device running on top of an OpenGL ES 3.2 driver. Use of non-standard capabilities is enabled but not portable.
- The WebGL 1 core does not provide sized formats. While sized formats offer more control, unsized formats do give the GPU freedom to select the most performant internal representation.