Capítulo 91 de 859

Chapter 91: ShadowMaterial

Core Idea

This material can receive shadows, but otherwise is completely transparent.

Key Concepts

  • color : Color: Color of the material.
  • fog : boolean: Whether the material is affected by fog or not.
  • isShadowMaterial : boolean (readonly): This flag can be used for type testing.
  • transparent : boolean: Overwritten since shadow materials are transparent by default.

Code Examples

const geometry = new THREE.PlaneGeometry( 2000, 2000 );
geometry.rotateX( - Math.PI / 2 );
const material = new THREE.ShadowMaterial();
material.opacity = 0.2;
const plane = new THREE.Mesh( geometry, material );
plane.position.y = -200;
plane.receiveShadow = true;
scene.add( plane );
  • What it demonstrates: Typical usage of ShadowMaterial.

Reference Tables

Constructor

Signature
new ShadowMaterial( parameters : Object )

Properties

PropertyDescription
.color : ColorColor of the material.
.fog : booleanWhether the material is affected by fog or not.
.isShadowMaterial : boolean (readonly)This flag can be used for type testing.
.transparent : booleanOverwritten since shadow materials are transparent by default.

Key Takeaways

  1. ShadowMaterial extends: EventDispatcher → Material
  2. Most relevant properties: color, fog, isShadowMaterial, transparent.

Connects To