From cf46a4af1ee2d7f553a3641ba257dd4b4d450359 Mon Sep 17 00:00:00 2001 From: syuilo <4439005+syuilo@users.noreply.github.com> Date: Wed, 15 Apr 2026 09:17:11 +0900 Subject: [PATCH] scale intensity --- packages/frontend/src/utility/room/objects/allInOnePc.ts | 4 ++-- packages/frontend/src/utility/room/objects/beamLamp.ts | 4 ++-- packages/frontend/src/utility/room/objects/desktopPc.ts | 6 +++--- packages/frontend/src/utility/room/objects/laptopPc.ts | 6 +++--- packages/frontend/src/utility/room/objects/lavaLamp.ts | 4 ++-- .../src/utility/room/objects/tabletopDigitalClock.ts | 4 ++-- packages/frontend/src/utility/room/objects/tv.ts | 4 ++-- .../frontend/src/utility/room/objects/woodRingFloorLamp.ts | 4 ++-- .../src/utility/room/objects/woodRingsPendantLight.ts | 2 +- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/packages/frontend/src/utility/room/objects/allInOnePc.ts b/packages/frontend/src/utility/room/objects/allInOnePc.ts index 47c167c3c3..956353248a 100644 --- a/packages/frontend/src/utility/room/objects/allInOnePc.ts +++ b/packages/frontend/src/utility/room/objects/allInOnePc.ts @@ -4,7 +4,7 @@ */ import * as BABYLON from '@babylonjs/core'; -import { defineObject } from '../engine.js'; +import { defineObject, WORLD_SCALE } from '../engine.js'; import { cm, createPlaneUvMapper } from '../utility.js'; export const allInOnePc = defineObject({ @@ -107,7 +107,7 @@ export const allInOnePc = defineObject({ const applyScreenBrightness = () => { const b = options.screenBrightness; screenMaterial.emissiveColor = new BABYLON.Color3(b, b, b); - light.intensity = 50000 * b; + light.intensity = (5 * b) * WORLD_SCALE * WORLD_SCALE; }; applyScreenBrightness(); diff --git a/packages/frontend/src/utility/room/objects/beamLamp.ts b/packages/frontend/src/utility/room/objects/beamLamp.ts index 63ecd38f07..baca974372 100644 --- a/packages/frontend/src/utility/room/objects/beamLamp.ts +++ b/packages/frontend/src/utility/room/objects/beamLamp.ts @@ -4,7 +4,7 @@ */ import * as BABYLON from '@babylonjs/core'; -import { defineObject } from '../engine.js'; +import { defineObject, WORLD_SCALE } from '../engine.js'; import { cm } from '../utility.js'; export const beamLamp = defineObject({ @@ -22,7 +22,7 @@ export const beamLamp = defineObject({ const light = new BABYLON.PointLight('beamLampLight', new BABYLON.Vector3(0, cm(10), 0), scene, room?.lightContainer != null); light.parent = root; light.diffuse = new BABYLON.Color3(1.0, 0.5, 0.2); - light.intensity = 300; + light.intensity = 0.03 * WORLD_SCALE * WORLD_SCALE; light.range = cm(100); if (room?.lightContainer != null) room.lightContainer.addLight(light); }, diff --git a/packages/frontend/src/utility/room/objects/desktopPc.ts b/packages/frontend/src/utility/room/objects/desktopPc.ts index e725c8b9e5..dd6c82ec3d 100644 --- a/packages/frontend/src/utility/room/objects/desktopPc.ts +++ b/packages/frontend/src/utility/room/objects/desktopPc.ts @@ -4,7 +4,7 @@ */ import * as BABYLON from '@babylonjs/core'; -import { defineObject } from '../engine.js'; +import { defineObject, WORLD_SCALE } from '../engine.js'; import { cm } from '../utility.js'; export const desktopPc = defineObject({ @@ -50,13 +50,13 @@ export const desktopPc = defineObject({ createInstance: ({ options, model, root, scene, room }) => { const light1 = new BABYLON.SpotLight('', new BABYLON.Vector3(0, cm(10), cm(22)), new BABYLON.Vector3(0, 0, 1), Math.PI / 1, 2, scene, room?.lightContainer != null); light1.parent = root; - light1.intensity = 500; + light1.intensity = 0.05 * WORLD_SCALE * WORLD_SCALE; light1.range = cm(30); if (room?.lightContainer != null) room.lightContainer.addLight(light1); const light2 = new BABYLON.SpotLight('', new BABYLON.Vector3(cm(-5), cm(33), cm(-9)), new BABYLON.Vector3(1, 0, 0), Math.PI / 1, 2, scene, room?.lightContainer != null); light2.parent = root; - light2.intensity = 500; + light2.intensity = 0.05 * WORLD_SCALE * WORLD_SCALE; light2.range = cm(30); if (room?.lightContainer != null) room.lightContainer.addLight(light2); diff --git a/packages/frontend/src/utility/room/objects/laptopPc.ts b/packages/frontend/src/utility/room/objects/laptopPc.ts index 37fcbc6b02..02a0a38172 100644 --- a/packages/frontend/src/utility/room/objects/laptopPc.ts +++ b/packages/frontend/src/utility/room/objects/laptopPc.ts @@ -4,7 +4,7 @@ */ import * as BABYLON from '@babylonjs/core'; -import { defineObject } from '../engine.js'; +import { defineObject, WORLD_SCALE } from '../engine.js'; import { cm, createPlaneUvMapper } from '../utility.js'; export const laptopPc = defineObject({ @@ -117,7 +117,7 @@ export const laptopPc = defineObject({ const applyScreenBrightness = () => { const b = options.screenBrightness; screenMaterial.emissiveColor = new BABYLON.Color3(b, b, b); - light.intensity = 20000 * b; + light.intensity = (2 * b) * WORLD_SCALE * WORLD_SCALE; }; applyScreenBrightness(); @@ -142,7 +142,7 @@ export const laptopPc = defineObject({ if (angle <= -Math.PI / 2) { light.intensity = 0; } else { - light.intensity = 20000 * options.screenBrightness; + light.intensity = (2 * options.screenBrightness) * WORLD_SCALE * WORLD_SCALE; } model.updated(); }; diff --git a/packages/frontend/src/utility/room/objects/lavaLamp.ts b/packages/frontend/src/utility/room/objects/lavaLamp.ts index ba59bc611b..7bb5041ba1 100644 --- a/packages/frontend/src/utility/room/objects/lavaLamp.ts +++ b/packages/frontend/src/utility/room/objects/lavaLamp.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ import * as BABYLON from '@babylonjs/core'; -import { defineObject } from '../engine.js'; +import { defineObject, WORLD_SCALE } from '../engine.js'; import { cm } from '../utility.js'; export const lavaLamp = defineObject({ @@ -21,7 +21,7 @@ export const lavaLamp = defineObject({ const light = new BABYLON.PointLight('lavaLampLight', new BABYLON.Vector3(0, cm(11), 0), scene, room?.lightContainer != null); light.parent = root; light.diffuse = new BABYLON.Color3(1.0, 0.5, 0.2); - light.intensity = 300; + light.intensity = 0.03 * WORLD_SCALE * WORLD_SCALE; light.range = cm(100); if (room?.lightContainer != null) room.lightContainer.addLight(light); diff --git a/packages/frontend/src/utility/room/objects/tabletopDigitalClock.ts b/packages/frontend/src/utility/room/objects/tabletopDigitalClock.ts index e9488e31fc..42faf48774 100644 --- a/packages/frontend/src/utility/room/objects/tabletopDigitalClock.ts +++ b/packages/frontend/src/utility/room/objects/tabletopDigitalClock.ts @@ -4,7 +4,7 @@ */ import * as BABYLON from '@babylonjs/core'; -import { defineObject } from '../engine.js'; +import { defineObject, WORLD_SCALE } from '../engine.js'; import { cm, get7segMeshesOfCurrentTime } from '../utility.js'; export const tabletopDigitalClock = defineObject({ @@ -37,7 +37,7 @@ export const tabletopDigitalClock = defineObject({ createInstance: ({ root, room, options, model, scene }) => { const light = new BABYLON.SpotLight('', new BABYLON.Vector3(0, cm(3), cm(1)), new BABYLON.Vector3(0, 0, 1), Math.PI / 1, 2, scene, room?.lightContainer != null); light.parent = root; - light.intensity = 100; + light.intensity = 0.01 * WORLD_SCALE * WORLD_SCALE; light.range = cm(30); if (room?.lightContainer != null) room.lightContainer.addLight(light); diff --git a/packages/frontend/src/utility/room/objects/tv.ts b/packages/frontend/src/utility/room/objects/tv.ts index 62f724d84b..1571516e3a 100644 --- a/packages/frontend/src/utility/room/objects/tv.ts +++ b/packages/frontend/src/utility/room/objects/tv.ts @@ -4,7 +4,7 @@ */ import * as BABYLON from '@babylonjs/core'; -import { defineObject } from '../engine.js'; +import { defineObject, WORLD_SCALE } from '../engine.js'; import { cm, createPlaneUvMapper, initTv } from '../utility.js'; export const tv = defineObject({ @@ -59,7 +59,7 @@ export const tv = defineObject({ const applyScreenBrightness = () => { const b = options.screenBrightness; screenMaterial.emissiveColor = new BABYLON.Color3(b, b, b); - light.intensity = 70000 * b; + light.intensity = (7 * b) * WORLD_SCALE * WORLD_SCALE; }; applyScreenBrightness(); diff --git a/packages/frontend/src/utility/room/objects/woodRingFloorLamp.ts b/packages/frontend/src/utility/room/objects/woodRingFloorLamp.ts index 4f176394f4..56d4bf9233 100644 --- a/packages/frontend/src/utility/room/objects/woodRingFloorLamp.ts +++ b/packages/frontend/src/utility/room/objects/woodRingFloorLamp.ts @@ -4,7 +4,7 @@ */ import * as BABYLON from '@babylonjs/core'; -import { defineObject } from '../engine.js'; +import { defineObject, WORLD_SCALE } from '../engine.js'; import { cm } from '../utility.js'; export const woodRingFloorLamp = defineObject({ @@ -83,7 +83,7 @@ export const woodRingFloorLamp = defineObject({ const applyLightBrightness = () => { for (const light of lights) { - light.intensity = 10000 * options.lightBrightness; + light.intensity = 1 * options.lightBrightness * WORLD_SCALE * WORLD_SCALE; light.range = cm(200) * options.lightBrightness; } for (const lamp of lamps) { diff --git a/packages/frontend/src/utility/room/objects/woodRingsPendantLight.ts b/packages/frontend/src/utility/room/objects/woodRingsPendantLight.ts index 07f127925d..e72e12987f 100644 --- a/packages/frontend/src/utility/room/objects/woodRingsPendantLight.ts +++ b/packages/frontend/src/utility/room/objects/woodRingsPendantLight.ts @@ -87,7 +87,7 @@ export const woodRingsPendantLight = defineObject({ applyLightColor(); const applyLightBrightness = () => { - light.intensity = 10000 * options.lightBrightness; + light.intensity = 1 * options.lightBrightness * WORLD_SCALE * WORLD_SCALE; light.range = cm(200) * options.lightBrightness; const emissive = lamp.material as BABYLON.PBRMaterial; emissive.emissiveIntensity = options.lightBrightness * 10;