API reference

Every public class, method, and event in @codexo/exojs. Generated from source.

I

interfaceMeshMaterialOptions

@codexo/exojs / rendering / stable

Construction options for a MeshMaterial.

8
props
0
methods
0
events
Import
import { MeshMaterialOptions } from '@codexo/exojs'

Construction options for a MeshMaterial.

Properties8
Blend mode per colour attachment, in the order the fragment shader's outputs are declared. Defaults to the draw's own blend mode everywhere. What a multi-attachment pass usually wants: the albedo slot composited with alpha, the normal or id slot written straight through, because a blended normal or a blended id is not a value. An entry past the target's attachment count is ignored, and an attachment past the end of the list keeps the blend mode the draw would have used anyway - so [Normal, Additive] and a one-attachment target is just a normal draw. Where the list has an entry it wins over a drawable's own blendMode override; the attachments it does not cover are where that override still decides, as it does for a material without a list at all. Only the fixed-function modes (Normal, Additive, Subtract, Multiply, Screen) can differ per attachment; a backdrop-aware mode composites through a pass of its own and blends as Normal here, exactly as it does inside a captured backdrop. On WebGL2 entries that differ from each other need the OES_draw_buffers_indexed extension, reported as RenderBackend.supportsPerAttachmentBlend; such a draw throws a RenderError on a device without it rather than picking one mode for every attachment. WebGPU always supports it.
Filter/wrap override for the drawable's base texture, or null to inherit that texture's sampler. Additional material textures keep their own sampler state. Defaults to null.
Starting values for the declared uniforms, or - on a source without a schema - the declared uniform slots and their initial values, whose names and scalar/texture kinds form a fixed construction-time schema.
writesDepth?: boolean
Write the clip-space z of this material's vertex stage into the target's depth attachment. Defaults to false. Depth is written, never tested: the comparison is fixed to "always pass", so what is in front of what still follows from draw order and the last draw covering a texel is the one whose depth stays. The result is readable as a texture through RenderTarget.depthTexture, which is what a fog, depth-of-field or SSAO pass consumes. On a target without a depth attachment the material draws exactly as it would otherwise and writes depth nowhere - the flag is not an error there. The values differ per backend for the same z: WebGL2 maps NDC [-1, 1] onto the stored [0, 1], WebGPU's NDC z is already [0, 1]. Ordering is the portable part. Cost: a depth-writing draw needs its own pipeline, and on WebGPU its own render pass, so it does not merge with the batches around it.
Source