godotengine / godot

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

Vulkan: GIProbe Reflection does not take sky into account #35107

Open NHodgesVFX opened 4 years ago

NHodgesVFX commented 4 years ago

Godot version: Godot 3.2 Beta 5, Godot 4 Vulkan OS/device including version: Windows 10 64 bit Issue description: When using GIProbe the sky is not taken into account in reflections. This is most visible in metallic chrome surfaces.

Godot 3.2 Beta 5 Godot32_GIProbe_NoSkyInreflections

Godot 4 Godot4_GIProbe_NoSkyInreflections

Steps to reproduce: Add a plane to the scene, add a sphere with a chrome material, and add a GIProbe and bake. Minimal reproduction project: GIProbeSkyReflections.zip

akien-mga commented 4 years ago

That's by design AFAIK, GIProbes are meant for interior scenes, they only take into account what is included in their gizmo. The bigger the gizmo, the more computationally intensive the calculations will be.

I'm not an expert on GIProbes though, so might be worth getting a confirmation from @reduz.

clayjohn commented 4 years ago

@akien-mga when the interior flag is false sky contribution should be used.

clayjohn commented 4 years ago

I can confirm this behaviour. However, I am uncertain whether it is a bug or a limitation in the implementation of GI Probes. I will take a look into it, but I think chances are this is something that won't be fixed for 3.2. 4.0 comes with an entirely new implementation of GI Probes.

Edit: Currently, this is just a limitation of the implementation. Right now sky contribution is not baked into the GIProbe data. It is mixed in at draw time. This means we get accurate sky contributions on primary light bounces, but on secondary bounces, we get no sky contribution. The only way to improve this behaviour would be to rewrite both the baking of the GI Probes and reading from them. Because of how core these changes will be. I will mark it for 4.0.

KoBeWi commented 3 years ago

Was this fixed already in 4.0-dev?

Calinou commented 1 year ago

I can reproduce still this in 4.0.rc2 (the floor in the reflection should appear purple-ish, not gray):

Screenshot_20230220_234610

Minimal reproduction project (4.0): VoxelGISkyReflections.zip