Interface RenderMaterialBaseParams

Base parameters used to create a RenderMaterial

interface RenderMaterialBaseParams {
    uniforms?: ReadOnlyInputBindings;
    storages?: ReadWriteInputBindings;
    bindings?: BindGroupBindingElement[];
    bindGroups?: BindGroup[];
    samplers?: Sampler[];
    textures?: Texture[];
    domTextures?: DOMTexture[];
    useProjection: boolean;
    transparent: boolean;
    depth: boolean;
    depthWriteEnabled: boolean;
    depthCompare: GPUCompareFunction;
    depthFormat: GPUTextureFormat;
    cullMode: GPUCullMode;
    sampleCount: number;
    targets: GPUColorTargetState[];
    verticesOrder: GPUFrontFace;
    topology: GPUPrimitiveTopology;
}

Hierarchy (view full)

Properties

uniforms input to pass to a BindGroup

read only or read/write storages input to pass to a BindGroup

array of already created bindings (buffers, texture, etc.) to pass to this BindGroup

bindGroups?: BindGroup[]

Array of already created bind groups to be used by this Material

samplers?: Sampler[]

Array of already created samplers to be used by this Material

textures?: Texture[]

Array of already created Texture to be used by this Material

domTextures?: DOMTexture[]

Array of already created DOMTexture to be used by this Material

useProjection: boolean

Whether this RenderMaterial should implicitly use the renderer camera bind group

transparent: boolean

Whether this RenderMaterial should be treated as transparent. Impacts the render pipeline blend property

depth: boolean

Whether this RenderMaterial should write to the depth buffer

depthWriteEnabled: boolean

Whether this RenderMaterial should enable depth write

depthCompare: GPUCompareFunction

Depth function to use with this RenderMaterial

depthFormat: GPUTextureFormat

Format of the depth texture to use with this RenderMaterial

cullMode: GPUCullMode

Cull mode to use with this RenderMaterial

sampleCount: number

The sampleCount of the RenderPass onto which we'll be drawing. Set internally.

targets: GPUColorTargetState[]

Array of one or multiple targets properties.

Each target should be an object with the optional format, blend and writeMask properties.

The format property will be internally patched to match the output RenderPass target (default to the renderer preferred format).

If defined, the blend property can override the default transparent blending if set.

verticesOrder: GPUFrontFace

Vertices order to be used by the render pipeline

topology: GPUPrimitiveTopology

Topology to use with this RenderMaterial, i.e. whether to draw triangles or points (see https://www.w3.org/TR/webgpu/#enumdef-gpuprimitivetopology)