gpu-curtains
    Preparing search index...

    Used as a base to create a Material.

    The purpose of Material is to create and update the bind groups and their bindings (GPU buffers, textures and samplers), create a PipelineEntry and use them to render.

    A Material automatically creates a TextureBindGroup, but it is actually added to the active bind groups array only if necessary, which means if your shaders use a GPUSampler, a GPUTexture or a GPUExternalTexture.

    Another BindGroup will be created if you pass any uniforms or storages parameters.

    Finally, you can also pass already created BindGroup to a Material via the bindGroups parameter.


    Note that this class is not intended to be used as is, but as a base for ComputeMaterial and RenderMaterial classes.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    type: string

    The type of the Material.

    uuid: string

    The universal unique id of the Material.

    renderer: Renderer

    The Renderer used.

    Options used to create this Material.

    pipelineEntry: AllowedPipelineEntries

    Pipeline entry used by this Material.

    bindGroups: AllowedBindGroups[]

    Array of bind groups used by this Material. This array respects a specific order:

    1. The textures bind groups.
    2. The bind group created using uniforms and storages parameters if any.
    3. Additional bind groups parameters if any.
    texturesBindGroups: TextureBindGroup[]

    Array of texture bind groups used by this Material.

    inputsBindGroups: BindGroup[]

    Array of bind groups created using the uniforms and storages parameters when instancing this Material.

    clonedBindGroups: AllowedBindGroups[]

    Array of cloned bind groups created by this Material.

    uniforms: Record<string, Record<string, BufferBindingInput>>

    Object containing all uniforms inputs handled by this Material.

    storages: Record<string, Record<string, BufferBindingInput>>

    Object containing all read only or read/write storages inputs handled by this Material.

    inputsBindings: Map<string, BindGroupBindingElement>

    Map of bindings created using the uniforms and storages parameters when instancing this Material.

    textures: MaterialTexture[]

    Array of Texture or MediaTexture handled by this Material.

    samplers: Sampler[]

    Array of Sampler handled by this Material.

    Accessors

    • get ready(): boolean

      Get whether the renderer is ready, our pipeline entry and pipeline have been created and successfully compiled.

      Returns boolean

    Methods

    • Force setting a given buffer binding shouldUpdate flag to true to update it at next render.

      Parameters

      • OptionalbufferBindingName: string

        The buffer binding name.

      • OptionalbindingName: string

        The binding name.

      Returns void