stride icon indicating copy to clipboard operation
stride copied to clipboard

[WIP][Test] Add automatic generated LODs (Part 1)

Open kalysti opened this issue 4 years ago • 6 comments

PR Details

UNDER DEVELOPMENT. ITS JUST A DRAFT.

This PR Brings an LOD Generation Tool (MeshDecimator) and an new AssetType "ModelLodAsset" to the engine.

How it works

  1. Import a mesh / Create a new ModelAsset

  2. After import it calls the MeshDecimator class and generate simplified meshes by given amount of lod levels.

  3. For each LOD Level we got now an new a sset "ModelLodAsset" in the asset browser with the name of the mesh and a given suffix (TESTMESH_LOD1.sdmlod3d)

New Types

  • ModeLodAsset (The asset for the lod model, hods the mesh data)
  • ModelLodModel (Instance Holder for the Model)

New Properties:

  • ModeLodAsset => List<Model> lods, float lodBias
  • ModeAsset => Model SrcModel, int LodLevel, float Quality
  • ModelComponent => List<Model> Lods (Hidden), float lodBias

New Libraries:

  • MeshDecimator -> The remesh library
  • MeshDataTool (MeshDataToolGPU, MeshDataToolStorage) -> A mesh data parser from gpu or storage
  • MeshSurfaceTool - A simplified library to create triangle geometry

Next steps

[X] Thumbnail generation [ ] Project settings -> Default Bias Overall Threshold Multiplier [X] Project settings -> Default Lod Levels on import [X] New Modal for creation ModelLodAsset manualy (Without reimport the mesh) [ ] Attach the new lod models to the render pipeline and use the camera to control the distance and the right lod selection [X] Prevent to attache primitive or procedual genearted meshes [ ] Clean up [ ] Test scene [ ] Add support for bones [ ] Add support for colors [ ] Add support for multi uvs [ ] Documentation [ ] Next part: Range visibility detector

Asssigns

https://github.com/stride3d/stride/issues/39 https://github.com/stride3d/stride/issues/37

image image image image

image

kalysti avatar Dec 12 '21 21:12 kalysti

You might already know but you can add WIP in the PR Name instead of Draft (there's also a button to mark it as a draft somewhere).

ykafia avatar Dec 12 '21 22:12 ykafia

Marked it as a draft.

tebjan avatar Dec 12 '21 22:12 tebjan

You might already know but you can add WIP in the PR Name instead of Draft (there's also a button to mark it as a draft somewhere).

Sry dont know

kalysti avatar Dec 12 '21 22:12 kalysti

So good news. Loding works stable. Some tweaks are neccesary, then we can start testing..

kalysti avatar Dec 14 '21 21:12 kalysti

image This could be changed to "Generate LOD Levels" so that it contains the letters LOD because they are easy to read and understand.

tebjan avatar Dec 15 '21 14:12 tebjan

Great work on tbis. Keep it up!

Aggror avatar Jan 19 '22 23:01 Aggror