@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?
optionalanisotropy?:number
Defined in: render3d/texture.ts:38
Sharpness at grazing angles. Clamped to the GPU's maximum.
Inherited from
center?
optionalcenter?:Vector2| readonly [number,number]
Defined in: render3d/texture.ts:34
Inherited from
colorSpace?
optionalcolorSpace?:TextureColorSpace3D
Defined in: render3d/texture.ts:40
Inherited from
flipY?
optionalflipY?:boolean
Defined in: render3d/texture.ts:39
Inherited from
height
height:
number
Defined in: render3d/texture.ts:97
Buffer height in pixels.
key?
optionalkey?: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?
optionalmagFilter?:TextureFilter3D
Defined in: render3d/texture.ts:35
Inherited from
maxPixelRatio?
optionalmaxPixelRatio?: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?
optionalminFilter?:TextureFilter3D
Defined in: render3d/texture.ts:36
Inherited from
offset?
optionaloffset?:Vector2| readonly [number,number]
Defined in: render3d/texture.ts:31
Inherited from
repeat?
optionalrepeat?: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
rotation?
optionalrotation?:number
Defined in: render3d/texture.ts:33
UV rotation in degrees, about center.
Inherited from
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?
optionalwrapS?:TextureWrap3D
Defined in: render3d/texture.ts:27
Inherited from
wrapT?
optionalwrapT?:TextureWrap3D
Defined in: render3d/texture.ts:28