Skip to content

Conversation

@mrdoob
Copy link
Owner

@mrdoob mrdoob commented Oct 30, 2025

Related issue: #XXXX

Description

Implements energy conservation for clearcoat materials by attenuating the base layer based on clearcoat reflectance, matching Blender and other PBR renderers.

Changes

  • Base layer now correctly attenuated by (1 - clearcoat * Fresnel)
  • Applied to direct lighting, indirect diffuse, and indirect specular

Visual Impact
Materials with clearcoat will appear more physically accurate. High clearcoat values (>0.5) will be darker than before, which is correct - the old implementation was too bright and violated energy conservation.

References

  • Disney BRDF 2015 paper
  • Blender's implementation in gpu_shader_material_principled.glsl
  • glTF KHR_materials_clearcoat specification

@mrdoob mrdoob added this to the r182 milestone Oct 30, 2025
@github-actions
Copy link

github-actions bot commented Oct 30, 2025

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 354.98
86.28
356.5
86.47
+1.52 kB
+188 B
WebGPU 609.42
170.96
609.42
170.96
+0 B
+0 B
WebGPU Nodes 608.02
170.69
608.02
170.69
+0 B
+0 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 486.63
121.03
488.15
121.21
+1.52 kB
+184 B
WebGPU 678.38
186.27
678.38
186.27
+0 B
+0 B
WebGPU Nodes 620.38
169.54
620.38
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.

2 participants