我想在three.js
中模拟反光地板(like this)此外,我不希望复制房屋并制作透明地板,因为这会增加模型的尺寸。
我尝试设置cubeCamera并将其输出渲染到地板但它总是显示为黑色。
mirrorCamera = new THREE.CubeCamera(0.01, 1000, 512);
mirrorCamera.renderTarget.minFilter = THREE.LinearMipMapLinearFilter;
scene.add(mirrorCamera);
var mirrorFloorMaterial = new THREE.MeshLambertMaterial(
{
map: floorTexture,
reflectivity: .8,
side: THREE.DoubleSide,
envMap: mirrorCamera.renderTarget
});
mirrorFloor = new THREE.Mesh(cubeGeom, mirrorFloorMaterial);
mirrorFloor.doubleSided = true;
mirrorCamera.position = mirrorFloor.position;
scene.add(mirrorFloor);
......
......
//in render()
mirrorFloor.visible = false;
mirrorCamera.updateCubeMap(renderer, scene);
mirrorFloor.visible = true;
renderer.render(scene, firstPerson.camera);
1)为什么我总是看到黑色代替地板而不是立方体摄像机应该呈现什么?
2)有人能建议一种模拟地板反射的巧妙方法吗?
提前致谢。