MotionScript

@motion-script/core


@motion-script/core / MaterialCommon3D

Interface: MaterialCommon3D

Defined in: render3d/material.ts:17

State every material shares, regardless of shading model.

A note on cost, because it is not obvious: the fields in the first block are plain uniform writes the renderer can mutate in place every frame, so they are free to animate. The fields marked structural change the compiled shader program, so changing one mid-timeline forces a recompile — set them once and leave them alone rather than tweening them.

Extends

Extended by

Properties

alphaTest?

optional alphaTest?: number

Defined in: render3d/material.ts:30

Structural. Discard fragments below this alpha. Cheap cutout transparency.


blending?

optional blending?: Blending3D

Defined in: render3d/material.ts:36

Structural. How the colour combines with the framebuffer.


depthTest?

optional depthTest?: boolean

Defined in: render3d/material.ts:45

Test against the depth buffer. Turn off to force draw-on-top.


depthWrite?

optional depthWrite?: boolean

Defined in: render3d/material.ts:43

Write to the depth buffer. Turn off for additive glows and inside-out shells.


dithering?

optional dithering?: boolean

Defined in: render3d/material.ts:51

Smooth gradient banding.


key?

optional key?: string

Defined in: render3d/material.ts:54

Explicit reconciler identity — see Transform3D.key.


opacity?

optional opacity?: number

Defined in: render3d/material.ts:19

0–1. Needs transparent to actually show through. Free to animate.


params?

optional params?: Record<string, unknown>

Defined in: render3d/geometry.ts:14

Inherited from

Passthrough3D.params


polygonOffset?

optional polygonOffset?: boolean

Defined in: render3d/material.ts:47

Nudge depth to break z-fighting between coplanar surfaces.


polygonOffsetFactor?

optional polygonOffsetFactor?: number

Defined in: render3d/material.ts:48


polygonOffsetUnits?

optional polygonOffsetUnits?: number

Defined in: render3d/material.ts:49


side?

optional side?: Side3D

Defined in: render3d/material.ts:32

Structural. Which faces to rasterize. Default "front".


toneMapped?

optional toneMapped?: boolean

Defined in: render3d/material.ts:40

Structural. Apply the scene's tone mapping. Default true.


transparent?

optional transparent?: boolean

Defined in: render3d/material.ts:28

Structural. Opt into alpha blending. Off by default because blended surfaces must be depth-sorted, which costs correctness at intersections — prefer alphaTest for cutouts like foliage.


vertexColors?

optional vertexColors?: boolean

Defined in: render3d/material.ts:38

Structural. Read per-vertex colours from the geometry's color buffer.


visible?

optional visible?: boolean

Defined in: render3d/material.ts:21

Hide without removing. Free to animate.


wireframe?

optional wireframe?: boolean

Defined in: render3d/material.ts:34

Structural. Draw edges only.