Skip to content

Conversation

@mrdoob
Copy link
Owner

@mrdoob mrdoob commented Nov 25, 2025

Description

This PR replaces the previous separable blur (latitudinal/longitudinal) in PMREMGenerator with a more efficient spiral blur kernel, and optimizes the internal vertex shader.

Changes

  • Spiral Blur: Implemented a Golden Angle spiral blur shader to provide a better distribution of samples.
  • Split Sigma: Updated _blur to perform two passes with split sigma (sigma / sqrt(2)), effectively doubling the sample density and quality while maintaining high performance.
  • Shader Optimization: Precomputed the outputDirection attribute in JavaScript, removing the faceIndex attribute and the branching getDirection logic from the vertex shader.
  • Cleanup: Removed unused poleAxis parameter, sigmas array, EXTRA_LOD_SIGMA constant, and unnecessary object allocations.

(Made using https://jules.google/ and https://antigravity.google/)

@mrdoob mrdoob added this to the r182 milestone Nov 25, 2025
…rt, function or class

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@github-actions
Copy link

github-actions bot commented Nov 25, 2025

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 350.29
83.05
350.18
82.92
-110 B
-129 B
WebGPU 612.89
170.29
612.89
170.29
+0 B
+0 B
WebGPU Nodes 611.49
170.01
611.49
170.01
+0 B
+0 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.12
117.7
-112 B
-127 B
WebGPU 683.78
186
683.78
186
+0 B
+0 B
WebGPU Nodes 633.61
173.18
633.61
173.18
+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.

2 participants