在我的项目中,a 在场景中添加了一个 cubeCamera 以获取动态 envMapping(反射)。如您所见,厨房的后墙有反射,上面有一些模糊,而且边缘也被渲染为非抗锯齿。那么我怎样才能摆脱断线并在墙上锐化反射呢?
代码 :
var cubeCamera = new THREE.CubeCamera(1, 1000, 256);
cubeCamera.renderTarget.minFilter = THREE.LinearMipMapLinearFilter;
scene.add(cubeCamera);
var material = new THREE.MeshPhongMaterial({
ambient: 0x996633,
reflectivity: 1,
color: 0x996633,
specular: 0x050505,
shininess: 100,
shading: THREE.SmoothShading, //THREE.FlatShading,
blending: THREE.NormalBlending,
side: THREE.DoubleSide,
envMap: project.cubeCamera.renderTarget,
wireframe: false
});
objMesh.material = material;
在渲染函数中:
objMesh.visible = false;
objMesh.cubeCamera.updateCubeMap(renderer, scene);
objMesh.visible = true;
renderer.render(scene, camera);
所以代码就像在网络上找到的每个样本一样。没有不同。但我发现的一件事是,对基元的反射是完美的,但对从 obj 文件加载的自定义网格的反射很差。