From 37c56788f3f2915c837f3dade0e730bbba7f362e Mon Sep 17 00:00:00 2001 From: Wassim SAMAD Date: Wed, 17 Jun 2026 14:30:23 -0400 Subject: [PATCH] feat(paint-slots): add drei sunset environment as an editor viewer child Inject an EditorEnvironment wrapper (drei prefiltered sunset HDRI at environmentIntensity 0.6) as a child of the editor Viewer, not baked into the Viewer component, so read-only/embed viewers stay lightweight. This gives PBR metals their reflections and lifts lighting on vertical walls that flat directional + hemisphere lights cannot. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../src/components/editor-environment.tsx | 20 +++++++++++++++++++ .../editor/src/components/editor/index.tsx | 2 ++ 2 files changed, 22 insertions(+) create mode 100644 packages/editor/src/components/editor-environment.tsx 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 && }