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