Open Calinou opened 2 years ago
Crashes in lod. https://github.com/godotengine/godot/issues/57362
How do we generate lods and enable automatic use on already imported meshes? I have hundreds of assets already, stored in Godot's native resource format and saved in text scenes or as text resource files for git.
How do we generate lods and enable automatic use on already imported meshes? I have hundreds of assets already, stored in Godot's native resource format and saved in text scenes or as text resource files for git.
Automatic LOD generation on import is only supported when importing 3D scenes (glTF/Collada/FBX), not when loading pre-made .mesh
/.res
meshes or importing 3D meshes (OBJ). That said, you can choose to import OBJ as a 3D scene in the Import dock if you need LOD generation and lightmap UV2 unwrap for OBJ.
There's a generate_lods()
method on some class I forgot the name of, but it's more limited and doesn't seem to be meant for public use.
Thanks for the answer, but you're not supporting core features on your own native format (arraymesh)? There are tons of projects right around the corner from migrating to gd4 that won't be able to use lod without manually reimporting a ton. Many of them have meshes stored in scene files as arraymeshes without realizing they are disconnected from their import file.
How do I know? Because the engine pushes you into the native format, because I've continually seen people on my team not realizing they are disconnecting resources from files which get saved in scene files, and because I've seen people do it on github issues.
They're all expecting autolod to just work and apparently it is not going to unless they first discover it's not working, troubleshoot it, write up an issue, then manually reimport every asset, then the setting up all of the auxiliary components again: physicsbodies, collision, materials, layers, parameters, etc.
There is an unusable surfacetool.generate_lod()
, but it says Deprecated. Unused internally and neglects to preserve normals or UVs.
There is an ImporterMesh.generate_lods()
, and the class can output an arraymesh, but I see no way to pass in an arraymesh.
In the godot architecture, many procedures are ran on the raw scene before the final output. I was developing the gltf export code but it currently has a duplication nodes bug. I don’t have a good solution to rerunning the import process. Maybe marking as escn?
For clarity.
Thanks for the suggestion. I took one asset, a single MeshInstance, saved it as a tscn, renamed it to escn, brought it back into a scene and saw the import dialog and brought it in w/ Generate LODs. However, no LODs were generated. Moving the camera back and forth, watching w/ Information and Wireframe turned on in the viewport, the mesh and info did not change.
By the way, I probably have 1000 assets. Manually reimporting them one at a time is a very big ask. It's an unreasonable process considering:
I would try to get escn to operate on mesh instances instead of the importer mesh instance. It's a bug.
The other proposals don't have any plumbing in place, so it would be some work
Thanks I'll follow the issue. If you want to get LOD generation to work on a meshinstance, rather than arraymesh, then workflow-wise, it would be reasonable to right-click the mesh instance and select Generate Lods. Or left-click the MeshInstance, click the Mesh menu, and Generate LODs. That should be the same as saving as escn and reopening, but would save developers a lot of clicks and manual work. Doing it once isn't a big deal, but it adds up if you have to do it hundreds of times.
Does anyone know which issue describe lod generation being slow?
Profiles suggest https://share.firefox.dev/3ZY1DSC that:
This tracker is about issues related to automatic mesh LOD performed at import-time in 4.0. This feature is not present in 3.x.
See also https://github.com/godotengine/godot/issues/70533, which is another common optimization used in 3D rendering.
This tracker does not cover issues related to manual (H)LOD performed using visibility ranges.