API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
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
Compositing blend mode; defaults to BlendModes.Normal.
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.
GLSL/WGSL source pair backing this material.
textures?: Record<string, RenderTextureAn off-screen render target that can also be sampled as a texture. Combines RenderTarget (framebuffer attachment) with the sampler parameters of a Texture (sca… | TextureA static GPU texture sourced from an image, canvas, or video element. Holds the pixel source, its sampling state (ScaleModes, WrapModes) and its upload state (…>Declared texture slots claimed in addition to the drawable's own texture.
uniformBlocks?: B extends undefined ? never : UniformBlockInitialValuesPer-block starting values accepted when an instance is constructed.<Extract<B, Readonly<Record<string, UniformBlockOne explicitly named uniform block. Use this only with `uniformBlocks`, where the record key supplies both the shader-visible instance name and the runtime nam…<Readonly<Record<string, UniformFieldDeclarationOne entry of a UniformFields record.>>>>>>>Starting values per named block, for a source declaring uniformBlocks.
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?: booleanWrite 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