godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.16k stars 97 forks source link

Add option for ReflectionProbes to only include meshes with static GI mode #8926

Open atirut-w opened 9 months ago

atirut-w commented 9 months ago

Describe the project you are working on

Unity HDRP sample scene in Godot (private project)

Describe the problem or limitation you are having in your project

A QoL feature.

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

Only including GI static meshes allow you to exclude objects that you don't want appearing in reflections very easily, but assumes that you want to exlude all dynamic objects. A viable alternative would be adding a "reflection probe static" property to GeometryInstance3D and import options.

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

A "static objects only" flag for ReflectionProbes.

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

You can imitate a sort of "reflection probe static" feature using layers, but this is very tedious. You have to 1) remove all layers from a probe's cull mask except the probe static layer, and 2) put your probe static meshes into the aforementioned layer.

This can get out of hand very quickly if you have lots of model assets. Did I forget to mention that models can have submeshes?

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

Rendering is core

clayjohn commented 9 months ago

Have you seen https://github.com/godotengine/godot/pull/86073? We are about to add a new mask so that you can mask objects from being rendered in reflections, while still allowing them to receive reflections from the reflection probe.

On the topic of static vs. dynamic objects, we are still unsure if we want to piggyback on the GI mode setting as we may end up doing a lot of other static/dynamic optimizations for things like TAA and shadows too.

Right now TAA just auto-detects if an object is dynamic or static and it doesn't require the user to specify anything. We could do the same for reflection probes.

What is the end goal of this proposal, is it performance?

atirut-w commented 9 months ago

Mostly artistic control