Skip to content

ModelMaterial

ModelMaterial holds the render options for a 3d-tiles layer’s models. It is set via the model key. The dataset URL and other fetch config live on the referenced 3d-tiles source, not here.

Type: string | undefined

Description: Specifies an animation registered in the GLTF.

Default: undefined

Example:

{
model: {
animationActiveClip: "Walk"
}
}

Type: number | undefined

Description: Specifies the animation playback speed. 1.0 is normal speed.

Default: undefined

Example:

{
model: {
animationSpeed: 1.0
}
}

Type: boolean | undefined

Description: Specifies whether the model casts shadows. This works when shadows are enabled on the View and castShadow is enabled on the sunlight.

Default: undefined

Example:

{
model: {
castShadow: true
}
}

Type: Color | undefined

Description: Specifies the model color as a Color instance. It multiplies the model’s own colors (the glTF base color, textures, and vertex colors), so white keeps them as they are.

Default: undefined

Example:

import { Color } from "@navaramap/three";
{
model: {
color: new Color().setHex(0xffffff)
}
}

Type: number | undefined

Description: Specifies the crease angle (in radians) used when normals is enabled. Edges whose shared face angle exceeds this threshold are kept as creased (hard) edges. Smaller angles are smoothed.

Default: Math.PI / 6 (30°, applied when normals is enabled and this property is omitted)

Example:

{
model: {
normals: true,
creaseNormalAngle: Math.PI / 3, // 60°
}
}

Type: boolean | undefined

Description: Enables writing to the depth buffer. Set to false for transparent materials to prevent depth sorting issues.

Default: true

Example:

{
model: {
depthWrite: false
}
}

Type: string[] | undefined

Description: Specifies the IDs of selective effects to apply (e.g., “bloom”, “outline”). Used in conjunction with SelectiveBloomEffectDesc or SelectiveOutlineEffectDesc.

Default: undefined

Example:

{
model: {
effectIds: ["bloom", "outline"]
}
}

Type: Color | undefined

Description: Specifies the emissive color as a Color instance.

Default: undefined

Example:

import { Color } from "@navaramap/three";
{
model: {
emissiveColor: new Color().setHex(0xff0000)
}
}

Type: number | undefined

Description: Specifies the emissive intensity.

Default: undefined

Example:

{
model: {
emissiveIntensity: 0.5
}
}

Type: number | undefined

Description: Specifies the height of the model. The unit is meters.

Default: undefined

Example:

{
model: {
height: 50 // 50 meters
}
}

Type: number | undefined

Description: Specifies the index of refraction of the specular highlight’s Fresnel term. Has no effect on water.

Default: undefined

Example:

{
model: {
ior: 1.5 // Index of refraction for glass
}
}

Type: boolean | undefined

Description: Applies the lighting equation to the color output. When false, the model renders as plain albedo. The rest of the lit pipeline still runs, so normals and the shadow G-buffer keep being written. Leaving it unset follows the scene default, view.lit. Setting it explicitly overrides that default in either direction.

Default: undefined (follows view.lit)

Example:

{
model: {
lit: false // Plain albedo output, e.g. for a deferred lighting pass
}
}

Type: number | undefined

Description: The maximum value used to determine the level of detail (LOD). Higher values improve performance but reduce visual quality.

Default: undefined

Example:

{
model: {
maxSse: 8
}
}

Type: number | undefined

Description: Specifies the metalness of the material. Specified in the range of 0.0 to 1.0. SSR and the aerial perspective’s specular term read it as is as the reflectance at normal incidence: 0 does not reflect, and 1 reflects like a mirror.

Default: undefined

Example:

{
model: {
metalness: 0.1
}
}

Type: boolean | undefined

Description: When enabled, vertex normals are recomputed using a creased-normals algorithm after the model loads. This is useful for tiled glTF assets that ship without normals or with low-quality normals (for example, photogrammetry tilesets), so that lighting and the aerial perspective effect can shade them correctly. The crease angle is configured by creaseNormalAngle.

Default: undefined

Example:

{
model: {
normals: true,
}
}

Type: number | undefined

Description: Specifies the opacity of the model. Valid range is 0.0 (fully transparent) to 1.0 (fully opaque). This property controls the alpha value when the material is rendered with transparency enabled.

Default: 1.0

