Babylonjs学习笔记(五)——创建PBR材质

书接上回,这里讨论PBR材质!!!

Babylonjs学习笔记(五)——创建PBR材质_第1张图片

 // 创建天空盒/*  */
 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;

你可能感兴趣的:(javascript,3d)