半透明网格的阴影太暗

时间:2018-11-26 12:04:08

标签: three.js

我有一个几乎是透明的盒子(不透明度设置为0.1),但是阴影非常暗(请参阅http://jsfiddle.net/dskb80jq/4/)。 “阴影计算将不透明度考虑在内”开关在哪里?

renderer = new THREE.WebGLRenderer({
    antialias: true
});
renderer.shadowMap.enabled = true;
renderer.shadowMap.type = THREE.PCFSoftShadowMap;
renderer.physicallyCorrectLights = true;

那是我的材质和网格:

// Create material
material = new THREE.MeshStandardMaterial();
material.transparent = true;
material.opacity = 0.1;

// Create cube and add to scene.
var geometry = new THREE.BoxGeometry(200, 200, 200);
mesh = new THREE.Mesh(geometry, material);
mesh.castShadow = true;
scene.add(mesh);

现在应该有光:

var spotLight = new THREE.SpotLight(0xffffff, 1000.0);
spotLight.position.set(400, 400, 200);
spotLight.castShadow = true;
spotLight.shadow.mapSize.width = 2048;
spotLight.shadow.mapSize.height = 2048;
spotLight.shadow.camera.near = 10;
spotLight.shadow.camera.far = 1500;  
scene.add(spotLight);

现在。好吧,我希望阴影很浅。缺少的部分在哪里?

0 个答案:

没有答案