GPUCurtains constructor
parameters used to create this GPUCurtains
The type of this GPUCurtains
Options used to create this GPUCurtains
HTMLElement that will hold the WebGPU HTMLCanvasElement
GPUDeviceManager used to handle the GPUAdapter and GPUDevice
Tiny scroll event listener wrapper
function assigned to the onScroll callback
function assigned to the onError callback
function assigned to the onContextLost callback
function assigned to the onContextLost callback
Get all the created PingPongPlane
Get all the created ShaderPass
Get all the created meshes
Get all the created DOM Meshes (including planes)
Get all created DOMObject3D which position should be updated on scroll.
Get all the created compute passes
Get our scrollManager delta values
Get our scrollManager scroll values
Set the container.
HTMLElement or string representing an HTMLElement selector to use
Set the default renderer
Patch the options with default values before creating a Renderer
parameters to patch
Create a new GPURenderer instance
parameters to use
Create a new GPUCameraRenderer instance
parameters to use
Create a new GPUCurtainsRenderer instance
parameters to use
Set our GPUDeviceManager
Set the GPUDeviceManager adapter and device if possible, then set all created Renderer contexts.
GPUAdapter and/or GPUDevice to use if set.
Set the scrollManager
Update all DOMMesh scroll positions
last scroll delta values
Update our scrollManager scroll values. Called each time the scroll has changed if .watchScroll | watchScroll option is set to true. Could be called externally as well.
new scroll values
Called each frame before rendering
callback to run at each render
Called each frame after rendering
callback to run at each render
Called each time the scrollManager scroll values changed
callback to run each time the scrollManager scroll values changed
Called if there's been an error while trying to create the device
callback to run if there's been an error while trying to create the device
Called whenever the device is lost
callback to run whenever the device is lost
Called whenever the device has been intentionally destroyed.
callback to run whenever the device has been destroyed.
Render our GPUDeviceManager
Destroy our GPUCurtains and GPUDeviceManager
Used as a global class to create a GPUCurtainsRenderer, create all objects that need a reference to a renderer, listen to various events such as scroll and resize and render.
Example