Date: Jul 15, 2021
@luma.gl/shadertools
gl_FragColor
in fragment shader when transpliting from ES 1.00 to 3.00magnify
effect@luma.gl/experimental
GLTFMaterialParser
Date: Feb 1, 2021
HTMLVideoElement
.createGLContext
: adds optional callbacks onContextLost
, onContextRestored
.Date: Oct 12, 2020
Date: March 2, 2020
The experimental GPUPointInPolygon
class performs GPU-accerated point-in-polygon tests, which showed a massive improvement in performance over a CPU implementation of the algorithm:
Points | CPU | GPU | Improvement |
---|---|---|---|
10k | 411 | 6900 | 16x |
1M | 4 | 4200 | 1000x |
10M | 0.378 | 3120 | 8000x |
Numbers shown are iterations/second.
Handling of platforms that do not support vertex array objects has been significantly improved, providing a more stable experience in IE 11 and headless-gl.
assembleShaders
now optionally attempts to transpile shaders from GLSL 3.0 to 1.0, potentially simplifying shader management in systems where both WebGL 1 and 2 are used. Refer to the documentation for more information.
Date: December 16, 2019
The key focus of luma.gl v8.0 was optimizing performance. Compared to v7.3, the latest release shows a 2x improvement in render time on the luma.gl stress test (1 million textured cubes), as detailed below:
7.3 | 8.0 | Improvement | |
---|---|---|---|
CPU Time | 30ms | 16ms | 14ms (47%) |
GPU Time | 26ms | 21ms | 5ms (19%) |
luma.gl's optimizations also contributed significantly to deck.gl's performance gains in v8.0, leading to a 3x improvement over its prior release on the deck.gl stress test (rendering 100,000 ScatterplotLayer
instances):
7.3 | 8.0 | Improvement | |
---|---|---|---|
CPU Time | 76ms | 26ms | 50ms (66%) |
GPU Time | 17ms | 10ms | 7ms (41%) |
Stress tests were run on a Macbook Pro 2018, OSX, 2.6 GHz Intel Core i7, Radeon Pro 560X 4 GB.
luma.gl v8.0 also brings with it a major simplification of the API and streamlining of architecture. The number of modules as been reduced from 14 to 9, each with a clearly defined purpose and relationship to other modules:
Date: September 19, 2019
luma.gl introduces the ProgramManager class to manage caching and re-use of Program
objects, providing powerful load and runtime optimizations:
The Model
class has been updated to take advantage of these new capabilities, automatically caching and re-using Program
s where possible.
The table below shows the effect of program sharing in deck.gl. The test renders 1000 ScatterplotLayers, each of which draws 100 intanced geometries, for a total of 1000 draw calls and 100,000 instances. Timings are milliseconds spent on the CPU and GPU to render a single frame on the following two machines:
No Program Sharing | Program Sharing | Improvement | |
---|---|---|---|
Macbook Pro CPU | 113ms | 93ms | 17% |
Macbook Pro GPU | 43ms | 34ms | 20% |
Razer Blade CPU | 145ms | 125ms | 13% |
Razer Blade GPU | 137ms | 115ms | 16% |
luma.gl now provides experimental support for specifying the pixel ratio mapping between canvas size and the GL drawing buffer. luma.gl has always provided support for matching the native device pixel ratio on high-resolution screens, but custom ratios allow applications to, for example, use SSAA for improved fidelity or reduced drawing resolution to improve performance.
Date: July 9, 2019
luma.gl now supports FXAA (Fast Approximate Antialiasing) as a post processing effect. This allows for antialiasing on offscreen framebuffers.
The Texture
class now supports ImageBitmap
input data.
Date: June 4, 2019
luma.gl now supports a much more robust system for injecting code into shaders. In addition to the pre-defined shader hooks such as vs:#main-start
,
the shader injection system now supports:
The combination of these features allows the behavior of the same shader code to be modified depending on included shader modules or other requirements of the application. See assembleShaders documentation for more details.
More robust animations are now supported via the Timeline
and KeyFrames
classes.
The Timeline
class supports easily managing a timeline with multiple channels elapsing at different rates, as well as orchestrating playing, pausing, and rewinding behavior between them. A timeline can be attached to an AnimationLoop
and then queried for time values, which can be used in animations. See Timeline documentation for more details.
The KeyFrames
class allows arbitrary data to be associated with time points. The time value of the key frames can be set and the current key frames and interpolation factor can be queried and used in calculating animated values. See KeyFrames documentation for more details.
Date: April 19, 2019
![]() glTF Support |
![]() PBR (Physically Based Rendering) |
luma.gl can now load 3D models and scenegraphs in the popular glTFâ„¢ asset format (with the help of the loaders.gl GLTFLoader. All variants of glTF 2.0 are supported, including binary .glb
files as well as JSON .gltf
files with binary assets in base64 encoding or in separate files. The Draco Mesh compression extension is also supported.
Geometry
class and scene graph support has been overhauled to conform to glTF conventions, simplifying loading and manipulation of glTF formatted data.loaders.gl is a major new companion framework to luma.gl that provides a suite of 3D file format loaders (with an emphasizis on point cloud formats), including:
loaders.gl output can now be passed directly into luma.gl classes like Geometry
and Model
making it straightforward to use luma.gl with a wide variety of file formats.
Image data for Texture
classes can now be supplied using URLs or Promise
s, making it unnecessary for applications to handle image loading themselves.
new Texture2D(gl, 'path/to/my/image.png'); // Texture2D will load the image and becomes 'renderable' once it loads
// or
new Texture2D(gl, loadImage('path/to/my/image.png')); // loadImage returns a promise
A standardized set of light classes are now supported by multiple material models (Phong, Goraud and PBR) enabling various models to be mixed and properly lit in the same scene.
@luma.gl/gpgpu
New - A new experimental submodule with GPGPU Algorithms and Utilities has been added, containing a growing collection of GPU accelerated algorithms and utility methods.Extensive metrics about frame CPU and GPU times, resource counts, and GPU memory usage are being collected. The data is exposed as a probe.gl Stats
object. The new probe.gl StatsWidget can be used to present data in applications.
To improve support for interleaved attributes and glTF model loading, accessor objecs and the Accessor
class now support a buffer
field. In addition, attribute setting functions now accept accessor objects with the buffer
field set. This allows multiple accessor objects referencing the same buffer:
const buffer = // "interleaved" vertex attributes: 3 floats for position followed by 4 bytes for RGBA
model.setAttributes({
positions: {buffer, stride: 16, offset: 0, ...}}),
colors: {buffer, stride: 16, offset: 12, ...}})
}
A set of global methods that perform copying data to and from Framebuffer
objects. All functions that read from or write to a Framebuffer
object now also accept a Texture
object (no need to create and configure a Framebuffer
just to do a simple operation on a Texture
).
Just replace your AnimationLoop
with VRAnimationLoop
from @luma.gl/addons
. Works with Firefox Reality.
Date: January 29, 2018
Physically-Based Rendering is now supported and the new PBRMaterial
class can be used to set up parameters. Material can be selected per model.
Several member function of Framebuffer
and Texture
classes are now replaced by global methods that peform copying data to and from Framebuffer
objects. All methods that read from or write to a Framebuffer
object, can now also accept a Texture
object.
Date: November 16, 2018
Uniforms are now cached at Program
object, which improves performance by eliminating uniform setter calls when uniform values are not changed.
@luma.gl/debug
- an experimental module for debugging WebGL shaders on CPU@luma.gl/glfx
- shader modules for image processingA new experimental class AnimationLoopProxy
supports running an AnimationLoop
on a worker thread using the OffscreenCanvas
API made official in Chrome 70. For more detatils, see API documentation and example app.
Date: September 12, 2018
![]() glfx port using ShaderModulePass |
![]() Transform: edge detection |
Shader modules that expose "standard" filtering and sampling functions can be given extra metadata (the passes
field) enabling easy construction of a ShaderModulePass
. Look for ShaderPass
badges in the documentation of shader modules.
Transform
class was introduced in 6.0 provides easy API to perform WebGL's complicated TransformFeedback
. We are now extending this class to provide same easy API to read and write into textures. Running image filters, performing offline rendering and custom texture mip-map generation are some of the use-cases. Moreover, texture and buffer access can be combined, i.e. using single Transform
instance buffers can be captured using TransformFeedback
and data can be propagated beyond vertex shader to generate a texture.
Date: Target August 31, 2018
![]() Ambient Occlusion Render Pass |
![]() Edge Detection Render Pass |
luma.gl 6.1 is a minor release that introduces a number of new experimental capabilities that are expected to be built out and become official over the next few releases.
luma.gl now provides a composable multipass rendering framework, based on a MultiPassRenderer
class that accepts a list of render passes.
A number of classic WebGL/OpenGL post processing effects have been ported to luma.gl and packaged as composable render passes. For maxiumum flexibility, many of the underlying shaders have also been exposed as shader modules, allowing filtering features to be used either directly in existing shaders or applied as a post-processing filter.
A selection of open source 3D loaders have been ported to a new submodule loaders.gl
. Initial focus is on point cloud loaders (PLY, LAZ, PCD), although a geospatial loader (KML) is also included. In addition it contains both read and write support for GLB (the glTF binary container format).
The Transform
class now accepts shader module parameters (such as modules
, dependencies
and inject
, see assembleShaders), enabling the use of shader modules in transform feedback operations.
luma.gl is now using the ocular document generator to build its website, which among other things enables search.
Date: July 18, 2018
![]() WebGL Improvements |
A major release that as always focuses on WebGL performance and code size optimizations, better support for shader/GLSL programming, improved documentation and API cleanup.
VertexArray
objects are now used for all attribute management in luma.gl, resulting in improved performance and a simpler, more consistent API. The Program
and Model
class APIs have been updated to use VertexArray
.
The Buffer
class no longer holds on to the complete JavaScript typed arrays used during initialization. This can lead to significant memory savings in apps that use multiple large GPU buffers initialized from typed arrays. Also for convenience a new method getElementCount
is added that returns number elements based on its size and type.
A new method Model.transform
makes it easier to run basic transform feedback operations, when the full power of the new Transform
class (see below) is not needed.
Transform
is now an officially supported luma.gl class. This new class provides an easy-to-use interface to Transform Feedback. This class hides complexity by internally creating and managing the supporing WebGL objects that are necessary to perform Transform Feedback operations.
The shader assembler now transforms shader code to the GLSL version specified by the top-level shader. GLSL 3.00 ES shader code is transparently transformed into GLSL 1.00 ES compatible code when needed, and vice versa. This allows application to write shader code in the modern GLSL version available (3.00 ES) and still run it under WebGL 1 - Shader "transpilation" will automatically convert shader module source code syntax to the target version (assuming that no WebGL 2 only features were used).
A new shader injection system allows applications to inject additional code into existing shaders. In many cases, this can avoid the need to copy (or "fork") large and complicated existing shaders just to add a few lines of code.
Shader injection can be used to "inject" new shader modules into an existing shader. Adding a shader module to the modules list automatically "prepends" the shader module functions to the beginning of your main shader code, but using a shader module still typically requires adding one or two lines of code each to the main functions in the vertex and fragment shaders. In many cases, the new shader injection feature allows this be done without copying the original shaders.
All shader modules are now written in GLSL 3.00 syntax, and leverage the new GLSL transpilation feature to be compatible with both GLSL 3.00 ES and GLSL 1.00 ES main shaders. Care is taken to avoid using GLSL 3.00 specific features whenever possible, and exceptions will be clearly documented.
luma.gl now has a more extensive Developer's Guide covering more areas of the API, including a new developer guide for shader programming, with sections about writing shaders and the shader module system. Content includes:
Being a major release, in v6.0 we took the opportunity to clean up the luma.gl API.
To keep reducing application bundle size, a number of methods have been removed from the luma.gl API. Methods that were deprecated in previous releases have now been removed, and in additional a number of rarely used methods have also been dropped (in most cases, the dropped functionality is still accessible using raw WebGL calls).
In a few cases, methods have been renamed after API Audits, usually to improve API consistency. The details are listed in the Upgrade Guide. In most cases, running your pre-v6 application on v6 should generate messages in the console when old method calls are encountered, and you should be able to quickly address any changes one-by-one by referring to the Upgrade Guide.
Date: June 1, 2018
A minor release with bug fixes and internal improvements.
Date: Apr 24, 2018
The new experimental Transform
class provides an easy-to-use interface to perform Transform Feedback operations.
Pixel Readback to GPU Buffers (WebGL 2) - A new method Framebuffer.readPixelsToBuffer
is added to asynchronously read pixel data into a Buffer
object. This allows applications to reduce the CPU-GPU sync time by postponing transfer of data or to completely avoid GPU-CPU sync by using the pixel data in the GPU Buffer
object directly as data source for another GPU draw or transform feedback operation.
The impact of importing luma.gl on production application bundle sizes has been reduced, in particular when using webpack 4 with appropriate configuration. A new article about bundling and tree shaking has been added to the Developer Guide, providing in-depth information and guidance on what numbers to expect.
Running of luma.gl under Node.js is now easier than ever. luma.gl v5.2 automatically loads headless-gl if installed on the system, avoiding the need for the app to import special files or add other conditional logic. See Using with Node and the Upgrade Guide.
To further reduce production application bundle sizes, luma.gl no longer support WebGL debug contexts by default, as this requires including the Khronos WebGLDeveloperTools into the bundle. WebGL debug contexts are still available, but needs to be explicitly enabled. To understand how to use WebGL debug contexts in v5.2, please refer to the article on Debugging and the Upgrade Guide.
All examples have been updated to use webpack 4
A smaller release with improvements to TransformFeedback
support.
Date: Feb 15, 2018
Two improvements Performing Transform Feedback operations has gotten easier, mainly in the following two ways:
TransformFeedback
instances can now be supplied directly to Model.draw
and feedback will begin and end during that draw call. Thus it is no longer necessary to work directly with the Program
class to use transform feedback.
Program
now build a varyingMap
on creation depending on varyings
array and drawMode
. This varyingMap
can be passed to TransformFeedback.bindBuffers()
enabling buffers to be indexed by the name of the "varying" instead of using an index.
For more details check TransformFeedback
and Model
documentation.
Date: Dec 22, 2017
A smaller release with several new examples and some under the hood changes to improve performance.
Additional examples have been ported to the luma.gl v5 API.
Model.draw
now supports a moduleSettings
parameters to update shader module settings.Model.render
now supports attributes
and samplers
arguments to be used for drawing.In v4 we added WebGL state management which automatically tracks all WebGL state settings. In this release we extended this feature to support framebuffer bindings. When restoring context settings, the previous framebuffer binding will also be restored.
Improvements in particular to the Buffer
, TransformFeedback
and Framebuffer
classes based on use in applications.
fp64
- fp64 module works under more platforms/GPUs/driverspicking
shader module is moved from deck.gl to luma.gl and has been enhanced to also support object highlighting.Release date: July 27th, 2017
![]() WebGL 2 |
A major release that brings full WebGL 2 support to luma.gl, as well as adding support for GL state management and a new shader module system.
luma.gl now exposes the complete WebGL 2 APIs:
Query
, Texture3D
, and TransformFeedback
), together with a new UniformBufferLayout
helper class to make uniform buffers easy to use.luma.gl provides a single unified WebGL 2-style API across WebGL 2, WebGL 1 and WebGL extensions, and provides a simple mechanisms for querying what capabilities are available. This simplifies building apps that run on both WebGL 1 and WebGL 2, seamlessly allowing applications to leverage WebGL extensions when available.
In this version, a new WebGL state management is implemented to help address one of the weak spots of the stateful WebGL API:
The new, optional, shadertools module with the assembleShaders
function system allows shader code to be broken into composable pieces.
A new ShaderCache
class is provided to ensure that identical shaders are only compiled once and no unnecessary examination and/or checks are done on already compiled WebGL shader and program objects, which significantly accelerates app start up under some occasions.
Complete rewrite of luma.gl's documentation. New structure and contents for every classes provided, featured on a new website with links to other frameworks in Uber's visualization framework suite, such as deck.gl and react-map-gl.
Significant reduction in the size of distributed luma.gl library
Release Date: March 15, 2017
A smaller release mainly intended to align the luma.gl code base with the big deck.gl v4 release.
WEBGL_debug_shaders
extension when available to log translated shader source code.EXT_disjoint_timer_query
and EXT_disjoint_timer_query_webgl2
to provide timings.AnimationFrame
classwidth
, height
, aspect
, tick
, time
etc.Uint8ClampedArrays
by defaultgl-matrix
based math librarygl-matrix
for computations.shader-modules
, shader-tools
, shaders
shader module system added to /experimental
probe
moved to /experimental
FBO
class deprecated (use Framebuffer
directly).Camera
class deprecated, use math library directly.Scene
class deprecated, for effects use - TBDautobind-decorator
dependencyhusky
to pre-commit
webgl
folder now contains both webgl1 and webgl2 classespackages
. This allows luma.gl to drop a number of big dependencies. The node IO code may be published as a separate module later.Release Date: July 05, 2016 (evolved through a number of minor releases)
Theme: A bigger official release, a major API refactoring that introduced the WebGL classes that are now a characteristic aspect of the luma.gl API.
requestAnimationFrame
replacement.gl
(headless-gl) dependency, to simplify build and setup for applications that don't use headless-gl.import 'luma.gl/headless'
and npm install gl
to get headless integration.luma.gl/headless
to get headless integration. When using the basic luma.gl
import, the app no longer needs to have gl
as a dependency. This should simplify build and setup for applications that don't use headless-gl.requestAnimationFrame
replacement.Release Date: 2016
Theme: A smaller, mostly internal version that was the starting point for luma.gl development.