godotengine / godotengine/godot

Mobile: NaN is visible in specular reflections on smooth metallic materials (regression from FP16 optimizations)

Open
#110,207 5 comments 1 reaction 1 assignee Claimed by @Calinou View on GitHub
bug confirmed regression 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/111894.*

### Tested versions

- Reproducible in: 4.5.beta1, 4.5.beta7
- Not reproducible in: 4.4.1.stable, 4.5.dev6

### System information

Godot v4.5.beta (80a219a58) - Fedora Linux 42 (KDE Plasma Desktop Edition) on X11 - X11 display driver, Multi-window, 1 monitor - Vulkan (Mobile) - dedicated NVIDIA GeForce RTX 5090 (nvidia; 575.64.05) - AMD Ryzen 9 9950X3D 16-Core Processor (32 threads) - 62.33 GiB memory

### Issue description

Mobile | Forward+
-|-
Image | Image

Note that the issue above is with the ReflectionProbe visible, but it occurs without the ReflectionProbe too. The NaN is visible as long as you have a DirectionalLight with shadows enabled, and the reflection is seen in a shaded area.

The issue also manifests in specular lobes on materials using per-vertex shading:

Mobile | Mobile (llvmpipe, unaffected by the issue)
-|-
Image | Image

I bisected the regression to https://github.com/godotengine/godot/pull/107119. cc @DarioSamo

### Steps to reproduce

- Add a SphereMesh with StandardMaterial3D that has `roughness = 0.0` and `metallic = 1.0`.
- Use a ProceduralSkyMaterial or PhysicalSkyMaterial with the default DirectionalLight3D properties, and enable shadows.
- Move the sphere to a shaded area and look at the reflection. You may need to resize the viewport or change the camera FOV to make it more visible.

### Minimal reproduction project (MRP)

- [test_specular_nan_mobile.zip](https://github.com/user-attachments/files/22102934/test_specular_nan_mobile.zip)
- [test_lightmapgi_mobile.zip](https://github.com/user-attachments/files/22931963/test_lightmapgi_mobile.zip)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.