Skip to content

MeshRenderable ​

An opaque mesh shaded with ambient light and a fixed overhead light.

Normals are transformed to world space for diffuse shading. The mesh also writes depth so it can occlude other layers. MeshLayer creates one instance after its source has loaded.

Vertex and index arrays are kept by reference in a separate geometry object, allowing each renderable to use its own GPU buffers without copying the source's CPU data.

Extends RenderableObject and inherits all public properties and methods.

Constructor ​

Creates a mesh renderable for the given geometry and appearance settings.

ts
new MeshRenderable(props): MeshRenderable;
ParameterDescription
props: MeshRenderablePropsInitialization properties.

Types ​

MeshRenderableProps ​

Initialization properties for constructing a mesh renderable.

PropertyDescription
geometry: GeometryThe mesh geometry with position and normal attributes.
color?: ColorLikeThe mesh color. Alpha is ignored. Defaults to Color.WHITE.
ambientStrength?: numberAmbient lighting contribution. Defaults to 0.25.
diffuseStrength?: numberDiffuse lighting contribution. Defaults to 0.75.

Properties ​

color ​

The mesh color. Alpha is ignored. Defaults to Color.WHITE.

ts
color: Color;

ambientStrength ​

Ambient lighting contribution. Defaults to 0.25.

ts
ambientStrength: number;

diffuseStrength ​

Diffuse lighting contribution. Defaults to 0.75.

ts
diffuseStrength: number;

Accessors ​

type string overrides ​

Identifies the renderable type as MeshRenderable.

ts
get type(): string;

Methods ​

getUniforms() UniformValues overrides ​

Returns the color and lighting strength uniforms for the mesh shader.

ts
getUniforms(): UniformValues;

Released under the MIT License