API

Interface IWebGPURenderPipelineAsyncCreationOptions

Options for pre-warming a render pipeline asynchronously. All render state properties are optional and default to the most common opaque rendering state.

interface IWebGPURenderPipelineAsyncCreationOptions {
    alphaMode?: number;
    colorFormat?: GPUTextureFormat;
    cullEnabled?: boolean;
    cullFace?: number;
    depthCompare?: number;
    depthStencilFormat?: GPUTextureFormat;
    depthTest?: boolean;
    depthWrite?: boolean;
    effect: Effect;
    fillMode?: number;
    frontFace?: number;
    mesh: AbstractMesh;
    sampleCount?: number;
    stencilEnabled?: boolean;
    subMesh?: SubMesh;
    textures?: { [name: string]: Nullable<InternalTexture> };
    writeMask?: number;
}
Index
alphaMode?: number

The alpha blending mode (e.g. Constants.ALPHA_DISABLE, Constants.ALPHA_COMBINE). Defaults to Constants.ALPHA_DISABLE.

colorFormat?: GPUTextureFormat

The color render target format. Defaults to the engine's current canvas color format.

cullEnabled?: boolean

Whether back-face culling is enabled. Defaults to true.

cullFace?: number

Which face to cull (1 = back, 2 = front). Defaults to 1 (back).

depthCompare?: number

The depth comparison function (e.g. Constants.LEQUAL). Defaults to Constants.LEQUAL.

depthStencilFormat?: GPUTextureFormat

The depth-stencil render target format. Defaults to the engine's current depth format.

depthTest?: boolean

Whether depth testing is enabled. Defaults to true.

depthWrite?: boolean

Whether depth writing is enabled. Defaults to true.

effect: Effect

The compiled effect (shader stages) for the pipeline.

fillMode?: number

The fill mode / primitive topology. Defaults to Constants.MATERIAL_TriangleFillMode.

frontFace?: number

Front face winding order (1 = CCW, 2 = CW). Defaults to the one the draws of the mesh with the effect use in the current pass (the canvas outside of a render pass), with the material their sub mesh draws with (the scene's default one when the mesh has none, a render pass's, a multi-material's): from the side orientation of the material, or else of the mesh (of its source for an instance), reversed when the world matrix of the mesh mirrors, and in a render target, which is drawn Y-flipped, reversed again.

The mesh whose vertex buffer layout to use.

sampleCount?: number

The MSAA sample count. Defaults to the engine's current sample count.

stencilEnabled?: boolean

Whether stencil testing is enabled. Defaults to false.

subMesh?: SubMesh

The sub mesh of the mesh whose draws use the pipeline, for the default front face (default: its sub mesh drawn with the effect, or else its first one). Sub meshes drawn with one effect can have materials of different side orientations.

textures?: { [name: string]: Nullable<InternalTexture> }

The textures the draws bind, by the name the effect binds them with, e.g. { shadowTexture0: shadowGenerator.getShadowMap()!.depthStencilTexture } for the shadows of the first light with PCF or PCSS filtering. A draw that binds a depth texture, or a float texture the device can't filter linearly, uses a pipeline of its own: the pipeline created is the one of a draw that binds these textures, and other textures can be left out. Defaults to none: the pipeline of a draw that binds no such texture.

writeMask?: number

Color channel write mask (bitmask of RGBA channels). Defaults to 0xF (all channels).