用envMap并不需要外部光源
let g=new THREE.SphereBufferGeometry(0.2,40,20);
let m=new THREE.MeshStandardMaterial({
envMap:this.env.texture,
});
this._body=new THREE.Mesh(g,m);
this._body.position.y=-2;
this.add(this._body);
这里的this.env是hdr,加载后为renderTarget,所以需要.texture。
同样只使用了环境光用来额外调亮度:
let lights=[];
lights[0]=new THREE.AmbientLight(0xffffff,0.4);
lights[0].position.set(0,0,0);
this.scene.add(...lights);
this.scene.background=this.textures.background;
加光源在低端手机上性能影响比较大,应尽量少。