Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow scripts to access and manually override reflection probe cubemaps #11266

Open
bluejay-sh opened this issue Nov 30, 2024 · 1 comment
Open

Comments

@bluejay-sh
Copy link

bluejay-sh commented Nov 30, 2024

Describe the project you are working on

Environment lighting

Describe the problem or limitation you are having in your project

Updating reflection probes can be computationally intensive, and using a large number of them can be memory-intensive. I'm building an environment with a good number of interior and exterior spaces that each slot into one of a few archetypes.

It would be extremely useful to be able to precompute two or three reflection maps and share them across probes in correspondence with the environment so that I could save on memory at the expense of accuracy/fidelity.

A parallel issue was raised in #4782:

Currently, when playing a scene, the Reflection Probes bake at initialization, which is noticeable and doesn't make sense since it was previously baked in the editor.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Add an 'override' update mode to reflections probes, as well as getters and setters for reflection probe textures.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Methods reflection_probe_get_texture and reflection_probe_set_texture could be added to RenderingServer and a new update mode REFLECTION_PROBE_UPDATE_OVERRIDE could be added without disrupting existing workflows.

If this enhancement will not be used often, can it be worked around with a few lines of script?

No.

Is there a reason why this should be core and not an add-on in the asset library?

This change would allow scripts and add-ons to address both my issue and the issue cited in feature proposal #4782, and be a first step toward allowing them to address #3045.

@lander-vr
Copy link

lander-vr commented Nov 30, 2024

I think it would make sense to just fully expose a cubemap property to the inspector and allow users to load up a custom cubemap from there, as opposed to only exposing it to scripts. That property would also be accessible through GDScript, so you can switch between different cubemaps dynamically during runtime.

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

No branches or pull requests

3 participants