一、场景环境
(1)使用clearColor更改背景颜色:
scene.clearColor=new BABYLON.Color3(0,1,1)
(2)使用ambientColor更改网格对象颜色
前提是先设置了scene.ambientColor,否则StandardMaterial.ambientColor和StandardMaterial.ambientTexture将不起作用。
scene.ambientColor=new BABYLON.Color3(1,0,0.5)
let spherMaterial=new BABYLON.StandardMaterial('material',scene)
spherMaterial.ambientColor=new BABYLON.Color3(1,0.5,0.5)
spherMaterial.ambientTexture=new BABYLON.Texture(imgURL[6],scene)
sphere.material=spherMaterial
二、天空盒
(1)建议使用
let skybox=BABYLON.Mesh.CreateBox('BOX',1000,scene)
let skyboxMaterial=new BABYLON.StandardMaterial('skyboxmat',scene)
//禁用背面剔除
skyboxMaterial.backFaceCulling=false
//移除光的反射