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

Add use_texture_arrays project setting for ReflectionProbes #4733

Open
Tracked by #66628
clayjohn opened this issue Jun 23, 2022 · 2 comments
Open
Tracked by #66628

Add use_texture_arrays project setting for ReflectionProbes #4733

clayjohn opened this issue Jun 23, 2022 · 2 comments

Comments

@clayjohn
Copy link
Member

clayjohn commented Jun 23, 2022

Describe the project you are working on

Godot rendering

Describe the problem or limitation you are having in your project

Reflections in reflection probes look significantly worse than reflections from the sky. This is because ReflectionProbes always render their filtered environment maps into a mipmapped cubemap. Skies, on the other hand, by default render their filtered environment maps into texture arrays which are then mipmapped, this results in significantly smoother reflections

Current reflection probe

Screenshot from 2022-06-23 14-45-48

Current Sky
Screenshot from 2022-06-23 14-45-54

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

This will allow the quality of rough reflections from reflection probes to match the quality of rough reflections from the sky. Using texture arrays comes with an increased cost as you are shading more pixels during the filtering pass and you have to do additional downsample passes to fill the texture array mipmaps, but the quality increase will be worth it, especially for when using Update Mode Once

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

The false here:
https://github.com/godotengine/godot/blob/2a0393e2226d12f077b90e018a1fe4ca171a5562/servers/rendering/renderer_rd/renderer_scene_render_rd.cpp#L762

Will instead change depending on the value of a new project setting reflection_probe_use_texture_array

After drawing, the array mipmaps need to be filled which can be done with a single function as they are done for skies
https://github.com/godotengine/godot/blob/2a0393e2226d12f077b90e018a1fe4ca171a5562/servers/rendering/renderer_rd/renderer_scene_sky_rd.cpp#L1442-L1444

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

It can't be worked around in script

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

It is core

@Calinou
Copy link
Member

Calinou commented Jun 23, 2022

Related to godotengine/godot#49789.

Does this proposal affect objects rendered to the reflection atlas, or just the background sky that is represented on the reflection atlas?

@clayjohn
Copy link
Member Author

Does this proposal affect objects rendered to the reflection atlas, or just the background sky that is represented on the reflection atlas?

Both :) I use the sky as an example in the photos above just so that it is clear how much better the reflections could be.

Related to godotengine/godot#49789.

Yes, but note that this proposal only affects the quality of rough reflections.

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

2 participants