ShadowMaterial 阴影材质

—> Material

function ShadowMaterial( parameters ) { } var light = new THREE.SpotLight( 0xffffff, 1.5 ); light.position.set( 0, 25, 18 ); light.castShadow = true; light.shadow = new THREE.LightShadow( new THREE.PerspectiveCamera( 70, 1, 8, 80 ) ); light.shadow.bias = -0.000222; light.shadow.mapSize.width = 1024; light.shadow.mapSize.height = 1024; scene.add( light ); renderer.shadowMap.enabled = true; var geometry = new THREE.BoxGeometry(6, 6, 6), material = new THREE.MeshLambertMaterial({color: 0xb180e3}), mesh = new THREE.Mesh(geometry, material); mesh.castShadow = true; scene.add(mesh); var shadowGeometry = new THREE.PlaneBufferGeometry( 50, 50 ); shadowGeometry.rotateX( - Math.PI / 2 ); var shadowMaterial = new THREE.ShadowMaterial( { opacity: 0.2 } ), plane = new THREE.Mesh( shadowGeometry, shadowMaterial ); plane.position.y = -8; plane.receiveShadow = true; scene.add( plane );

Attributes

type : String

Default value : 'ShadowMaterial'
Description : 类型

color : Color

Default value : 0xffffff
Description : 颜色

transparent : Boolean

Default value : true
Description : 是否透明.