-
Notifications
You must be signed in to change notification settings - Fork 789
Open
Labels
bugSomething isn't workingSomething isn't working
Description
threeversion: 0.182.0 (works on 0.181.0)@react-three/fiberversion: 9.4.2@react-three/dreiversion: 10.7.7nodeversion: 24.10.0npm(oryarn) version: npm 11.6.4
Problem description:
<SoftShadows /> throws shader compilation errors with three.js r182.
three.js r182 modernized shadow mapping (PRs #32181, #32303, #32407, #32443), switching from RGBA-packed depth to native depth textures. The unpackRGBAToDepth() function was removed from the shader chunks as a result.
drei's PCSS shader still calls unpackRGBAToDepth() to sample shadow maps:
THREE.WebGLProgram: Shader Error 0 - VALIDATE_STATUS false
Material Type: MeshStandardMaterial
FRAGMENT
ERROR: 0:1304: 'unpackRGBAToDepth' : no matching overloaded function found
Relevant code:
import { SoftShadows } from '@react-three/drei'
<Canvas shadows>
<SoftShadows />
{/* any scene with shadows */}
</Canvas>The problematic code is in src/core/softShadows.tsx , which injects:
depth = unpackRGBAToDepth( texture2D( shadowMap, uv + offset));Suggested solution:
Update the PCSS shader to sample depth textures directly:
depth = texture2D(shadowMap, uv + offset).r;tung-eh, bastibuck, mikkamikka, TimKraemer, elduderinow and 1 more
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working