Texture constructor
renderer object or GPUCurtains class object used to create this Texture.
parameters used to create this Texture.
The type of the Texture.
ReadonlyuuidThe 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.
Optionalwidth?: numbersource width.
Optionalheight?: numbersource height.
Optionaldepth?: numbersource depth.
Optionalorigin?: GPUOrigin3D().destination.origin | GPUOrigin3D of the source copy.
OptionalcolorSpace?: PredefinedColorSpaceUse data as the texture source and upload it to the GPU.
parameters used to upload the source.
Optionalwidth?: numberdata source width.
Optionalheight?: numberdata source height.
Optionaldepth?: numberdata source depth.
Optionalorigin?: GPUOrigin3D().destination.origin | GPUOrigin3D of the data source copy.
Optionaldata?: Float32ArrayFloat32Array data to use as source.
Update our Texture quality ratio and resize it.
New quality ratio to use.
Resize our Texture, which means recreate it/copy it again and tell the texture bind group to update.
the optional new size to set.
Set our Texture size, recreate it/copy it again and tell the texture bind group to update.
the 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