Skip to content

Upgrade SDFGI to HDDAGI#119869

Open
OrangeeZ wants to merge 11 commits into
godotengine:masterfrom
OrangeeZ:gi-hdda
Open

Upgrade SDFGI to HDDAGI#119869
OrangeeZ wants to merge 11 commits into
godotengine:masterfrom
OrangeeZ:gi-hdda

Conversation

@OrangeeZ
Copy link
Copy Markdown

@OrangeeZ OrangeeZ commented May 29, 2026

What problem(s) does this PR solve?

This PR is a rebase of HDDA GI from #86267 . It includes changes suggested by the reviewers at the time.

TODO:

  • There are three errors when engine tries to release invalid rid's for three render buffer that HDDA GI uses. It looks like Godot changes screen resolution on startup and these buffers inside p_render_buffers get invalidated, but I don't understand why those references persist.
  • Under DX12, probe occlusion works incorrectly. It looks correct under Vulkan.
  • Linux + mono tests fail with

    scons: *** [/home/runner/work/godot-pineapple/godot-pineapple/godot-cpp/bin/libgodot-cpp.linux.template_debug.dev.x86_64.a] sh: Argument list too long

  • Linux + X11 + RADV: message spam at startup

    ERROR: Non-compute shaders can't be used in compute pipelines
    at: compute_pipeline_create (servers/rendering/rendering_device.cpp:5025)

  • Sudden area brightness changes when using 50% or 70% height. Easy to reproduce if standing close to a wall and looking up and down (is it a bug? Did SDFGI have this problem?)
  • When a probe is selected in "Display Advanced" clicking anywhere else clears selection, but pressing escape does not and the probe remains selected and displays occlusion state.

If this PR is of any interest, hopefully someone can help me with those issues. Any suggestions are appreciated,
I tested the new GI in editor and play in editor under Windows, but I can't check Linux/Mac, so maybe someone running those OS'es can help.

reduz and others added 6 commits May 28, 2026 16:17
Supersedes godotengine#86007

This is a new global illumination system that is a full upgrade to SDFGI
Key advantages are:

* Significantly faster base frame time.
* An order of magnitude faster updates (SDFGI drops frames very significantly when moving, as a consequence of having to redo its entire SDF even for a small motion).
* Higher quality (less light leaks, properly energy conservation, much better reflections, others)
* Occlusion remains the same as in SDFGI. I experimented with other systems (the one in DDGI) but everything has worse tradeoffs.

It is meant as a drop-in replacement, so games using SDFGI should get HDDAGI transparently.

TODO:

- [ ] For some reason gets DEVICE LOST on Intel GPUs. Can´t figure out why.
- [ ] Waiting for a PR fixing the normal buffer precision in order to fix some issues.

TODO AFTER MERGING:

- [ ] High density probes support.
- [ ] Dynamic objects support.

Known issues:

Fixes to divergent control flow on Intel.

Restore the Y Scale as a cascade layout setting.
Fixed Volumetric Fog

Moved some of the code back where it moved previously. Restored Dynamic GI options in Environment. Fixed non-VRS option selection in shader variant generaton
@OrangeeZ OrangeeZ requested review from a team as code owners May 29, 2026 12:08
@AThousandShips

This comment was marked as resolved.

@AThousandShips AThousandShips added this to the 4.x milestone May 29, 2026
@AThousandShips AThousandShips changed the title Gi hdda Upgrade SDFGI to HDDAGI May 29, 2026
@OrangeeZ

This comment was marked as resolved.

@AThousandShips

This comment was marked as resolved.

@JekSun97

This comment was marked as resolved.

@AThousandShips

This comment was marked as resolved.

@hsvfan-jan

This comment was marked as resolved.

@AThousandShips

This comment was marked as resolved.

@DeanLemans

This comment was marked as off-topic.

@clayjohn
Copy link
Copy Markdown
Member

@DeanLemans Please don't hop into the comments just to be argumentative. Stay on topic so that the PR can actually move forward

@MopanionStudios
Copy link
Copy Markdown

Wonderful job thus far, though I would recommend changing the dynamic_gi_enabled bool to be a group enable rather than in the dropdown for Dynamic GI in the world environment, just for uniformities sake.

Other effects such as SSR, SSAO, and SSIL as you can see have the toggle embedded next to the name, which makes it easier to see if its on or not and to toggle it. Right now, you need to open the dropdown to toggle the enabled value for Dynamic GI.
image
image

@Shinwoh
Copy link
Copy Markdown

Shinwoh commented May 31, 2026

Hello, I'm sharing this just in case it's useful, because their GI solution looks very similar to HDDAGI, as they use HDDA too
https://media.gdcvault.com/gdc2023/Slides/HSGI+Cross-Platform_Jiaxuan_Zhang.pdf
I'm talking about the mobile version though, idk about graphics but hopefully something could help solve the artifacts HDDAGI has, like light leaking

@MopanionStudios
Copy link
Copy Markdown

iirc, one of Juan's ideas was to add a screen-space buffer for occlusion to help with light leaking.

@PR3C14D0

This comment was marked as off-topic.

@Image-unavailable
Copy link
Copy Markdown
Contributor

Quick testing on Linux X11 RADV, it seems to be working fine.

immagine

However, there is some amount of spam of these errors at startup:

ERROR: Non-compute shaders can't be used in compute pipelines
   at: compute_pipeline_create (servers/rendering/rendering_device.cpp:5025)

@OrangeeZ
Copy link
Copy Markdown
Author

OrangeeZ commented Jun 1, 2026

Hi @Image-unavailable , I can't reproduce this spam at least on Windows with Vulkan. Can you send me a minimal repro project or just the project you were testing on if it's not too large?

@Image-unavailable
Copy link
Copy Markdown
Contributor

I tested with this project: #74965

I have verified that downloading the zip and extracting it, then opening with this PR, results in the error spam.

There's other warnings that get spammed when doing this, but those are related to some things being broken in the project files, and not the error spam.

Comment thread doc/classes/Vector2i.xml Outdated
Comment on lines +232 to +237
<operator name="operator &amp;">
<return type="Vector2i" />
<param index="0" name="right" type="Vector2i" />
<description>
</description>
</operator>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new Vector2i/Vector3i operators should be documented.

@passivestar
Copy link
Copy Markdown
Contributor

There's noticeable light popping when the camera moves but it probably shouldn't be an obstacle to this PR because it's an improvement over SDFGI and it can be iterated on post-merge

Maybe it would be interesting in the future to consider the possibility of quarter-height cascades (indoor genres like corridor fps dont have much verticality) and maybe a view bias slider to sample closer to camera to mitigate leaks (unity APV has it and it seems to help, the current normal bias gives splotches on normal-mapped surfaces no matter what you set it to)

@Saul2022
Copy link
Copy Markdown

Saul2022 commented Jun 3, 2026

For context of what passivestar said , this is with full resolution and max sethings. It still can be merged as it's indeed much better than sdfgi, but those high density cascades should be able to help ( I HOPE SO )

Screen_Recording_20260531_113808.1.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.