fix: resolve Pascal HDR assets under base path
This commit is contained in:
parent
62a6a4a7f0
commit
07ae16d0ed
@ -23,6 +23,7 @@ import { ViewerZoneSystem } from '../../components/viewer-zone-system'
|
|||||||
import { type SaveStatus, useAutoSave } from '../../hooks/use-auto-save'
|
import { type SaveStatus, useAutoSave } from '../../hooks/use-auto-save'
|
||||||
import { useKeyboard } from '../../hooks/use-keyboard'
|
import { useKeyboard } from '../../hooks/use-keyboard'
|
||||||
import { type ActivePaintMaterial, hasActivePaintMaterial } from '../../lib/material-paint'
|
import { type ActivePaintMaterial, hasActivePaintMaterial } from '../../lib/material-paint'
|
||||||
|
import { withEditorBasePath } from '../../lib/public-asset-path'
|
||||||
import {
|
import {
|
||||||
applySceneGraphToEditor,
|
applySceneGraphToEditor,
|
||||||
loadSceneFromLocalStorage,
|
loadSceneFromLocalStorage,
|
||||||
@ -738,7 +739,7 @@ const ViewerSceneContent = memo(function ViewerSceneContent({
|
|||||||
const noEditing = isVersionPreviewMode || isFirstPersonMode || isStudioMode || isCaptureMode
|
const noEditing = isVersionPreviewMode || isFirstPersonMode || isStudioMode || isCaptureMode
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<SceneEnvironment />
|
<SceneEnvironment files={withEditorBasePath('/hdri/venice_sunset_1k.hdr')} />
|
||||||
{!(isFirstPersonMode || isStudioMode || isCaptureMode) && <SelectionManager />}
|
{!(isFirstPersonMode || isStudioMode || isCaptureMode) && <SelectionManager />}
|
||||||
{!noEditing && <BoxSelectTool />}
|
{!noEditing && <BoxSelectTool />}
|
||||||
{!noEditing && <NodeArrowHandles />}
|
{!noEditing && <NodeArrowHandles />}
|
||||||
|
|||||||
@ -15,13 +15,13 @@ import { Suspense } from 'react'
|
|||||||
*
|
*
|
||||||
* The HDR is self-hosted (drei's `preset="sunset"` resolves to the same
|
* The HDR is self-hosted (drei's `preset="sunset"` resolves to the same
|
||||||
* `venice_sunset_1k.hdr` on raw.githack.com, which intermittently fails).
|
* `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
|
* Every app that mounts this must ship the file in its own `public/hdri/` and
|
||||||
* own `public/hdri/`.
|
* 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 (
|
return (
|
||||||
<Suspense fallback={null}>
|
<Suspense fallback={null}>
|
||||||
<Environment environmentIntensity={0.6} files="/hdri/venice_sunset_1k.hdr" />
|
<Environment environmentIntensity={0.6} files={files} />
|
||||||
</Suspense>
|
</Suspense>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user