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

Mesh LOD for Godot 3 LTS #8486

Closed
TheConceptBoy opened this issue Nov 21, 2023 · 3 comments
Closed

Mesh LOD for Godot 3 LTS #8486

TheConceptBoy opened this issue Nov 21, 2023 · 3 comments

Comments

@TheConceptBoy
Copy link

TheConceptBoy commented Nov 21, 2023

Describe the project you are working on

A 3D fps game with a lot of props

Describe the problem or limitation you are having in your project

Too many props in a level, need to rely on lod system

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

I mean, the tab has been in the editor for the past almost 2 years.
image

When is this actually coming? Many of us, including myself, have projects started in Godot 3.x before 4 was stable to use. With the amount of problems that porting to 4.x has been, it makes sense to finish some existing projects in 3.x

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

It's LOD, pretty self explanatory. I just can't find some sort of ETA on this feature. Seems pretty rudimentary even for an LTS engine.

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

Swapping meshes in code. But that means every prop will need to run GDscript logic.

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

Any respectable engine has an LOD system.

@Calinou
Copy link
Member

Calinou commented Nov 21, 2023

Thanks for the proposal! Consolidating in godotengine/godot#40784, as this is technically a missing feature that was intended to be added (so it doesn't need a proposal).

In the meantime, use https://github.com/godot-extended-libraries/godot-lod 🙂

@TheConceptBoy
Copy link
Author

TheConceptBoy commented Nov 21, 2023

Thanks for the proposal! Consolidating in godotengine/godot#40784, as this is technically a missing feature that was intended to be added (so it doesn't need a proposal).

In the meantime, use https://github.com/godot-extended-libraries/godot-lod 🙂

Got it.

Thank you for the plugin, I see it is of your own making. So is there a particular reason why there is a dedicated UI for LOD and yet it has to be done via a plugin?

Is someone actually on the job of getting this to be a core part of the engine or do we just place UI values as promises without a plan to actually implement them? Sorry for being harsh but this has been in the engine for nearly 2 years now. Is it going to be come an actual part of the 3.x engine at some point? I'd imagine that it'd be more performance friendly having been implemented in C++ than via GDscript.

Also, in regards to your plugin:
image
What does it mean "performance Conscious GDscript"? Isn't C++ by design and nature more efficient than GDscript? How does it fare against large quantity of props?

@Calinou
Copy link
Member

Calinou commented Nov 22, 2023

Thank you for the plugin, I see it is of your own making. So is there a particular reason why there is a dedicated UI for LOD and yet it has to be done via a plugin?

It could have been implemented with the existing built-in properties, but this would have made the UI inconsistent with light and particle LOD fading (which the add-on implements). Godot 3.x doesn't have built-in properties for those, yet LOD for these node types is important to have in a complex 3D project too.

What does it mean "performance Conscious GDscript"? Isn't C++ by design and nature more efficient than GDscript? How does it fare against large quantity of props?

The add-on is pure GDScript, but I paid attention to optimizing the hot loops so they run as fast as possible (inlining functions, caching results when possible, etc). Pooled LOD updating is even faster, but it required heavy refactoring and compatibility breakage so I decided not to merge it for now.

The add-on in its current state should already be able to handle hundreds of instances (if not thousands) before CPU utilization related to scripting becomes a problem. If you have huge numbers of instances, consider using a MultiMeshInstance to draw them instead of individual MeshInstances, as this also reduces the number of draw calls.

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