godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.09k stars 21.18k forks source link

Vulkan: Non-directional lights with size > 0 shining on material with zero roughness results in broken specular lobes #65497

Open atirut-w opened 2 years ago

atirut-w commented 2 years ago

Related to https://github.com/godotengine/godot/issues/68464.

Godot version

v4.0.alpha16.official [86dd3f312]

System information

Arch Linux, Vulkan Clustered, Nvidia 1660(Nvidia open driver 515.65.01-11)

Issue description

Screenshot_20220908_025531

Note: issue is more visible when the camera is close to the specular lobes.

Steps to reproduce

  1. Add a mesh and assign it a material with zero roughness. Currently only tested with a sphere.
  2. Add an omnilight with size > 0 and shine it on the mesh

Minimal reproduction project

Lighting problem.zip

Calinou commented 2 years ago

There's likely a NaN or infinite value being generated as a result of a division by zero or something similar in the shader.