godotengine / godot

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

Vulkan: Alpha transparency with GI disabled renders incorrectly when SDFGI is enabled #75848

Open atirut-w opened 1 year ago

atirut-w commented 1 year ago

Godot version

v4.0.2.stable.official [7a0977ce2]

System information

Windows 11, Forward+, AMD Radeon RX 6700 XT

Issue description

I am not very sure how to describe this issue, but things lit by SDFGI seems to be visible through materials with alpha enabled applied onto a mesh instance with GI disabled. See video below.

https://user-images.githubusercontent.com/25323231/230768339-7ac09eec-9779-4ce9-aabd-56d9bea522cf.mp4

Steps to reproduce

  1. Create a mesh instance, disable GI and apply a material with alpha enabled onto it
  2. Put some stuff behind the mesh instance(other meshes, etc.)
  3. Enable SDFGI

Minimal reproduction project

Alpha problem.zip

atirut-w commented 1 year ago

Replicated this issue on my laptop with Intel GPU: image

Calinou commented 1 year ago

I can confirm this on 4.0.1 (Linux, GeForce RTX 4090 with NVIDIA 530.41.03). Enabling MSAA (which forces GI to render in a forward pass) doesn't resolve the issue.

What's interesting is that sorting is correct when using the Dynamic GI mode for the plane, which is supposed to act like Disabled when using SDFGI.

Setting the plane's Sorting Offset to -1.0 with the GI mode set to Disabled also results in this:

image