修改粗糙金属度

This commit is contained in:
2026-06-04 19:01:53 +08:00
parent bef0bf527b
commit 2abb61104a
10 changed files with 359968 additions and 371 deletions

View File

@ -35,7 +35,7 @@ const init = async (customConfig = {}) => {
const defaultConfig = {
container: document.querySelector('#renderDom'),
modelUrlList: [],
env: { envPath: 'https://cdn.files.zguiy.com/zt/environment.env', intensity: 1.5, rotationY: 0.3, background: false },
env: { envPath: 'https://cdn.files.zguiy.com/zt/environment.env', intensity: 1.2, rotationY: 0.3, background: false },
gizmo: {
position: false,
rotation: false,
@ -362,14 +362,16 @@ const executeEvent2 = async (result, sku) => {
for (const event of result.data.events) {
if (event.event_type === 'change_color') {
const materialName = event.material_name;
console.log('替换模型颜色:', event);
const { color, color_map_url, normal_map_url, metallic, roughness } = event.target_data;
console.log('替换模型颜色:', event.target_data);
kernel.material.apply({
target: materialName,
albedoColor: color,
albedoTexture: color_map_url,
normalMap: normal_map_url,
});
console.log(`百叶模型颜色已替换为 ${color}`);