Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Fixed LODs not being loaded #3207

Merged
merged 1 commit into from
Jan 25, 2025
Merged

Conversation

AnotherFoxGuy
Copy link
Member

The code for loading LODs got removed at some point

@ohlidalp
Copy link
Member

ohlidalp commented Jan 9, 2025

I vividly recall measuring performance of actor spawning: The worst thing was flexbody generation as I expected, but the second worst thing shocked me: the LOD lookups. Also by large margin our FPS bottleneck is batch count, not triangle count, so even if we got LODs right, it won't make signifficant difference. I'd rather remove that code entirely and let testers try finding actual difference, or at least add cvars to disable the 'classic lod' and 'custom lod'. At the very least wait until OGRE14 upgrade, after which I plan to implement resource loading on background.

I can't find this info in docs: Can OGRE mesh file format have embedded LODs? It would make sense. The MeshLodUsage object suggests that the primary way of doing LOD is having alternate edge lists for the same vertex buffer, and having a whole alternate mesh is something of an emergency solution. I don't know much about LOD in general but the manual suggests there's more than one way to determine LOD levels and some make more sense than plain distance.

@CuriousMike56
Copy link
Member

The code was removed sometime after 0.4.7.0. Was meaning to create an issue ticket on this, glad to see it restored 👍

I'm only noticing a difference in spawn time of ~1.2s when loading actor-heavy maps like Train Valley, negligible difference really.

I'd rather have wonky LODs than none at all ,especially as they're used in some maps (NeoQ, Community Map etc).

@@ -386,6 +386,8 @@ void GameSettings::DrawGraphicsSettings()
DrawGIntCheck(App::gfx_particles_mode, _LC("GameSettings", "Enable particle gfx"));
DrawGIntCheck(App::gfx_skidmarks_mode, _LC("GameSettings", "Enable skidmarks"));

DrawGCheckbox(App::gfx_auto_lod, _LC("GameSettings", "Enable OGRE's automatic mesh LOD generator (Increases loading times)"));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to refer to it as "OGRE's automatic mesh LOD generator"? Could it just be "Enable automatic mesh LOD generator"?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^

@ohlidalp
Copy link
Member

Right, I probably measured before resource groups were fixed, so the lookup had to go over all meshes in modcache instead of just over meshes in that ZIP. Thanks for checking.

The code for loading LODs got removed at some point
Copy link
Member

@ohlidalp ohlidalp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to work fine.

@ohlidalp ohlidalp merged commit 65aeab1 into RigsOfRods:master Jan 25, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants