godotengine / godotengine/godot
BaseMaterial3D clearcoat rendering is broken with material roughness set to 0.0 in Forward+/Mobile
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
- *Related to https://github.com/godotengine/godot/issues/83223.*
### Tested versions
- Reproducible in: 4.0.stable, 4.1.4.stable, 4.2.2.stable, 4.3.rc e343dbbcc
### System information
Godot v4.3.rc (e343dbbcc) - Fedora Linux 40 (KDE Plasma) - X11 - GLES3 (Compatibility) - NVIDIA GeForce RTX 4090 (nvidia; 555.58.02) - 13th Gen Intel(R) Core(TM) i9-13900K (32 Threads)
### Issue description
Clearcoat rendering is broken with material roughness set to 0.0 in Forward+/Mobile. Specular lobes from all light types will regularly disappear in an artifact-like pattern. This does not occur with roughness set to 0.01 or greater.
The artifacts also look different in Forward+ compared to Mobile. They depend on viewport resolution and camera distance/rotation either way, as seen in the videos below:
### Forward+
Roughness = `0.0` | Roughness = `0.01`
-|-
 | 
The issue in action:
https://github.com/user-attachments/assets/8d4ee1e1-8394-4001-9f34-82a0d6f1f124
### Mobile
Roughness = `0.0` | Roughness = `0.01`
-|-
 | 
The issue in action:
https://github.com/user-attachments/assets/23e698ff-10ad-4edd-89a3-f23115c05b02
### Steps to reproduce
- Create a MeshInstance3D with a SphereMesh. Add a StandardMaterial3D, set its Roughness to 0.0 and Metallic to 1.0. Enable **Clearcoat**.
- Move around the camera in the 3D editor. Try resizing the 3D editor viewport as well.
- At some point, specular lobes from the clearcoat will disappear.
### Minimal reproduction project (MRP)
[test_clearcoat_roughness_zero.zip](https://github.com/user-attachments/files/16514088/test_clearcoat_roughness_zero.zip)
Contributor guide
Research direction
Start with the attached test_clearcoat_roughness_zero.zip minimal reproduction and follow the listed steps in both Forward+ and Mobile. Compare behavior at roughness 0.0 and 0.01 while changing the camera and viewport; done means clearcoat specular lobes no longer disappear or form resolution- and view-dependent artifacts at roughness 0.0.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100