diff --git a/packages/editor/src/components/editor-environment.tsx b/packages/editor/src/components/editor-environment.tsx new file mode 100644 index 00000000..9e9bf0d4 --- /dev/null +++ b/packages/editor/src/components/editor-environment.tsx @@ -0,0 +1,20 @@ +'use client' + +import { Environment } from '@react-three/drei' +import { Suspense } from 'react' + +/** + * Scene IBL for the editor — drei's prefiltered environment map. Injected as a + * *child* (not baked into the Viewer component) so read-only / embed + * viewers don't pull the HDRI. This is what gives PBR metals their reflections + * and lifts the lighting on vertical surfaces (walls), which flat directional + + * hemisphere lights can't do alone. Intensity is dialled below the preset + * default so it complements the scene lights rather than washing them out. + */ +export function EditorEnvironment() { + return ( + + + + ) +} diff --git a/packages/editor/src/components/editor/index.tsx b/packages/editor/src/components/editor/index.tsx index c6903080..49bd023d 100644 --- a/packages/editor/src/components/editor/index.tsx +++ b/packages/editor/src/components/editor/index.tsx @@ -21,6 +21,7 @@ import { } from '../../lib/scene' import { initSFXBus } from '../../lib/sfx-bus' import useEditor from '../../store/use-editor' +import { EditorEnvironment } from '../editor-environment' import { CeilingSelectionAffordanceSystem } from '../systems/ceiling/ceiling-selection-affordance-system' import { CeilingSystem } from '../systems/ceiling/ceiling-system' import { RoofEditSystem } from '../systems/roof/roof-edit-system' @@ -602,6 +603,7 @@ const ViewerSceneContent = memo(function ViewerSceneContent({ const noEditing = isVersionPreviewMode || isFirstPersonMode || isStudioMode return ( <> + {!(isFirstPersonMode || isStudioMode) && } {!noEditing && } {!noEditing && }