WIP: Upgrade to THREE.r155: Remove the legacy/physical lighting distinction

This commit is contained in:
Aria Minaei 2023-08-05 09:30:16 +02:00
parent 487573424c
commit e153c4cbbb
3 changed files with 2 additions and 19 deletions

View file

@ -1,7 +1,7 @@
import type {FC} from 'react' import type {FC} from 'react'
import React, {useLayoutEffect, useMemo, useRef, useState} from 'react' import React, {useLayoutEffect, useMemo, useRef, useState} from 'react'
import type {Editable} from '../../main/store' import type {Editable} from '../../main/store'
import {createPortal} from '@react-three/fiber' import {createPortal, invalidate} from '@react-three/fiber'
import EditableProxy from './EditableProxy' import EditableProxy from './EditableProxy'
import type {OrbitControls} from 'three-stdlib' import type {OrbitControls} from 'three-stdlib'
import TransformControls from './TransformControls' import TransformControls from './TransformControls'
@ -186,6 +186,7 @@ const ProxyManager: FC<ProxyManagerProps> = ({orbitControlsRef}) => {
mesh.material = renderMaterials[mesh.id] mesh.material = renderMaterials[mesh.id]
} }
} }
invalidate()
}) })
}, [viewportShading, renderMaterials, sceneProxy]) }, [viewportShading, renderMaterials, sceneProxy])

View file

@ -54,16 +54,6 @@ const EditorScene: React.FC<{snapshotEditorSheet: ISheet; paneId: string}> = ({
const editorObject = getEditorSheetObject() 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 helpersRoot = useExtensionStore((state) => state.helpersRoot, shallow)
const showGrid = useVal(editorObject?.props.viewport.showGrid) ?? true const showGrid = useVal(editorObject?.props.viewport.showGrid) ?? true

View file

@ -31,14 +31,6 @@ const editorSheetObjectConfig = {
}, },
{as: 'menu', label: 'Reference Window'}, {as: 'menu', label: 'Reference Window'},
), ),
lighting: types.stringLiteral(
'physical',
{
physical: 'Physical',
legacy: 'Legacy',
},
{as: 'menu', label: 'Lighting'},
),
}, },
{label: 'Viewport Config'}, {label: 'Viewport Config'},
), ),