diff --git a/packages/frontend/assets/room/objects/record-player/record-player.blend b/packages/frontend/assets/room/objects/record-player/record-player.blend index be57e777ff..3428cf85c2 100644 Binary files a/packages/frontend/assets/room/objects/record-player/record-player.blend and b/packages/frontend/assets/room/objects/record-player/record-player.blend differ diff --git a/packages/frontend/src/world/room/engine.ts b/packages/frontend/src/world/room/engine.ts index 2ae52fb817..b67f9c7877 100644 --- a/packages/frontend/src/world/room/engine.ts +++ b/packages/frontend/src/world/room/engine.ts @@ -858,8 +858,11 @@ export class RoomEngine extends EventEmitter { this.shadowGeneratorForSunLight?.addShadowCaster(m); //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.envMapIndoor; - //(m.material as BABYLON.PBRMaterial).ambientColor = new BABYLON.Color3(0.5, 0.5, 0.5); + if ((m.material as BABYLON.PBRMaterial).metadata?.disableEnvMap) { + (m.material as BABYLON.PBRMaterial).ambientColor = new BABYLON.Color3(0.5, 0.5, 0.5); + } else { + (m.material as BABYLON.PBRMaterial).reflectionTexture = 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 } } @@ -1426,6 +1429,11 @@ export class RoomEngine extends EventEmitter { if (!forInit) this.sr.disableSnapshotRendering(); // このメソッドは参照カウント方式な点に留意 this.roomLight.intensity = 18 * WORLD_SCALE * WORLD_SCALE; this.envMapIndoor.level = 0.6; + for (const m of this.scene.materials) { + if (m.metadata?.disableEnvMap) { + m.ambientColor = new BABYLON.Color3(0.5, 0.5, 0.5); + } + } if (!forInit) { // workerで実行される可能性がある // eslint-disable-next-line no-restricted-globals @@ -1439,6 +1447,11 @@ export class RoomEngine extends EventEmitter { this.sr.disableSnapshotRendering(); // このメソッドは参照カウント方式な点に留意 this.roomLight.intensity = 0; this.envMapIndoor.level = 0.025; + for (const m of this.scene.materials) { + if (m.metadata?.disableEnvMap) { + m.ambientColor = new BABYLON.Color3(0.025, 0.025, 0.025); + } + } // workerで実行される可能性がある // eslint-disable-next-line no-restricted-globals setTimeout(() => { diff --git a/packages/frontend/src/world/room/heya.ts b/packages/frontend/src/world/room/heya.ts index 731757719e..3598ed2552 100644 --- a/packages/frontend/src/world/room/heya.ts +++ b/packages/frontend/src/world/room/heya.ts @@ -117,6 +117,7 @@ export class SimpleHeyaManager extends HeyaManager { }; const wallMaterial = findMaterial(this.meshes[0], '__WALL__'); + //wallMaterial.metadata.disableEnvMap = true; this.wallMaterials = { n: wallMaterial.clone('wallNMaterial'), s: wallMaterial.clone('wallSMaterial'), @@ -125,6 +126,7 @@ export class SimpleHeyaManager extends HeyaManager { }; const beamMaterial = findMaterial(this.meshes[0], '__BEAM__'); + //beamMaterial.metadata.disableEnvMap = true; this.wallBeamMaterials = { n: beamMaterial.clone('wallNBeamMaterial'), s: beamMaterial.clone('wallSBeamMaterial'), @@ -133,6 +135,7 @@ export class SimpleHeyaManager extends HeyaManager { }; const pillarMaterial = findMaterial(this.meshes[0], '__PILLAR__'); + //pillarMaterial.metadata.disableEnvMap = true; this.pillarMaterials = { nw: pillarMaterial.clone('pillarNWMaterial'), ne: pillarMaterial.clone('pillarNEMaterial'), @@ -155,7 +158,12 @@ export class SimpleHeyaManager extends HeyaManager { } this.ceilingMaterial = findMaterial(this.meshes[0], '__CEILING__'); + //this.ceilingMaterial.metadata.disableEnvMap = true; this.floorMaterial = findMaterial(this.meshes[0], '__FLOOR__'); + //this.floorMaterial.metadata.disableEnvMap = true; + + const baseboardMaterial = findMaterial(this.meshes[0], '__BASEBOARD__'); + //baseboardMaterial.metadata.disableEnvMap = true; await this.applyOptions(options); } diff --git a/packages/frontend/src/world/room/objects/lavaLamp.ts b/packages/frontend/src/world/room/objects/lavaLamp.ts index 26d143872e..b0b368e649 100644 --- a/packages/frontend/src/world/room/objects/lavaLamp.ts +++ b/packages/frontend/src/world/room/objects/lavaLamp.ts @@ -25,15 +25,17 @@ export const lavaLamp = defineObject({ light.range = cm(100); if (room?.lightContainer != null) room.lightContainer.addLight(light); + const mat = new BABYLON.PBRMaterial('lavaLampLightMat', scene); + mat.emissiveColor = new BABYLON.Color3(1.0, 0.5, 0.2); + mat.disableLighting = true; const sphere = BABYLON.MeshBuilder.CreateSphere('lavaLampLightSphere', { diameter: cm(4) }, scene); sphere.parent = root; sphere.position = new BABYLON.Vector3(0, cm(15), 0); - const mat = new BABYLON.StandardMaterial('lavaLampLightMat', scene); - mat.emissiveColor = new BABYLON.Color3(1.0, 0.5, 0.2); - - mat.alpha = 0.5; - //mat.disableLighting = true; sphere.material = mat; + const sphere2 = BABYLON.MeshBuilder.CreateSphere('lavaLampLightSphere2', { diameter: cm(2) }, scene); + sphere2.parent = root; + sphere2.position = new BABYLON.Vector3(0, cm(15), 0); + sphere2.material = mat; const anim = new BABYLON.Animation('lavaLampLightAnim', 'position.y', 60, BABYLON.Animation.ANIMATIONTYPE_FLOAT, BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE); anim.setKeys([ @@ -42,6 +44,8 @@ export const lavaLamp = defineObject({ ]); sphere.animations = [anim]; scene.beginAnimation(sphere, 0, 500, true); + sphere2.animations = [anim]; + scene.beginAnimation(sphere2, 0, 500, true, 0.6); const emitter = new BABYLON.TransformNode('emitter', scene); emitter.parent = root;