You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am still uncertain if the significant jank on load is a result of this issue or if it's just that SpotLight and useDepthBuffer being expensive to render.
I don't know enough about this topic yet, it seems like an adjustment has to be made in useDepthBuffer.ts and useFBO.tsx which it relies on to return a depthFBO to render inside the useFrame of useDepthBuffer.ts. Maybe code to convert the sRGB encoded texture into linear-sRGB, still - I don't know where the sRGB texture is coming from in the first place. It might have something to do with the recent change to legacy color management (if it is active in this version of three-fiber & three yet)
The text was updated successfully, but these errors were encountered:
felixgren
changed the title
useDepthBuffer with SpotLight causes sRGB texture error & significant jank on load
useDepthBuffer with SpotLight causes sRGB texture error & slow load
May 3, 2022
three
version: 0.137.5@react-three/fiber
version: 7.0.26@react-three/drei
version: 8.8.3node
version: 16.13.1npm
(oryarn
) version: 8.1.2Problem description:
When providing SpotLight with a depth-buffer from useDepthBuffer, an error occurs and significant jank on load is experienced.
On load we see
THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.
On on every frame of the depth-buffer we see
[.WebGL-0x26c082d7000] GL_INVALID_OPERATION: Feedback loop formed between Framebuffer and active Texture.
This issue can also be seen in the example in docs for volumetric lightning,
CodeSandbox w/ code
CodeSandbox no code
I am still uncertain if the significant jank on load is a result of this issue or if it's just that SpotLight and useDepthBuffer being expensive to render.
Relevant code:
Suggested solution:
I don't know enough about this topic yet, it seems like an adjustment has to be made in
useDepthBuffer.ts
anduseFBO.tsx
which it relies on to return a depthFBO to render inside the useFrame ofuseDepthBuffer.ts
. Maybe code to convert the sRGB encoded texture into linear-sRGB, still - I don't know where the sRGB texture is coming from in the first place. It might have something to do with the recent change to legacy color management (if it is active in this version of three-fiber & three yet)The text was updated successfully, but these errors were encountered: