-
-
Notifications
You must be signed in to change notification settings - Fork 97
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 an option to disable shadows or allow shadow resolution to be set to 0 #6612
Comments
This is already supported for positional lights. https://github.com/godotengine/godot-demo-projects/tree/master/3d/graphics_settings also showcases the ability to disable omni/spot shadows entirely using @mieldepoche's approach (use the Minimal shadow resolution setting in the menu). godotengine/godot#57610 exposed this ability in the Project Settings dialog for positional lights, but it wasn't merged in time for 4.0. It would need to be redone in a backwards-compatible way to be merged. It would be possible to add a new boolean project setting that enables/disables shadows globally, but I feel we should simplify the existing project settings rather than make them more complex. Replacing an integer value that was rounded to the next power to 2 with an enum is the best way to do this. Regarding directional lights, it makes sense to have a separate setting but the same issue as godotengine/godot#57610 applies. We ought to simplify its configuration as well, as the "value is rounded up unintuitively" issue also applies to the directional shadow size project setting and RenderingServer setter.
This behavior was likely accidental in Godot 3 and ended up changing in Godot 4 🙂 |
The enum approach looks really good, I think it would be the perfect middle ground between simplifying the settings and allowing shadows to be disabled. |
With respect to the "enum" approach. The shadow resolution project settings only apply to the root Viewport. They don't change the resolution of SubViewports. If we want to have a setting that force disables lights for performance reasons, it will have to apply to all viewports. Personally, I feel like option is relevant for a lot of performance-sensitive effects that may vary from scene-to-scene (see also #5229) |
This wasn't completed - why close? |
Op has closed all of his proposals |
Describe the project you are working on
I and people I know are working on 3D games and everyone seems to be looking for an option to entirely disable shadows at runtime
Describe the problem or limitation you are having in your project
There currently is no way (as far as I know) to disable shadow rendering without some kind of weird workaround (like keeping a reference to every light somewhere or rendering through a viewport).
Shadows are expensive even at low resolutions, so they are an easy way to speed up rendering and allow players with lower end hardware to still play a game.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
An option to disable shadow rendering at all or at least allowing the shadow resolution to be 0 would help. This would help because you don't need some weird workarounds. There should be an option for directional and positional shadows, they should be toggle able independently.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
In the
Lights and Shadows
section in the project settings, add a checkbox calledrender shadows
ordisable shadow rendering
. When this box is ticked (depending on the chosen name) it would enable/ disable rendering of shadows. There should be an option for directional and positional shadows, they should be toggle able independently.If this enhancement will not be used often, can it be worked around with a few lines of script?
It can not be worked around with a few lines of script, since keeping a reference to every light and saving the default state (whether the light should not render shadows even if shadows are enabled for example) would result in a big mess of code.
Is there a reason why this should be core and not an add-on in the asset library?
It affects the renderer.
The text was updated successfully, but these errors were encountered: