MeshDepthMaterial - Verge3D User Manual - Soft8Soft
Description: Learn how to use MeshDepthMaterial in your interactive 3D apps made with Verge3D

Material →

# MeshDepthMaterial

A material for drawing geometry by depth. Depth is based off of the camera near and far plane. White is nearest, black is farthest.

## Constructor

### MeshDepthMaterial(parameters : Object)

parameters — (optional) an object with one or more properties defining the material's appearance. Any property of the material (including any property inherited from Material) can be passed in here.

## Properties

See the base Material class for common properties.

### # .depthPacking : Constant

Encoding for depth packing. Default is BasicDepthPacking.

### # .fog : Boolean

Whether the material is affected by fog. Default is `false`.

### # .map : Texture

The color map. May optionally include an alpha channel, typically combined with .transparent or .alphaTest. Default is `null`.

### # .slopeScaledBias : Float

An adaptive bias which depends on the polygon's slope relative to the camera. Applied only if .useSlopeScaledBias is set to `true`. Default is `0`. For materials used for shadow mapping this property is auto-assigned from LightShadow.slopeScaledBias. The exception is ESM shadows, which set `slopeScaledBias` to `0.5`.

### # .useSlopeScaledBias : Boolean

Enables or disables .slopeScaledBias. Default is `false`. For materials used for shadow mapping this property is auto-assigned to `true`.

### # .wireframe : Boolean

Render geometry as wireframe. Default is false (i.e. render as smooth shaded).

### # .wireframeLinewidth : Float

Controls wireframe thickness. Default is `1`.

Due to limitations of WebGL renderer on most platforms linewidth will always be 1 regardless of the set value.

## Methods

See the base Material class for common methods.

## Source

For more info on how to obtain the source code of this module see this page.