Parameters used to create a ProjectedMesh

interface ProjectedMeshParameters {
    autoRender?: boolean;
    visible?: boolean;
    renderOrder?: number;
    outputTarget?: RenderTarget;
    texturesOptions?: ExternalTextureParams;
    targets?: Partial<GPUColorTargetState>[];
    geometry?: AllowedGeometries;
    frustumCulling?: FrustumCullingCheck;
    DOMFrustumMargins?: RectCoords;
    receiveShadows?: boolean;
    castShadows?: boolean;
    uniforms?: ReadOnlyInputBindings;
    storages?: ReadWriteInputBindings;
    bindings?: BindGroupBindingElement[];
    label?: string;
    shaders?: MaterialShaders;
    useAsyncPipeline?: boolean;
    bindGroups?: BindGroup[];
    samplers?: Sampler[];
    textures?: Texture[];
    domTextures?: DOMTexture[];
    useProjection?: boolean;
    transparent?: boolean;
    depth?: boolean;
    depthWriteEnabled?: boolean;
    depthCompare?: GPUCompareFunction;
    depthFormat?: GPUTextureFormat;
    cullMode?: GPUCullMode;
    sampleCount?: number;
    verticesOrder?: GPUFrontFace;
    topology?: GPUPrimitiveTopology;
}

Hierarchy (view full)

Properties

autoRender?: boolean

Whether we should add this Mesh to our Scene to let it handle the rendering process automatically

visible?: boolean

Flag indicating whether to draw this Mesh or not

renderOrder?: number

Controls the order in which this Mesh should be rendered by our Scene

outputTarget?: RenderTarget

Optional RenderTarget to render this Mesh to instead of the canvas context.

texturesOptions?: ExternalTextureParams

Parameters used by this Mesh to create a DOMTexture

targets?: Partial<GPUColorTargetState>[]

Optional targets properties

Geometry to use

frustumCulling?: FrustumCullingCheck

Frustum culling check to use. Accepts OBB, sphere or a boolean. Default to OBB. When set to true, OBB is used.

DOMFrustumMargins?: RectCoords

Margins (in pixels) to applied to the DOM Frustum to determine if this ProjectedMesh should be frustum culled or not.

receiveShadows?: boolean

Whether the mesh should receive the shadows from shadow casting lights. If set to true, the lights shadow map textures and sampler will be added to the material, and some shader chunks helpers will be added. Default to false.

castShadows?: boolean

Whether the mesh should cast shadows from shadow casting lights. If set to true, the mesh will be automatically added to all shadow maps. If you want to cast only specific shadows, see shadow's addShadowCastingMesh method. Default to false.

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

label?: string

The label of the Material, sent to various GPU objects for debugging purpose

shaders?: MaterialShaders

Shaders to use with this Material

useAsyncPipeline?: boolean

Whether to compile the Material GPUPipelineBase | pipeline asynchronously or not

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.

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)