This commit is contained in:
2026-05-18 18:53:30 +08:00
parent fb193c0528
commit 840e3d6a55
12 changed files with 907 additions and 68 deletions

View File

@ -786,18 +786,33 @@ export class GameManager extends Monobehiver {
}
// 应用反照率纹理(颜色贴图)
if (options.albedoTexture) {
material.albedoTexture = new Texture(options.albedoTexture);
if (options.albedoTexture !== undefined) {
if (options.albedoTexture) {
material.albedoTexture = new Texture(options.albedoTexture);
} else {
// 传入空字符串或 null 时清空贴图
material.albedoTexture = null;
}
}
// 应用法线贴图
if (options.normalMap) {
material.bumpTexture = new Texture(options.normalMap);
if (options.normalMap !== undefined) {
if (options.normalMap) {
material.bumpTexture = new Texture(options.normalMap);
} else {
// 传入空字符串或 null 时清空贴图
material.bumpTexture = null;
}
}
// 应用金属度贴图
if (options.metallicTexture) {
material.metallicTexture = new Texture(options.metallicTexture);
if (options.metallicTexture !== undefined) {
if (options.metallicTexture) {
material.metallicTexture = new Texture(options.metallicTexture);
} else {
// 传入空字符串或 null 时清空贴图
material.metallicTexture = null;
}
}
// 应用粗糙度值