修改更新

This commit is contained in:
xief
2025-05-29 15:53:01 +08:00
parent 16fac2ab19
commit 26f1c60a43
4 changed files with 69 additions and 61 deletions

View File

@@ -167,10 +167,15 @@ export class MaterialEditor
private Material: PhysicalMaterialRecord;
setMaterial(mat: PhysicalMaterialRecord)
{
console.log("set", mat.Material);
this.Material = mat;
this._MeshMaterial.copy(mat.Material);
let mtl = this._MeshMaterial;
console.log("set2", this._MeshMaterial)
this.ShowMesh.material = mtl;
if (mtl.metalness > 0.8)
this.LoadMetalEnv().then(env =>
{
@@ -183,7 +188,7 @@ export class MaterialEditor
mtl.envMap = exr;
mtl.needsUpdate = true;
});
this.ShowMesh.updateWorldMatrix(true,true)
this.Update();
}