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

Disabling depth prepass in the Project Settings breaks opaque material rendering #82860

Closed
Calinou opened this issue Oct 5, 2023 · 6 comments · Fixed by #83371
Closed

Disabling depth prepass in the Project Settings breaks opaque material rendering #82860

Calinou opened this issue Oct 5, 2023 · 6 comments · Fixed by #83371

Comments

@Calinou
Copy link
Member

Calinou commented Oct 5, 2023

Godot version

4.0.stable, 4.1.1.stable, 4.2.dev fe8a58b

System information

Godot v4.2.dev (fe8a58b) - Fedora Linux 38 (KDE Plasma) - X11 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 4090 (nvidia; 535.113.01) - 13th Gen Intel(R) Core(TM) i9-13900K (32 Threads)

Issue description

Disabling depth prepass in the Project Settings breaks opaque material rendering. All opaque objects will no longer be rendered until the project is reloaded.

This occurs both in the editor and running project (if toggling the project setting's value with a script).

simplescreenrecorder-2023-10-05_17.55.33.mp4

Steps to reproduce

  • Use the Forward+ rendering method. (I can't reproduce this when using the Compatibility rendering method, but toggling the setting makes no performance difference there. Does the setting have an effect when using Compatibility?)
  • Disable Rendering > Driver > Depth Prepass > Enable in the Project Settings, or use the following in a script:
ProjectSettings.set_setting("rendering/driver/depth_prepass/enable", not bool(ProjectSettings.get_setting("rendering/driver/depth_prepass/enable")))

Minimal reproduction project

test_depth_prepass.zip

@clayjohn
Copy link
Member

clayjohn commented Oct 5, 2023

Is the setting set to restart when changed (I.e. using GLOBAL_DEF_RST)? It requires a restart after changing or else all opaque materials will be broken

@Calinou
Copy link
Member Author

Calinou commented Oct 10, 2023

Is the setting set to restart when changed (I.e. using GLOBAL_DEF_RST)? It requires a restart after changing or else all opaque materials will be broken

No, but I remember the setting being changeable without having to restart (this was when I initially added the option). I guess this is no longer the case due to some internal optimizations.

@clayjohn
Copy link
Member

clayjohn commented Oct 13, 2023

Is the setting set to restart when changed (I.e. using GLOBAL_DEF_RST)? It requires a restart after changing or else all opaque materials will be broken

No, but I remember the setting being changeable without having to restart (this was when I initially added the option). I guess this is no longer the case due to some internal optimizations.

Ya, that's right

A note for potential bug fixer, the solution here is to change the definition of this project setting from GLOBAL_DEF to GLOBAL_DEF_RST

@Lunarisnia
Copy link
Contributor

I would love to fix this. Can I get assigned to this issue?

@Calinou
Copy link
Member Author

Calinou commented Oct 14, 2023

I would love to fix this. Can I get assigned to this issue?

For future reference, we only use the assignees feature for core contributors (and we don't always use it in the first place). Since contributors can leave at any time for any reason, we'd rather avoid a situation where nobody is working on an issue because it's assigned to someone who is no longer active.

You can open a pull request nonetheless 🙂

@Lunarisnia
Copy link
Contributor

Sounds great. Thank you for the info

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

Successfully merging a pull request may close this issue.

4 participants