import { CreateTexture } from "https://deno.land/x/shader_canvas@v1.1.1/core/webgl_textures/create_texture.ts";
Properties
Promise that resolves when all dependencies have registered their tag in the customElements global Web Components registry.
This is used in the async initialize() function, to ensure that its code only runs when all the tags it depends are available.
Methods
Initializing a texture consists in calling the initialization function for each child instance.
This function creates the bindTexture
function above, which allows
to set this texture id as the target for further WebGL actions
Static Properties
<{{texture-name}}>
{#CreateTexture}
You chose the tag name for your textures when declaring them. This name is then used to reference this Texture in other Shader Canvas containers and parts (like draw calls).
The allowed children of a Texture are:
<tex-image-2d>
Sets the Image data for this texture
Example
<shader-canvas>
<webgl-canvas>
<webgl-textures>
<such-an-awesome-image>
<tex-image-2d src="#texture"></tex-image-2d>
</such-an-awesome-image>
</textures>
</webgl-canvas>
<img id="texture" src="awesome-texture.png">
</shader-canvas>
For a usable example check the 2nd example - texture quad
This custom named tag is meant to be used as a child of the
<webgl-textures>
container tag.