Skip to content

Conversation

@mrdoob
Copy link
Owner

@mrdoob mrdoob commented Nov 19, 2025

Description

This PR improves the accuracy of the GGX VNDF filtering in PMREMGenerator to better match standard PBR implementations like Blender by tuning the blurStrength scaling factor to 0.0 + targetRoughness * 1.25.

Reasoning

We sample from the previous mip level to maintain high performance (~10ms generation time). However, this introduces implicit blur from the downsampling and bilinear interpolation. The adjusted blurStrength factor compensates for this by reducing the applied roughness at lower LODs, preventing the "over-blurring" issue at low roughness values while ensuring the higher roughness levels converge correctly.

Before After Blender
Screenshot 2025-11-19 at 18 47 16 Screenshot 2025-11-19 at 18 47 21 Screenshot 2025-11-19 at 19 05 17

The middle column is still too crisp but overall is much better.

Note: Need to find a easier way to make renders with the same camera than the three.js scene 😅

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

github-actions bot commented Nov 19, 2025

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 356.18
86.47
356.18
86.47
-1 B
-2 B
WebGPU 616.43
173.08
616.42
173.08
-1 B
-1 B
WebGPU Nodes 615.03
172.83
615.03
172.83
-1 B
-1 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 488.05
121.29
488.05
121.29
-1 B
-1 B
WebGPU 688.66
188.99
688.66
188.99
-1 B
-1 B
WebGPU Nodes 630.38
172.22
630.38
172.22
-1 B
+0 B

@mrdoob mrdoob merged commit 0fff585 into dev Nov 19, 2025
10 checks passed
@mrdoob mrdoob deleted the pmrem-tweak branch November 19, 2025 10:58
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