Skip to content

Interface: SurfaceConfig ​

Defined in: classes.ts:154

Configuration options for surface material properties and appearance SurfaceConfig

Example ​

javascript
const config = {
  color: 0xA9A9A9,        // Gray base color
  shininess: 50,          // Moderate shininess
  specularColor: 0x666666,// Light gray highlights
  emissive: 0x0a0a0a,     // Slight self-illumination
  emissiveIntensity: 0.2, // 20% emissive strength
  alpha: 0.8,             // 80% opacity
  flatShading: false      // Smooth shading
};
surface.updateConfig(config);

Extended by ​

Properties ​

color? ​

ts
optional color?: ColorRepresentation;

Defined in: classes.ts:156

Base color of the surface when no vertex coloring is applied. Can be hex number, string, or THREE.Color


flatShading? ​

ts
optional flatShading?: boolean;

Defined in: classes.ts:159

If true, renders each face with a single normal (faceted look). If false, interpolates normals (smooth look)


smoothingAngle? ​

ts
optional smoothingAngle?: number;

Defined in: classes.ts:162

Angle threshold in degrees for smooth shading (0-180). Edges with angles above this threshold will appear sharp


materialType? ​

ts
optional materialType?: "phong" | "standard" | "physical";

Defined in: classes.ts:165

Material type: 'phong' (default) or 'standard' (PBR). Standard enables metalness/roughness


shininess? ​

ts
optional shininess?: number;

Defined in: classes.ts:169

Controls size of specular highlights (0-200). 0 = matte/dull, 200 = very shiny/metallic. Only for Phong material


specularColor? ​

ts
optional specularColor?: number;

Defined in: classes.ts:172

Color of specular reflections. Usually grayscale for realistic materials. Hex number format. Only for Phong material


metalness? ​

ts
optional metalness?: number;

Defined in: classes.ts:176

How metallic the surface is (0-1). 0 = dielectric (plastic), 1 = metal. Only for Standard/Physical material


roughness? ​

ts
optional roughness?: number;

Defined in: classes.ts:179

How rough the surface is (0-1). 0 = smooth/shiny, 1 = rough/matte. Only for Standard/Physical material


emissive? ​

ts
optional emissive?: ColorRepresentation;

Defined in: classes.ts:183

Self-illumination color. Makes the surface glow independently of scene lights


emissiveIntensity? ​

ts
optional emissiveIntensity?: number;

Defined in: classes.ts:186

Multiplier for emissive color strength (0-1). 0 = no glow, 1 = full glow


alpha? ​

ts
optional alpha?: number;

Defined in: classes.ts:189

Opacity/transparency (0-1). 0 = fully transparent, 1 = fully opaque


thresh? ​

ts
optional thresh?: [number, number];

Defined in: classes.ts:192

Threshold range [min, max] for hiding values. Values within range are made transparent


irange? ​

ts
optional irange?: [number, number];

Defined in: classes.ts:195

Input data range [min, max] for color mapping normalization

Released under the MIT License.