MotionScript

@motion-script/core


@motion-script/core / SurfaceTexture3D

Interface: SurfaceTexture3D

Defined in: render3d/texture.ts:91

A texture whose pixels are Motion Script's own 2D output, rasterized offscreen — the way to put a chart, a readout or a whole laid-out UI onto 3D geometry.

source is a value, not a name and not a mounted node: either a built Graphics command list, or a Node subtree. Both are supplied directly, so there is no matching indirection and nothing has to live in a particular place in the scene tree.

g3.plane({ map: Tex.surface(scopeGraphics, 1024, 640) }) g3.plane({ map: Tex.surface(statsSubtree, 1024, 640) })

A Node source is adopted for binding by whatever paints the scene — it gets that node's asset catalog, inherited context and clock, which is what makes a webfont shape and an <Image> load. It is never laid out or painted by the scene tree; it is measured against width×height and drawn into the buffer.

Hoist the source. Building it fresh inside the scene builder allocates a new subtree every frame — re-binding, re-laying-out, defeating the texture cache and leaking. Declare it once and pass the same instance.

Extends

Properties

anisotropy?

optional anisotropy?: number

Defined in: render3d/texture.ts:38

Sharpness at grazing angles. Clamped to the GPU's maximum.

Inherited from

TextureOptions3D.anisotropy


center?

optional center?: Vector2 | readonly [number, number]

Defined in: render3d/texture.ts:34

Inherited from

TextureOptions3D.center


colorSpace?

optional colorSpace?: TextureColorSpace3D

Defined in: render3d/texture.ts:40

Inherited from

TextureOptions3D.colorSpace


flipY?

optional flipY?: boolean

Defined in: render3d/texture.ts:39

Inherited from

TextureOptions3D.flipY


height

height: number

Defined in: render3d/texture.ts:97

Buffer height in pixels.


key?

optional key?: string

Defined in: render3d/texture.ts:105

Identity for the texture cache. Defaults to the source's position in the scene walk, which is stable for a scene that emits the same textures every frame. A texture emitted conditionally must pass an explicit key — otherwise its ordinal shifts when something before it disappears and the old GPU texture is orphaned rather than reused.


magFilter?

optional magFilter?: TextureFilter3D

Defined in: render3d/texture.ts:35

Inherited from

TextureOptions3D.magFilter


maxPixelRatio?

optional maxPixelRatio?: number

Defined in: render3d/texture.ts:115

Ceiling on the buffer's device-pixel ratio. Default 1, i.e. the buffer is exactly width × height.

Unlike a 2D node — which wants to match the display — a surface is sampled by a 3D material at whatever size the geometry occupies on screen, so the honest control is width/height. Raise this only when a surface is viewed close up and reads soft.


minFilter?

optional minFilter?: TextureFilter3D

Defined in: render3d/texture.ts:36

Inherited from

TextureOptions3D.minFilter


offset?

optional offset?: Vector2 | readonly [number, number]

Defined in: render3d/texture.ts:31

Inherited from

TextureOptions3D.offset


repeat?

optional repeat?: Vector2 | readonly [number, number]

Defined in: render3d/texture.ts:30

UV scale. [2, 2] tiles twice on each axis (needs a repeat wrap).

Inherited from

TextureOptions3D.repeat


rotation?

optional rotation?: number

Defined in: render3d/texture.ts:33

UV rotation in degrees, about center.

Inherited from

TextureOptions3D.rotation


source

source: SurfaceSource3D

Defined in: render3d/texture.ts:93

A built Graphics, or a Node subtree. Typed structurally — see below.


width

width: number

Defined in: render3d/texture.ts:95

Buffer width in pixels. This is the texture's resolution.


wrapS?

optional wrapS?: TextureWrap3D

Defined in: render3d/texture.ts:27

Inherited from

TextureOptions3D.wrapS


wrapT?

optional wrapT?: TextureWrap3D

Defined in: render3d/texture.ts:28

Inherited from

TextureOptions3D.wrapT