RAVENFALL (Three.js FPS game) uses 0.181.0 and shadows look decent
RAVENFALL (Three.js FPS game) - 0.182.0 Pixelated Shadows is the exact same code with two lines changed in the importmap, pointing to version 0.182.0 for “three” and “three/addons/”
There is extreme pixelation occurring:
Does anyone know why this happens?
Am I doing something wrong?
The setup is
renderer.shadowMap.enabled = true;
renderer.shadowMap.type = THREE.PCFSoftShadowMap;
...
const sun = new THREE.DirectionalLight(0xffc080, 1.8); // cool moonlight color
sun.position.set(MOON_DIR.x * 100, MOON_DIR.y * 100, MOON_DIR.z * 100);
sun.castShadow = true;
sun.shadow.mapSize.set(4096, 4096);
sun.shadow.intensity = 1;
sun.shadow.normalBias = 0.005;
sun.shadow.bias = -0.0001;
sun.shadow.autoUpdate = true;
sun.shadowCameraVisible = true;
sun.shadow.camera.near = 1;
sun.shadow.camera.far = 300;
...
sun.shadow.camera.left = -SHADOW_CONFIG.FRUSTUM_SIZE_DEFAULT; // 50
sun.shadow.camera.right = SHADOW_CONFIG.FRUSTUM_SIZE_DEFAULT;
sun.shadow.camera.top = SHADOW_CONFIG.FRUSTUM_SIZE_DEFAULT;
sun.shadow.camera.bottom = -SHADOW_CONFIG.FRUSTUM_SIZE_DEFAULT;
sun.shadow.camera.zoom = 0.5; // it's not from this, I tried changing/removing
sun.shadow.camera.updateProjectionMatrix();
...
function render() {
...
updateSunShadow(dt); // to move the shadow dynamically with the camera
updateShadowFrustum();
...
}
Thanks in advance!

