refactor(paint-slots): share scene IBL as viewer SceneEnvironment

Replace the editor-only EditorEnvironment wrapper with a SceneEnvironment
component exported from @pascal-app/viewer, mounted as an opt-in <Viewer>
child (still not baked into the Viewer component). One source of truth the
editor and the community public viewer both inject; embed/thumbnail
surfaces simply don't mount it. Sunset preset at environmentIntensity 0.6.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Wassim SAMAD
2026-06-17 14:49:35 -04:00
co-authored by Claude Opus 4.8
parent 37c56788f3
commit 4818807360
4 changed files with 31 additions and 23 deletions
@@ -0,0 +1,22 @@
'use client'
import { Environment } from '@react-three/drei'
import { Suspense } from 'react'
/**
* Scene IBL — drei's prefiltered environment map, exported as an opt-in
* <Viewer> *child* rather than baked into the Viewer component, so embed /
* thumbnail surfaces that don't want the HDRI fetch simply don't mount it.
* 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. Only visible in `rendered`
* shading.
*/
export function SceneEnvironment() {
return (
<Suspense fallback={null}>
<Environment preset="sunset" environmentIntensity={0.6} />
</Suspense>
)
}