WIP: Upgrade to THREE.r155: Remove the legacy/physical lighting distinction
This commit is contained in:
parent
487573424c
commit
e153c4cbbb
3 changed files with 2 additions and 19 deletions
|
@ -1,7 +1,7 @@
|
|||
import type {FC} from 'react'
|
||||
import React, {useLayoutEffect, useMemo, useRef, useState} from 'react'
|
||||
import type {Editable} from '../../main/store'
|
||||
import {createPortal} from '@react-three/fiber'
|
||||
import {createPortal, invalidate} from '@react-three/fiber'
|
||||
import EditableProxy from './EditableProxy'
|
||||
import type {OrbitControls} from 'three-stdlib'
|
||||
import TransformControls from './TransformControls'
|
||||
|
@ -186,6 +186,7 @@ const ProxyManager: FC<ProxyManagerProps> = ({orbitControlsRef}) => {
|
|||
mesh.material = renderMaterials[mesh.id]
|
||||
}
|
||||
}
|
||||
invalidate()
|
||||
})
|
||||
}, [viewportShading, renderMaterials, sceneProxy])
|
||||
|
||||
|
|
|
@ -54,16 +54,6 @@ const EditorScene: React.FC<{snapshotEditorSheet: ISheet; paneId: string}> = ({
|
|||
|
||||
const editorObject = getEditorSheetObject()
|
||||
|
||||
const viewportLighting =
|
||||
useVal(editorObject?.props.viewport.lighting) ?? 'physical'
|
||||
|
||||
useEffect(() => {
|
||||
if (gl && scene && camera) {
|
||||
gl.physicallyCorrectLights = viewportLighting === 'physical'
|
||||
gl.compile(scene, camera)
|
||||
}
|
||||
}, [gl, viewportLighting, scene, camera])
|
||||
|
||||
const helpersRoot = useExtensionStore((state) => state.helpersRoot, shallow)
|
||||
|
||||
const showGrid = useVal(editorObject?.props.viewport.showGrid) ?? true
|
||||
|
|
|
@ -31,14 +31,6 @@ const editorSheetObjectConfig = {
|
|||
},
|
||||
{as: 'menu', label: 'Reference Window'},
|
||||
),
|
||||
lighting: types.stringLiteral(
|
||||
'physical',
|
||||
{
|
||||
physical: 'Physical',
|
||||
legacy: 'Legacy',
|
||||
},
|
||||
{as: 'menu', label: 'Lighting'},
|
||||
),
|
||||
},
|
||||
{label: 'Viewport Config'},
|
||||
),
|
||||
|
|
Loading…
Reference in a new issue