Texture constructor
renderer object or GPUCurtains class object used to create this Texture.
parameters used to create this Texture.
The type of the Texture.
Readonly
uuidThe universal unique id of this Texture.
The GPUTexture used.
Size of the texture source, usually our renderer canvas size.
Options used to create this Texture.
Array of bindings that will actually only hold one texture binding.
Get our texture binding.
New Renderer or GPUCurtains instance to use.
Set our bindings.
Texture to copy.
Copy a GPUTexture directly into this Texture. Mainly used for depth textures.
GPUTexture to copy.
Create the texture (or copy it from source) and update the binding resource.
Upload a source to the GPU and use it for our texture.
parameters used to upload the source.
source to use for our texture.
Optional
width?: numbersource width.
Optional
height?: numbersource height.
Optional
depth?: numbersource depth.
Optional
origin?: GPUOrigin3D().destination.origin | GPUOrigin3D of the source copy.
Optional
colorSpace?: PredefinedColorSpaceUse data as the texture source and upload it to the GPU.
parameters used to upload the source.
Optional
width?: numberdata source width.
Optional
height?: numberdata source height.
Optional
depth?: numberdata source depth.
Optional
origin?: GPUOrigin3D().destination.origin | GPUOrigin3D of the data source copy.
Optional
data?: Float32ArrayFloat32Array data to use as source.
Resize our Texture, which means recreate it/copy it again and tell the texture bind group to update.
the optional new size to set.
Destroy our Texture.
This is the main class used to create and handle textures that can be used with ComputePass and/or Mesh. Also used as copy source/destination for RenderPass and RenderTarget.
Mostly useful to handle depth and storages textures or to copy anything outputted to the screen at one point or another. It can handle basic data or image bitmap upload, but for external sources textures (like images, videos or canvases) you should use the MediaTexture class instead.
Will create a GPUTexture and its associated TextureBinding.
Example