RobertBeckebans / RBDOOM-3-BFG

Doom 3 BFG Edition source port with updated DX12 / Vulkan renderer and modern game engine features
https://www.moddb.com/mods/rbdoom-3-bfg
GNU General Public License v3.0
1.48k stars 254 forks source link

Automatic LOD model support like in Quake 3 #508

Open RobertBeckebans opened 3 years ago

RobertBeckebans commented 3 years ago

The engine should look up for _1 and _2 model suffices to autoload same objects in lower resolution and switch them based on projected bounding box size.

If there are no LOD models it could autogenerate them like Ritual / Splash Damage did in those good old days.

https://github.com/Sporesirius/fakk2/blob/master/source/utils/max2tan/calclod.cpp

This is potentially problematic for stencil shadows but should be a win for shadow mapping and general polycount reduction with new scenes.

Calinou commented 3 years ago

Maybe an index-based solution like meshoptimizer could be considered for automatic LOD generation. Godot just implemented it: https://github.com/godotengine/godot/pull/44468

RobertBeckebans commented 3 years ago

Thanks for the hint. I thought meshoptimizer wasn't a poly reduction lib but only a vertex cache optimizer. I'll have a deeper look at it.

BielBdeLuna commented 3 years ago

so you author the higher poly mesh only and the meshoptimizer creates the lower poly mesh on the fly?

Calinou commented 3 years ago

@BielBdeLuna Indeed, that's what meshoptimizer does.

BielBdeLuna commented 3 years ago

Then, those are quite interesting possibilities! :+1:

DanielGibson commented 3 years ago

Are you sure it's meant to be used on the fly? It's not mentioned on the project page explicitly, but I always assumed it was meant to be used once when importing a mesh into the engine (and not on every model/level load)?

Calinou commented 3 years ago

Are you sure it's meant to be used on the fly? It's not mentioned on the project page explicitly, but I always assumed it was meant to be used once when importing a mesh into the engine (and not on every model/level load)?

Indeed, meshoptimizer should be run at import-time (or perhaps load-time and then cached).

motorsep commented 3 years ago

Storm Engine 2 has LOD system for static meshes. Worth checking out IMO :)