-
-
Notifications
You must be signed in to change notification settings - Fork 22.3k
Allow building the editor with 3D disabled, or without 3D Physics/Navigation. #105579
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
base: master
Are you sure you want to change the base?
Conversation
9b0dbd5
to
3f600da
Compare
I’m not sure I see the need for this. Why would you want to build the editor with 3D disabled? It doesn’t offer any real advantage for final projects, since those can already be built without 3D. This change just adds unnecessary checks in the editor code without a clear benefit. I’d recommend creating a proposal to clearly explain the motivation and potential benefits before moving forward with this PR. |
This is not just about removing 3D, it’s about giving developers more control over their tools, improving performance, and reducing unnecessary overhead when it’s not needed. |
@WhalesState this is a significant change, it needs a proper proposal. |
I understand your concerns, and I'd like to link the PR when it's finished to the proposal if no one ever proposed it. And it's not significant yet, just one more commit to allow building with |
For projects using C# but not 3D, it offers some advantages: the C# bindings are generated by the editor, which cannot disable 3D. This means C# will inevitably generate bindings related to 3D, leading to certain issues after export. For example, |
The C# side is something that should probably be fixed by other means rather than tweaking the editor, especially since you might want to build different versions of the bindings for different exports etc., and there's various other things you can't disable for the editor and that likely won't ever be possible to disable for the editor (like advanced UI) |
I can find a workaround for the advanced gui but it's not related to this change, we have a real issue that you just said it should be fixed, and soon it will :) |
See #103315 I agreed that this PR adds too much complexity and maintenance cost if the reason is just for C# bindings generation. The editor feature profile can already cover the need to disable certain editor features, and the pursuit of the minimum export template size doesn't need the editor stripped anyway. If anyone wishes to fix the C# bind-gen issue, I would recommend implementing such functionality directly in |
You shouldn't have to build the editor with all the different configurations you want for any specific export template, that's not really fixing any issue, so I think it's best to not focus on the C# bindings side and instead focus on the need and demand for this specific editor build (it's enough work to keep a few different export templates around for each platform + configuration) |
This PR is starting to attract some discussion and it's the exact reason, I wanted it to have a proposal attached. So, it can be discussed properly. |
Please do, I'm the less experienced one here and I'm just adding some |
You can then open the proposal in https://github.com./godotengine/godot-proposals and link it to this PR. |
Someone asked what benefits this PR would bring. I listed the C# example, but you guys said C# should use a better solution and not expect this PR. Hmm, alright, after all, I might be the only one here who's been troubled by that issue for months. |
This comment was marked as outdated.
This comment was marked as outdated.
Let's wait with any further discussion until we have a proposal to not bog this down in off topic |
A benchmark will tell the difference, the editor should load faster and will consume less memory, and should render 2D scenes faster since we have skipped all the Viewport Renderer 3D code, you will also open the docs and you will see all the classes and methods you can use when you build the templates with 3D disabled, disabling 3D from the editor profile is just hides things, there is no proper disable for 3D in editor. |
So in short:
At the cost of:
|
Also the lightmapper_rd module needs to be disabled on non-3D builds, so: diff --git a/modules/lightmapper_rd/config.py b/modules/lightmapper_rd/config.py
index ecc61c2d7e..e18d288753 100644
--- a/modules/lightmapper_rd/config.py
+++ b/modules/lightmapper_rd/config.py
@@ -1,5 +1,5 @@
def can_build(env, platform):
- return env.editor_build and platform not in ["android", "ios"]
+ return not env["disable_3d"] and env.editor_build and platform not in ["android", "ios"]
def configure(env): |
The same thing goes for export templates, it's all over the engine. I'm preparing a benchmark to see the difference, just waiting for editor to build with same flags, if it worth it then we can discuss it, if it doesn't then i have no issues to keep it open for anyone who needs it. |
Again, please create a proposal and discuss this further there, this is getting cluttered with off topic discussions |
So from compiling this there's a few immediate issues:
That was all I tested right now, but there's a lot to test and fix here just from this brief test, so this will need very extensive testing to make sure it works correctly For savings, the editor executable is about 30 MB smaller, which is a pretty neat reduction in space A basic benchmark doesn't show any reliable differences in performance that I can see, but did just a very basic one, so that would need a more detailed test over several runs, but nothing sticks out there |
🧪 Godot Editor Benchmark Comparison: 3D Disabled vs Enabled⚔️ Summary Table
The editor loads faster by ~3.35 seconds with 3D disabled. |
I can't replicate these benchmarks reliably, it varies more between runs of the same configuration than it does between configurations, but I'll set up some runs later and run several times averaging more carefully Though it's hard to even say if these benchmarks are useful since the editor doesn't work currently, and the data might be very different when the various bugs have been fixed |
Fixed all the above issues, for
|
Note that this does not close godotengine/godot-proposals#12106 as that's specifically about decoupling the bindings from the editor, even though this solves the problem that proposal aims to solve it isn't a solution to it as per the reasons mentioned above It'd be like linking a PR that adds a method to write a plugin to solve something when the proposal is about adding an editor feature to perform the solution, it solves the goal (and only partially) but not the intention (and again other configuration details that can't be done with editor changes, or at least not this PR) |
Opening a Proposal requires me to write the issue that it solves, and i didn't test if it fixes the C# issue, and how it's going to affect GDExtension if we dump the api with 3d disabled. Also all the changes are meant to be editor changes, but i have found other issues and fixed them for |
Again let's focus on the benefit for the editor by disabling this, not potential C# things it tangentially solves, but it would be good to have a proposal going because it's pretty critical to be able to assess if this is actually needed |
The benefit for me is that it will help us to make a better Edit: You will also be able to run the projects from project manager which is much faster. |
7e3d5ea
to
398f17f
Compare
Allows building the editor using
disable_navigation_3d=yes
,disable_physics_3d=yes
ordisable_3d=yes
.