📄 drei/shaders/mesh-discard-material

File: mesh-discard-material.md | Updated: 11/15/2025


title: MeshDiscardMaterial sourcecode: src/core/MeshDiscardMaterial.tsx

A material that renders nothing. In comparison to <mesh visible={false} it can be used to hide objects from the scene while still displays shadows and children.

<mesh castShadow>
  <torusKnotGeonetry />
  <MeshDiscardMaterial />
  {/* Shadows and edges will show, but the model itself won't */}
  <Edges />