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.
new MeshRenderable(props): MeshRenderable;| Parameter | Description |
|---|---|
props: MeshRenderableProps | Initialization properties. |
Types
MeshRenderableProps
Initialization properties for constructing a mesh renderable.
| Property | Description |
|---|---|
geometry: Geometry | The mesh geometry with position and normal attributes. |
color?: ColorLike | The mesh color. Alpha is ignored. Defaults to Color.WHITE. |
ambientStrength?: number | Ambient lighting contribution. Defaults to 0.25. |
diffuseStrength?: number | Diffuse lighting contribution. Defaults to 0.75. |
Properties
color
The mesh color. Alpha is ignored. Defaults to Color.WHITE.
color: Color;ambientStrength
Ambient lighting contribution. Defaults to 0.25.
ambientStrength: number;diffuseStrength
Diffuse lighting contribution. Defaults to 0.75.
diffuseStrength: number;Accessors
type string overrides
Identifies the renderable type as MeshRenderable.
get type(): string;Methods
getUniforms() UniformValues overrides
Returns the color and lighting strength uniforms for the mesh shader.
getUniforms(): UniformValues;