Skip to content

Conversation

@mrdoob
Copy link
Owner

@mrdoob mrdoob commented Nov 4, 2025

Description

This PR replaces the fixed grid PCF shadow sampling with Vogel disk sampling for improved shadow quality and performance.

Changes

  • Implements Vogel disk sampling using the golden angle for evenly distributed sample points
  • Adds interleaved gradient noise for per-pixel rotation to eliminate banding artifacts
  • Reduces sample counts while maintaining/improving quality:
    • Directional/SpotLights: 17 → 12 samples (~29% faster)
    • Point lights: 9 → 8 samples (~11% faster)
Before (Shadow Radius: 1.0) After (Shadow Radius: 1.0)
Screenshot 2025-11-04 at 22 56 00 Screenshot 2025-11-04 at 22 56 07
Before (Shadow Radius: 10.0) After (Shadow Radius: 10.0)
Screenshot 2025-11-04 at 22 54 21 Screenshot 2025-11-04 at 22 54 31

This improvement probably makes SHADOWMAP_TYPE_PCF_SOFT redundant.

@mrdoob mrdoob added this to the r182 milestone Nov 4, 2025
@github-actions
Copy link

github-actions bot commented Nov 4, 2025

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 355.14
86.33
355.6
86.58
+456 B
+251 B
WebGPU 609.62
170.99
609.62
170.99
+0 B
+0 B
WebGPU Nodes 608.23
170.72
608.23
170.72
+0 B
+0 B

🌳 Bundle size after tree-shaking

Minimal build including a renderer, camera, empty scene, and dependencies.

Before After Diff
WebGL 486.77
121.07
487.22
121.32
+456 B
+247 B
WebGPU 678.47
186.28
678.47
186.28
+0 B
+0 B
WebGPU Nodes 620.47
169.54
620.47
169.54
+0 B
+0 B

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants