Skip to content

Add ReflectionProbe.queue_update() and properties to control time slicing/filter mode#97773

Draft
Calinou wants to merge 1 commit into
godotengine:masterfrom
Calinou:reflectionprobe-add-queue-update-2
Draft

Add ReflectionProbe.queue_update() and properties to control time slicing/filter mode#97773
Calinou wants to merge 1 commit into
godotengine:masterfrom
Calinou:reflectionprobe-add-queue-update-2

Conversation

@Calinou
Copy link
Copy Markdown
Member

@Calinou Calinou commented Oct 3, 2024

I've redone #55929 from scratch following #55929 (comment), which adds many new options to choose from.

This provides much greater control on how and when reflection probes are updated, along with a queue_update() method to force an update even when the reflection probe hasn't been moved.

You can also now change the filter mode independently of the update mode, which allows you to use the real-time filter with the Once update mode (or the high-quality filter with the Always update mode). This is useful to ensure visual consistency when switching between update modes at run-time. The real-time filter allows the reflection to be done updating faster, which also allows the reflection probe to update more smoothly and more quickly when the scene loads.

The Automatic values for Update Slicing and Filter Mode match Godot 4.3 and prior's behavior, so existing scenes should be unaffected by this PR (in terms of performance or quality).

Tested in Forward+ and Mobile, not ported to Compatiblity yet.

Testing project: test_reflection_probe_slicing.zip

Preview

Notice the reflection update rate changing over time (see top-left corner).

Once update mode

update_slicing_once.mp4

Always update mode

update_slicing_always.mp4

TODO

  • Make the Static update mode functional (it currently acts like Once). I've poked at relevant parts of the code and didn't get it to work yet, so help is needed here.
  • Port to Compatibility.
  • Test performance to see the impact of each setting.
  • Fix Once/Static reflections not appearing as smooth as Always when using 6 Faces per Frame update slicing and Real-Time filter mode. (This does not occur with other update slicing modes.)

For future PRs:

  • Temporarily increase update slicing when the scene loads to allow probes to generate faster, leading to less pop-in on scene load (especially when many reflection probes are present). Switch back to the user-specified mode after a few frames.
    • Perhaps also use the Real-Time filter mode temporarily then switch back to the user-specified mode.

…licing/filter mode

TODO:

- Make Static update mode functional (it currently acts like Once).
- Port to Compatibility.
@BastiaanOlij
Copy link
Copy Markdown
Contributor

I need to find time to play with a build of this but just looking at the code, this is a nice way to provide control over reflection probes.

Two enhancements here that might be interesting to consider:

  1. Add an option to pre-bake the reflection probe. So we render the reflection probe in the editor and save it, then used the saved cubemap, instead of rendering it on the first couple of frames.
  2. Add an option to supply an external cubemap to use as the reflection with possibly an option to render objects on top of that. This would be handy in an AR situation where we can get a reflection texture based on the actual environment the user is in.

Another suggestion that came my way that might be nice to take along here (or maybe as a separate PR), we should allow the reflection probe to override the world environment just like we do with cameras, so you can override the sky or background settings and such. That should be fairly easy to implement (I might raise a proposal for that one when I have a moment).

@Calinou
Copy link
Copy Markdown
Member Author

Calinou commented Feb 7, 2025

  1. Add an option to pre-bake the reflection probe. So we render the reflection probe in the editor and save it, then used the saved cubemap, instead of rendering it on the first couple of frames.

See godotengine/godot-proposals#4782.

  1. Add an option to supply an external cubemap to use as the reflection with possibly an option to render objects on top of that. This would be handy in an AR situation where we can get a reflection texture based on the actual environment the user is in.

This is being tracked in godotengine/godot-proposals#11266.

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.

Add a true "Once" ReflectionProbe update mode, rename current "Once" to "When Moved" Reflection probes only refresh on editor restart

2 participants