Preload component uses a cube camera to render the scene in a useLayoutEffect in an attempt to increase performance as objects enter the frustum. This can interfere with existing cameras, and also does not eliminate choppiness as these objects are uploaded to the video card.
Relevant code:
Here is the code before, line 28:
// Now compile the scene
gl.compile(scene || dScene, camera || dCamera)
// And for good measure, hit it with a cube camera
const cubeRenderTarget = new WebGLCubeRenderTarget(128)
const cubeCamera = new CubeCamera(0.01, 100000, cubeRenderTarget)
cubeCamera.update(gl, (scene || dScene) as Scene)
cubeRenderTarget.dispose()
// Flips these objects back
Suggested solution:
// Now compile the scene
gl.render(scene || dScene, camera || dCamera)
three
version: ^0.164.1@react-three/fiber
version: ^8.16.3@react-three/drei
version: ^9.105.5node
version: 20.11.0npm
(oryarn
) version: 10.2.4Problem description:
Preload component uses a cube camera to render the scene in a useLayoutEffect in an attempt to increase performance as objects enter the frustum. This can interfere with existing cameras, and also does not eliminate choppiness as these objects are uploaded to the video card.
Relevant code:
Here is the code before, line 28:
Suggested solution: