Babylonjs学习笔记(五)——创建PBR材质
书接上回,这里讨论PBR材质!!!
// 创建天空盒/* */
const createSkyBox = (scene:Scene):void=>{
const envTex = CubeTexture.CreateFromPrefilteredData('./env/environment.env',scene)
scene.environmentTexture = envTex;
scene.createDefaultSkybox(envTex,true)
}
createSkyBox(scene);
const ball = MeshBuilder.CreateSphere('ball',{diameter:1},scene)
ball.position = new Vector3(0,1,0)
// 创建PRB材质
const ballMat = new PBRMaterial('pbr',scene)
// 赋值
ball.material = ballMat;