
想简单的设置个背景
import test from '@/assets/test.jpg' scene = new THREE.Scene() const textureLoader = new THREE.TextureLoader() const texture = textureLoader.load(test) scene.background = texture 结果发现图片是半透明的状态/p>
就像这样 https://update.ld160.eu.org/pics/2541717182785_.pic_hd.jpg 左上角是原图,右边是加载的背景
1 IvanLi127 2024-06-01 11:16:41 +08:00 canvas 后面是啥颜色的?看起来不像半透明,只感觉色彩不太好 |
2 alphardex 2024-06-01 14:04:27 +08:00 确实是色彩的问题,新版 three 默认是 SRGB 色彩空间,贴图的 colorSpace 也要对应上,texture.colorSpace = THREE.SRGBColorSpace |