Skip to content

Draft: Simplified meshes

This MR is an attempt ot automatically generate simplified meshes with the Simplify class from osg. Most of the code of this new version comes from @elsid MR about Navmesh disk cache as the problematics are closed.

There is a new binary called simplifiedmeshtool that allows to generate a simplified meshes database (SQLite based) out of all content listed in openmw.cfg. No manual configuration is required, just like the engine it will read all config files and load all listed content files including mods, etc. The navmesh generation is done in parallel based on STAT, ACTI, DOOR, CONT, ESM records utilizing all CPUs by default or given number of threads. Tool correctly handles an existing database. If meshe is already present with exact match it will not be regenerated.

Generated database file size is about 256MiB for all meshes of Morrowind + Tribunal + Bloodmoon + Tamriel Rebuilt content. It contains only one table and two index for this table. On my system it takes about ~~2 minutes to generate a database for all meshes.

Prepared by simplifiedmeshtool database is used by the engine to add to the VFS the simplified version of meshes which will be used by objectpaging.

The simplified meshes tool can be launched from the launcher

Tasks left:

  • Add a parameter to controls whether simplified mesh cache is used by the engine or not
  • During gameplay compute missing simplified meshes in the background and write them into the DB
  • Add a simplified mesh version to avoid using cached simplified meshes that have different version
  • Add a simplification parameter to the simplifiedmeshtool

Merge request reports