From 0d966d8dedd670aa9d30a2f09b1b6ed62b6980f2 Mon Sep 17 00:00:00 2001 From: syuilo <4439005+syuilo@users.noreply.github.com> Date: Mon, 6 Apr 2026 21:14:50 +0900 Subject: [PATCH] wip --- packages/frontend/src/utility/room/engine.ts | 7 ++++++- packages/frontend/src/utility/room/objects/allInOnePc.ts | 2 +- packages/frontend/src/utility/room/objects/beamLamp.ts | 2 +- packages/frontend/src/utility/room/objects/laptopPc.ts | 2 +- packages/frontend/src/utility/room/objects/lavaLamp.ts | 2 +- .../frontend/src/utility/room/objects/woodRingFloorLamp.ts | 2 +- 6 files changed, 11 insertions(+), 6 deletions(-) diff --git a/packages/frontend/src/utility/room/engine.ts b/packages/frontend/src/utility/room/engine.ts index 7eccebf03a..5cfe1e007d 100644 --- a/packages/frontend/src/utility/room/engine.ts +++ b/packages/frontend/src/utility/room/engine.ts @@ -1023,6 +1023,7 @@ export class RoomEngine { //if (m.material) (m.material as BABYLON.PBRMaterial).ambientColor = new BABYLON.Color3(1, 1, 1); if (m.material) { (m.material as BABYLON.PBRMaterial).reflectionTexture = this.enableReflectionProbe ? this.reflectionProbe.cubeTexture : this.envMapIndoor; + (m.material as BABYLON.PBRMaterial).useGLTFLightFalloff = true; // Clustered Lightingではphysical falloffを持つマテリアルはアーチファクトが発生する https://doc.babylonjs.com/features/featuresDeepDive/lights/clusteredLighting/#materials-with-a-physical-falloff-may-cause-artefacts } if (this.enableReflectionProbe) this.reflectionProbe.renderList!.push(m); } @@ -1088,9 +1089,11 @@ export class RoomEngine { if (mesh.material instanceof BABYLON.MultiMaterial) { for (const subMat of mesh.material.subMaterials) { (subMat as BABYLON.PBRMaterial).reflectionTexture = this.enableReflectionProbe ? this.reflectionProbe.cubeTexture : this.envMapIndoor; + (subMat as BABYLON.PBRMaterial).useGLTFLightFalloff = true; // Clustered Lightingではphysical falloffを持つマテリアルはアーチファクトが発生する https://doc.babylonjs.com/features/featuresDeepDive/lights/clusteredLighting/#materials-with-a-physical-falloff-may-cause-artefacts } } else { (mesh.material as BABYLON.PBRMaterial).reflectionTexture = this.enableReflectionProbe ? this.reflectionProbe.cubeTexture : this.envMapIndoor; + (mesh.material as BABYLON.PBRMaterial).useGLTFLightFalloff = true; // Clustered Lightingではphysical falloffを持つマテリアルはアーチファクトが発生する https://doc.babylonjs.com/features/featuresDeepDive/lights/clusteredLighting/#materials-with-a-physical-falloff-may-cause-artefacts } } } @@ -1291,7 +1294,7 @@ export class RoomEngine { } private turnOnRoomLight() { - this.roomLight.intensity = 300000; + this.roomLight.intensity = 150000; this.envMapIndoor.level = 0.3; } @@ -1680,9 +1683,11 @@ export class RoomObjectPreviewEngine { if (mesh.material instanceof BABYLON.MultiMaterial) { for (const subMat of mesh.material.subMaterials) { (subMat as BABYLON.PBRMaterial).reflectionTexture = this.envMapIndoor; + (subMat as BABYLON.PBRMaterial).useGLTFLightFalloff = true; // Clustered Lightingではphysical falloffを持つマテリアルはアーチファクトが発生する https://doc.babylonjs.com/features/featuresDeepDive/lights/clusteredLighting/#materials-with-a-physical-falloff-may-cause-artefacts } } else { (mesh.material as BABYLON.PBRMaterial).reflectionTexture = this.envMapIndoor; + (mesh.material as BABYLON.PBRMaterial).useGLTFLightFalloff = true; // Clustered Lightingではphysical falloffを持つマテリアルはアーチファクトが発生する https://doc.babylonjs.com/features/featuresDeepDive/lights/clusteredLighting/#materials-with-a-physical-falloff-may-cause-artefacts } } } diff --git a/packages/frontend/src/utility/room/objects/allInOnePc.ts b/packages/frontend/src/utility/room/objects/allInOnePc.ts index 084633d424..7245da586f 100644 --- a/packages/frontend/src/utility/room/objects/allInOnePc.ts +++ b/packages/frontend/src/utility/room/objects/allInOnePc.ts @@ -50,7 +50,7 @@ export const allInOnePc = defineObject({ const light = new BABYLON.SpotLight('', new BABYLON.Vector3(0/*cm*/, 30/*cm*/ / WORLD_SCALE, 0), new BABYLON.Vector3(0, 0, 1), Math.PI / 1, 2, scene, room?.lightContainer != null); light.parent = model.root; light.diffuse = new BABYLON.Color3(1.0, 1.0, 1.0); - light.range = 999/*cm*/; + light.range = 100/*cm*/; if (room?.lightContainer != null) room.lightContainer.addLight(light); const screenMesh = model.findMesh('__X_SCREEN__'); diff --git a/packages/frontend/src/utility/room/objects/beamLamp.ts b/packages/frontend/src/utility/room/objects/beamLamp.ts index a464c9aa41..172cb37388 100644 --- a/packages/frontend/src/utility/room/objects/beamLamp.ts +++ b/packages/frontend/src/utility/room/objects/beamLamp.ts @@ -21,7 +21,7 @@ export const beamLamp = defineObject({ light.parent = root; light.diffuse = new BABYLON.Color3(1.0, 0.5, 0.2); light.intensity = 300; - light.range = 999/*cm*/; + light.range = 100/*cm*/; if (room?.lightContainer != null) room.lightContainer.addLight(light); }, interactions: {}, diff --git a/packages/frontend/src/utility/room/objects/laptopPc.ts b/packages/frontend/src/utility/room/objects/laptopPc.ts index 68cfadf6bc..9ea294ace6 100644 --- a/packages/frontend/src/utility/room/objects/laptopPc.ts +++ b/packages/frontend/src/utility/room/objects/laptopPc.ts @@ -61,7 +61,7 @@ export const laptopPc = defineObject({ const light = new BABYLON.SpotLight('', new BABYLON.Vector3(0/*cm*/, 10/*cm*/ / WORLD_SCALE, 0), new BABYLON.Vector3(0, 0, 1), Math.PI / 1, 2, scene, room?.lightContainer != null); light.parent = hutaNode; light.diffuse = new BABYLON.Color3(1.0, 1.0, 1.0); - light.range = 999/*cm*/; + light.range = 100/*cm*/; if (room?.lightContainer != null) room.lightContainer.addLight(light); const bodyMaterial = model.findMaterial('__X_BODY__'); diff --git a/packages/frontend/src/utility/room/objects/lavaLamp.ts b/packages/frontend/src/utility/room/objects/lavaLamp.ts index 2c8db37616..72cfd5857a 100644 --- a/packages/frontend/src/utility/room/objects/lavaLamp.ts +++ b/packages/frontend/src/utility/room/objects/lavaLamp.ts @@ -20,7 +20,7 @@ export const lavaLamp = defineObject({ light.parent = root; light.diffuse = new BABYLON.Color3(1.0, 0.5, 0.2); light.intensity = 300; - light.range = 999/*cm*/; + light.range = 100/*cm*/; if (room?.lightContainer != null) room.lightContainer.addLight(light); const sphere = BABYLON.MeshBuilder.CreateSphere('lavaLampLightSphere', { diameter: 4/*cm*/ }, scene); diff --git a/packages/frontend/src/utility/room/objects/woodRingFloorLamp.ts b/packages/frontend/src/utility/room/objects/woodRingFloorLamp.ts index f7f87f9d15..84508bab8e 100644 --- a/packages/frontend/src/utility/room/objects/woodRingFloorLamp.ts +++ b/packages/frontend/src/utility/room/objects/woodRingFloorLamp.ts @@ -51,7 +51,7 @@ export const woodRingFloorLamp = defineObject({ light.parent = lamp; light.diffuse = new BABYLON.Color3(1.0, 0.5, 0.2); light.intensity = 5000; - light.range = 999/*cm*/; + light.range = 100/*cm*/; if (room?.lightContainer != null) room.lightContainer.addLight(light); }