比较好的例子可以参考
https://threejs.org/examples/webgl_postprocessing_unreal_bloom_selective.html
我用的项目的辉光渲染有bug
可以抄一下这个项目的辉光渲染器
const darkMaterial = new THREE.MeshBasicMaterial({ color: 'black' });
const materials = {}
const darkenNonBloomed2 = (obj) => {
if (obj.isMesh && bloomLayer.test(obj.layers) === false) {
materials[obj.uuid] = obj.material;
obj.material = darkMaterial;
}
};
const restoreMaterial = (obj) => {
if (materials[obj.uuid]) {
obj.material = materials[obj.uuid];
delete materials[obj.uuid];
}
};