DOMTexture constructor
Renderer object or GPUCurtains class object used to create this DOMTexture
parameters used to create this DOMTexture
Transformation object of the Object3D
Matrices object of the Object3D
Children Object3D in the scene graph, used to compute their own world matrix
Whether at least one of this Object3D matrix needs an update.
The type of the DOMTexture
Readonly
uuidThe universal unique id of this DOMTexture
Renderer used by this DOMTexture
The GPUTexture used if any
The GPUExternalTexture used if any
The DOMTexture source to use
Options used to create this DOMTexture
A buffer binding that will hold the texture model matrix
The bindings used by this DOMTexture, i.e. its textureMatrix and its GPU texture binding
Private
_parentDOMTexture parentMesh if any
Private
_sourceWhether the source has been loaded
Private
_sourceWhether the source has been uploaded to the GPU, handled by the GPUDeviceManager texturesQueue array
Whether the texture should be uploaded to the GPU
HTMLVideoElement.requestVideoFrameCallback | requestVideoFrameCallback returned id if used
Private
#parentPrivate vector used for {@link#modelMatrix} calculations, based on parentMesh size
Private
#sourcePrivate vector used for modelMatrix calculations, based on source size
Private
#coverPrivate vector used for modelMatrix calculations, based on #parentRatio and #sourceRatio
Private
#rotationPrivate rotation matrix based on texture quaternion
Get our quaternion
Set our quaternion
new quaternion
Get our model matrix
Set our model matrix
new model matrix
Get our world matrix
Set our world matrix
new world matrix
Get our GPU texture binding
Get our texture parentMesh
Set our texture parentMesh
texture parentMesh to set (i.e. any kind of Mesh
Get whether the source is a video
Apply our rotation and tell our model matrix to update
Tell our model matrix to update
Tell our model matrix to update
Tell our model matrix to update
Set our model matrix and world matrix
Set our model matrix shouldUpdate flag to true (tell it to update)
Set our world matrix shouldUpdate flag to true (tell it to update)
Update our model matrix
function assigned to the onSourceLoaded callback
function assigned to the onSourceUploaded callback
Set our bindings
Set our texture transforms object
Update the modelMatrix
If our modelMatrix has been updated, tell the texture matrix binding to update as well
Resize our DOMTexture
Tell the Renderer to upload or texture
Import a GPUExternalTexture from the Renderer, update the textureBinding and its bind group
Copy a DOMTexture
DOMTexture to copy
Set the GPU texture
Load an HTMLImageElement from a URL and create an ImageBitmap to use as a source
URL of the image to load
Set our shouldUpdate flag to true at each new video frame
Callback to run when a HTMLVideoElement has loaded (when it has enough data to play). Set the HTMLVideoElement as a source and create the GPUTexture or GPUExternalTexture
the newly loaded HTMLVideoElement
Load a video from a URL or HTMLVideoElement and register onVideoLoaded callback
the video URL or HTMLVideoElement to load
Callback to run when the source has been loaded
callback to run when the source has been loaded
Callback to run when the source has been uploaded
callback to run when the source been uploaded
Render a DOMTexture:
Destroy the DOMTexture
Used to create GPUTexture or GPUExternalTexture, specially made to handle different kinds of DOM elements sources, like HTMLImageElement, HTMLVideoElement or HTMLCanvasElement.
Handles the various sources loading and uploading, GPU textures creation,texture model matrix binding and GPU texture binding.
Example