Simple Materials: MeshDepthMaterial
Learn how to use THREE.MeshDepthMaterial in Three.js.
We'll cover the following...
We'll cover the following...
The THREE.MeshDepthMaterial
The next material on the list is THREE.MeshDepthMaterial
. With this material, the way an object looks isn’t defined by lights or by a specific material property–it is defined by the distance from the object to the camera. We can, for instance, combine this with other materials to easily create fading effects. The only additional property this material has is one we saw in THREE.MeshBasicMaterial
: the wireframe
property.
Example: Mesh depth material
To demonstrate this material, we created an example that we can view by opening the mesh-depth-material.js
example:
Press + to interact
...