godotengine / godotengine/godot

BaseMaterial3D clearcoat rendering is broken with material roughness set to 0.0 in Forward+/Mobile

Open
#95,207 3 comments 0 reactions 0 assignees View on GitHub
bug topic:3d topic:rendering
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`
-|-
![Screenshot_20240806_195606 png webp](https://github.com/user-attachments/assets/dd9a19f1-e889-4dcd-baf6-1587e451d2d3) | ![Screenshot_20240806_195618 png webp](https://github.com/user-attachments/assets/764193e7-1fe6-473a-8513-fa663d27c64b)

The issue in action:

https://github.com/user-attachments/assets/8d4ee1e1-8394-4001-9f34-82a0d6f1f124

### Mobile

Roughness = `0.0` | Roughness = `0.01`
-|-
![Screenshot_20240806_195638 png webp](https://github.com/user-attachments/assets/ef9e1a79-1ab5-447f-ba91-0b591df65862) | ![Screenshot_20240806_195653 png webp](https://github.com/user-attachments/assets/81f409b1-5dda-4c8c-882b-8ee0cbc18cf2)

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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.