Skip to content

Conversation

@mrdoob
Copy link
Owner

@mrdoob mrdoob commented Nov 26, 2025

Related issue: #32303

Description

Ports the modernized PCF shadow filtering from WebGLRenderer to WebGPURenderer.

Changes

  • Replace 17-sample grid pattern in PCFShadowFilter with 5-sample Vogel disk distribution
  • Replace 9-sample axis-aligned pattern in PointShadowFilter with 5-sample Vogel disk in tangent space
  • Use Interleaved Gradient Noise (IGN) to rotate sampling pattern per-pixel, eliminating banding artifacts
  • Add vogelDiskSample TSL function to PostProcessingUtils.js

Benefits

  • Fewer texture samples (5 vs 17/9) with better quality due to optimal disk distribution
  • Combined with hardware PCF (4-tap filtering), effectively 20 filtered taps per pixel
  • Per-pixel IGN rotation breaks up shadow edge banding

(Made using Claude Code with Opus 4.5)

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

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 350.29
83.05
350.29
83.05
+0 B
+0 B
WebGPU 613.1
170.13
613.24
170.24
+141 B
+117 B
WebGPU Nodes 611.7
169.85
611.84
169.96
+141 B
+112 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 482.23
117.82
482.23
117.82
+0 B
+0 B
WebGPU 684.25
185.94
684.39
186.07
+131 B
+125 B
WebGPU Nodes 634.08
173.15
634.21
173.25
+131 B
+107 B

@mrdoob mrdoob merged commit d5f3ee9 into dev Nov 26, 2025
10 checks passed
@mrdoob mrdoob deleted the webgpu-shadowmap branch November 26, 2025 23:52
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.

2 participants