Albedo color is always black

I am using Babylon v6.2.0, I tried changing the color of my mesh, but it always turns black for some reason. What am I doing wrong here?

Code:

 const model = await SceneLoader.ImportMeshAsync(
          "",
          fileURL,
          fileName,
          scene,
          undefined,
          ".glb"
        );
  const test = model.meshes.filter((mesh) => {
      return mesh.id === "ColorMesh";
    })[0];

    const colorMesh = new PBRMaterial("colorMesh", scene);
    colorMesh.albedoColor = Color3.FromHexString(
         "#FFFFFF"
    );

   test.material = colorMesh;

It feels you need HDR Environment, but I am not expert:

2 Likes

@freetoplay If you want more help, it would be great if you can provide a playground so that we can see what you are doing and help you fix the code. The mesh being black could a number of reasons from no lights to black vertex colors to fully occluded ambient occlusion values.

try this

colorMesh.metallic = 0;
colorMesh.roughness= 1;