-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: website and doc cleanup pass (#1944)
- Loading branch information
Showing
58 changed files
with
14,613 additions
and
10,787 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,41 @@ | ||
# API Overview | ||
|
||
The luma.gl API is designed to expose the capabilities of the GPU and shader programming to web applications. | ||
The luma.gl API enables the creation of portable GPU applications that can run on top of either WebGPU, or WebGL 2. | ||
luma.gl is divided into different sub-APIs: the core GPU API, the shader API and the engine API. | ||
|
||
Core responsibilities for any GPU library are to enable applications to perform: | ||
Most applications work with the engine API (`Model`, `AnimationLoop` and related classes), leveraging the core GPU API as necessary to obtain a `Device` and use it to create GPU resources such as `Buffer` and `Texture`. | ||
The shader API is used to assemble shaders and define shader modules. | ||
|
||
- [GPU device access](/docs/api-guide/device) - Open a GPU device and query its capabilities | ||
- [GPU memory management](/docs/api-guide/memory) - Create, upload memory to and read from [Buffers](/docs/api-guide/buffers), [Textures](/docs/api-guide/textures) etc. | ||
- [GPU resource management](/docs/api-guide/resources) - Create `Shader`, `Renderpipeline`, `RenderPass` etc objects. | ||
- [GPU binding management](/docs/api-guide/bindings) - Make attribute buffers, uniforms, textures, samplers available to GPU shaders. | ||
- [Shader execution / rendering](/docs/api-guide/rendering) - Drawing into textures, running compute shaders. | ||
- [GPU parameter management](/docs/api-guide/parameters) - Configuring blending, clipping, depth tests etc. | ||
Most luma.gl applications will: | ||
|
||
## Portability | ||
1. Use the core API to create a `Device` class to access the GPU (either using WebGPU or WebGL). | ||
2. Upload data to the GPU via methods on the `Device`, using `Buffer` and `Texture` objects. | ||
3. Use tne engine API to create one or more `Model` instances from GLSL or WGSL shader code. | ||
4. Bind attribute buffers and bindings (textures, uniform buffers or uniforms). | ||
5. Start an engine API `AnimationLoop` loop, and draw each frame into a `RenderPass`. | ||
|
||
luma.gl enables the creation of portable applications that can run on top of either WebGPU, WebGL 2, or WebGL. | ||
## Core API | ||
|
||
The `@luma.gl/core` module provides an abstract API for writing application code | ||
that works with both WebGPU and WebGL. | ||
The core luma.gl API is designed to expose the capabilities of the GPU and shader programming to web applications. | ||
It is a portable API, in the sense that the `@luma.gl/core` module provides an abstract API for writing application code | ||
that works with both WebGPU and/or WebGL depending on which adapter modules are installed | ||
)`@luma.gl/webgl` and/or `@luma.gl/webgpu`). | ||
|
||
The `@luma.gl/core` module cannot be used on its own: it relies on being backed up by another module | ||
that implements the API. luma.gl provides adapters (implementations of the abstract API) | ||
through the `@luma.gl/webgl` and `@luma.gl/webgpu` modules. | ||
Core responsibilities for any GPU library are to enable applications to perform: | ||
|
||
## Usage | ||
- [GPU initialization](/docs/api-guide/gpu/gpu-initialization) - Open a GPU device and query its capabilities | ||
- [GPU memory management](/docs/api-guide/gpu/gpu-memory) - Create, upload memory to and read from [Buffers](/docs/api-guide/gpu/gpu-buffers), [Textures](/docs/api-guide/gpu/gpu-textures) etc. | ||
- [GPU resource management](/docs/api-guide/gpu/gpu-resources) - Create `Shader`, `Renderpipeline`, `RenderPass` etc objects. | ||
- [GPU binding management](/docs/api-guide/gpu/gpu-bindings) - Make attribute buffers, uniforms, textures, samplers available to GPU shaders. | ||
- [Shader execution / rendering](/docs/api-guide/gpu/gpu-rendering) - Drawing into textures, running compute shaders. | ||
- [GPU parameter management](/docs/api-guide/gpu/gpu-parameters) - Configuring blending, clipping, depth tests etc. | ||
|
||
Most luma.gl applications will: | ||
## Shader API | ||
|
||
1. Create a `Device` class to access the GPU (either using WebGPU or WebGL). | ||
2. Use that device to upload data to the GPU in the form of `Buffer` and `Texture` objects. | ||
3. Create one or more `RenderingPipeline` objects from GLSL or WGSL shader code. | ||
4. Bind attribute buffers and bindings (textures, uniform buffers or uniforms). | ||
5. Start a render loop, and use a `RenderPass` to draw. | ||
The Shader API lets the application use a library of existing shader modules to create new customer shaders. | ||
It is also possible for developers to create new reusable shader modules. | ||
|
||
## Engine API | ||
|
||
The engine API provides higher level classes like `Model`, `AnimationLoop` and `Transform`s. | ||
glTF support is available through `@luma.gl/gltxf`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.