godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
88.64k stars 20.1k forks source link

Implement LOD generation when importing OBJ as mesh #65294

Open snektailmeat opened 2 years ago

snektailmeat commented 2 years ago

Godot version

4.0 alpha15

System information

Windows 10

Issue description

The build in Auto Lod systems seems to not work on obj´s as meshinstances

Steps to reproduce

Creat a meshinstance from an obj and set LOD Bias, import the same model as a gltf and set the LOD Bias to the same value on both models.

Minimal reproduction project

lodbug.zip

Calinou commented 2 years ago

Mesh LOD generation only kicks in on imported 3D scenes, not imported 3D meshes. If you change the OBJ's import type to OBJ As Scene, LOD generation should work.

Zireael07 commented 2 years ago

@Calinou The fact this only works on scenes should be documented then

Calinou commented 1 year ago

@Calinou The fact this only works on scenes should be documented then

It's documented now: https://docs.godotengine.org/en/latest/tutorials/3d/mesh_lod.html#generating-mesh-lod

vPumpking commented 2 months ago

And is there a quick way to make every imported obj lod meshes?

Calinou commented 2 months ago

And is there a quick way to make every imported obj lod meshes?

It might be possible to script it but it's definitely nontrivial. Switching your OBJ imports to OBJ as Scene and modifying your scenes accordingly is probably quite a bit faster.

You can use the Save to File option in the Advanced Import Settings dialog to save a single mesh from the imported scene. This mesh will contain generated LODs (if enabled in the Import options), which makes it useful for things like particles.

vPumpking commented 2 months ago

nevermind, I have time so I started to work on a realtime meshsimplifier for meshinstances