Skip to content

Conversation

@mrdoob
Copy link
Owner

@mrdoob mrdoob commented Oct 22, 2025

Related issue: #32097

Description

Fixes over-darkening of smooth metallic surfaces in occluded areas by gradually disabling specular occlusion for low roughness values (< 0.1). Previously, the specular occlusion formula was too aggressive on mirror-like surfaces, causing them to go black in occluded areas. This is physically incorrect since smooth surfaces have highly directional reflections that are less affected by local geometry occlusion. The fix uses a smoothstep to blend between full specular occlusion (roughness ≥ 0.1) and no occlusion (roughness ≤ 0.01), following Filament's approach. Also clarifies in comments that multi-bounce AO is a diffuse-only effect (the implementation was already correct).

https://raw.githack.com/mrdoob/three.js/multibounce-ao-simple/examples/index.html

@github-actions
Copy link

github-actions bot commented Oct 22, 2025

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 350.11
84.81
350.55
84.96
+437 B
+149 B
WebGPU 604.15
169.43
604.15
169.43
+0 B
+0 B
WebGPU Nodes 602.76
169.19
602.76
169.19
+0 B
+0 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 481.77
119.56
482.21
119.71
+437 B
+150 B
WebGPU 673.57
184.88
673.57
184.88
+0 B
+0 B
WebGPU Nodes 615.56
168.12
615.56
168.12
+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