Skip to content

Materials and textures

The editor exposes common PBR properties for the material attached to a selected mesh.

Material properties

  • Base color
  • Metalness and roughness
  • Emissive color and intensity
  • Opacity and transparency
  • Side and wireframe mode

Supported texture slots

ts
'map' | 'normalMap' | 'roughnessMap' |
'metalnessMap' | 'emissiveMap' | 'aoMap'

UV transform controls

Each supported texture can store:

  • repeat
  • offset
  • center
  • rotation
  • wrapS and wrapT
  • flipY
  • color space
ts
texture.wrapS = THREE.RepeatWrapping
texture.wrapT = THREE.MirroredRepeatWrapping
texture.repeat.set(3, 2)
texture.center.set(0.5, 0.5)
texture.rotation = Math.PI / 4
texture.needsUpdate = true

Shared textures

Multiple materials may refer to the same THREE.Texture object. Use Make texture unique before changing UV transforms when only one material should change.

Export matching

Material overrides are matched by mesh name/index and material index. Keep names stable when re-exporting a model.

Runtime-only use

ts
await applyMaterialOverrides(scene, preset.materials, {
  textureUrls,
  onTextureError,
})

Released under the MIT License.