我正在尝试创建一个由PointLights点亮的场景,但是在使用Lambert材质时灯光无法正常工作。看起来灯只在两个灯到达表面时才会渲染。
当我尝试使用Phong材料时,它会正确呈现。
我的渲染器:
var renderer = new THREE.WebGLRenderer();
renderer.shadowMap.enabled = true;
renderer.shadowMap.renderSingleSided = false;
平面:
var planeGeometry = new THREE.PlaneGeometry(40, 40, 1, 1);
var planeMaterial = new THREE.MeshLambertMaterial();
var plane = new THREE.Mesh(planeGeometry,planeMaterial);
plane.receiveShadow = true;
墙:
var boxMaterial = new THREE.MeshLambertMaterial({ color: 0x457dd8 });
var boxGeometry = new THREE.BoxGeometry(9, 2, 0.2, 1, 1, 1);
var box = new THREE.Mesh(boxGeometry, boxMaterial);
box.castShadow = true;
box.receiveShadow = true;
环境光
var ambientLight = new THREE.AmbientLight("#999292");
和pointLights:
var pointLight = new THREE.PointLight(0xff0000, 20, 50);
pointLight.position.set(16, 1.5, 15.5);
pointLight.castShadow = true;
我做错了什么?我认为这可能是一个错误。
以下是我的示例:https://jsfiddle.net/aojnmspn/
我正在使用Three.js R87