Example:

{
model: {
transparent: true,
opacity: 0.5 // 50% opacity
}
}

Type: number | undefined

Description: Specifies the point size when rendering as a point cloud.

Default: undefined

Example:

{
model: {
pointSize: 2.0
}
}

Type: boolean | undefined

Description: Specifies whether the model receives shadows.

Default: undefined

Example:

{
model: {
receiveShadow: true
}
}

Type: number | undefined

Description: Specifies the reflectivity for post-processing or environment maps.

Default: undefined

Example:

{
model: {
reflectivity: 0.8
}
}

Type: number | undefined

Description: Specifies the roughness for post-processing. Specified in the range of 0.0 to 1.0.

Default: undefined

Example:

{
model: {
roughness: 0.1
}
}

Type: number | undefined

Description: Specifies the shininess of the specular highlight. Has no effect on water.

Default: undefined

Example:

{
model: {
shininess: 30
}
}

Type: boolean | undefined

Description: A property that automatically adjusts the model’s orientation for correct placement on the ellipsoid.

Default: undefined

Example:

{
model: {
shouldRotateInDefault: true
}
}

Type: boolean | undefined

Description: Specifies whether to show the model.

Default: undefined

Example:

{
model: {
show: true
}
}

Type: boolean | undefined

Description: Specifies whether to show the bounding box. Used for debugging purposes.

Default: undefined

Example:

{
model: {
showBoundingBox: true
}
}

Type: number | undefined

Description: Specifies the size of the model.

Default: undefined

Example:

{
model: {
size: 1.5 // 1.5x size
}
}

Type: boolean | undefined

Description: Specifies whether to enable the specular effect. When enabled, the shininess and specularStrength values are used. Has no effect on water.

Default: undefined

Example:

{
model: {
specular: true
}
}

Type: number | undefined

Description: Specifies the intensity of the specular highlight. Has no effect on water.

Default: undefined

Example:

{
model: {
specularStrength: 0.5
}
}

Type: boolean | undefined

Description: Enables transparency and alpha blending. When enabled, the material can be rendered with transparency based on the model’s alpha channel.

Default: false

Example:

{
model: {
transparent: true
}
}

Type: boolean | undefined

Description: Specifies whether to render the model as a water surface. Its waves follow waveStrength and waveDirection. They keep their size in meters and are visible up close, and from about 2 km away the surface reads as one uniformly rough plane under the sun’s glitter. The surface reflects the sky with a Fresnel term and the sun with its own highlight, so reflectivity, roughness, shininess, specularStrength, specular, and ior have no effect on it. Waves move only while frames render, for example with ThreeView.animation on.

Default: undefined

Example:

{
model: {
water: true
}
}

Type: number | undefined

Description: Scales the slopes of the water’s waves, keeping their size and speed. 0 makes a still, mirror-like surface. Only used when water is enabled.

Default: 1

Example:

{
model: {
water: true,
waveExaggeration: 0.5
}
}

Type: "ocean" | "large" | "medium" | "small" | undefined

Description: Extent of the water body. Waves grow with the open distance across the water, so a smaller body gets shorter, finer waves at the same waveStrength. "ocean" grows the waves as far as waveStrength allows. "large" assumes about 20 km of open water, such as a bay or a large lake. "medium" assumes about 2 km, such as a lake or a wide river. "small" assumes about 200 m, such as a river or a pond. The slope of the waves still follows waveStrength. Only used when water is enabled.

Default: "ocean"

Example:

{
model: {
water: true,
waterScale: "small"
}
}

Type: number | undefined

Description: Sets the size, steepness, and speed of the waves. About 1 is a calm ripple, 5 is moderate, and 20 is a storm. To change only their height, use waveExaggeration. Only used when water is enabled.

Default: 5

Example:

{
model: {
water: true,
waveStrength: 12
}
}

Type: number | undefined

Description: The direction the waves travel, in degrees clockwise from north. Only used when water is enabled.

Default: 0

Example:

{
model: {
water: true,
waveDirection: 225
}
}

Type: number | undefined

Description: The speed in m/s of a current that carries the waves along waveDirection, without changing their size or slope. The whole surface moves as one. Only used when water is enabled.

Default: 0

Example:

{
model: {
water: true,
waveDirection: 90,
flowSpeed: 2
}
}