godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.06k stars 65 forks source link

Add `lod_changed` signal to MeshInstance3D #9769

Open masterthdev opened 2 weeks ago

masterthdev commented 2 weeks ago

Describe the project you are working on

A simulation game with hundreds of skeletal meshes and isometric camera

Describe the problem or limitation you are having in your project

I am using VisibleOnScreenNotifier3D to disable offscreen AnimationTrees but in some situations there are a lot of characters on screen because of isometric camera. Vertex animations restrict body shapes of npcs.

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

Using lod_changed signal allows implementing animation lods by reducing bone complexity and tick rate of distant npcs.

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

When mesh lod level changes, MeshInstance3D will emit lod_changed signal to notify new lod level.

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

Mesh lod levels are not exposed to script.

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

Automatic LODs are core.

Calinou commented 2 weeks ago

By LOD change, are you referring to automatic mesh LOD, or manual LOD through visibility ranges?

masterthdev commented 2 weeks ago

By LOD change, are you referring to automatic mesh LOD, or manual LOD through visibility ranges?

Automatic mesh lod

fire commented 1 week ago

Do we need to avoid using a notification while still notifying the mesh instance? Concerned about how often LOD changes happen.