fix: resolve Pascal HDR assets under base path

This commit is contained in:
134 2026-07-13 14:53:45 +08:00
parent 62a6a4a7f0
commit 07ae16d0ed
2 changed files with 6 additions and 5 deletions

View File

@ -23,6 +23,7 @@ import { ViewerZoneSystem } from '../../components/viewer-zone-system'
import { type SaveStatus, useAutoSave } from '../../hooks/use-auto-save'
import { useKeyboard } from '../../hooks/use-keyboard'
import { type ActivePaintMaterial, hasActivePaintMaterial } from '../../lib/material-paint'
import { withEditorBasePath } from '../../lib/public-asset-path'
import {
applySceneGraphToEditor,
loadSceneFromLocalStorage,
@ -738,7 +739,7 @@ const ViewerSceneContent = memo(function ViewerSceneContent({
const noEditing = isVersionPreviewMode || isFirstPersonMode || isStudioMode || isCaptureMode
return (
<>
<SceneEnvironment />
<SceneEnvironment files={withEditorBasePath('/hdri/venice_sunset_1k.hdr')} />
{!(isFirstPersonMode || isStudioMode || isCaptureMode) && <SelectionManager />}
{!noEditing && <BoxSelectTool />}
{!noEditing && <NodeArrowHandles />}

View File

@ -15,13 +15,13 @@ import { Suspense } from 'react'
*
* The HDR is self-hosted (drei's `preset="sunset"` resolves to the same
* `venice_sunset_1k.hdr` on raw.githack.com, which intermittently fails).
* Every app that mounts this — like `/audios/sfx` — must ship the file in its
* own `public/hdri/`.
* Every app that mounts this must ship the file in its own `public/hdri/` and
* pass a base-path-aware URL when it is deployed below the site root.
*/
export function SceneEnvironment() {
export function SceneEnvironment({ files = '/hdri/venice_sunset_1k.hdr' }: { files?: string }) {
return (
<Suspense fallback={null}>
<Environment environmentIntensity={0.6} files="/hdri/venice_sunset_1k.hdr" />
<Environment environmentIntensity={0.6} files={files} />
</Suspense>
)
}