mrvux / dx11-vvvv

DirectX11 Rendering within vvvv
Other
71 stars 71 forks source link

Passing in Assimp open flags #284

Open mediadog opened 7 years ago

mediadog commented 7 years ago

There are a number of useful flags to use when opening a model with Assimp, most notably the two below. Where might I go poking about in the DX11 assimp code to add these?

aiProcess_OptimizeMeshes A postprocessing step to reduce the number of meshes.

    This will, in fact, reduce the number of draw calls.

    This is a very effective optimization and is recommended to be used
    together with #aiProcess_OptimizeGraph, if possible. The flag is fully
    compatible with both #aiProcess_SplitLargeMeshes and #aiProcess_SortByPType.

aiProcess_OptimizeGraph A postprocessing step to optimize the scene hierarchy.

    Nodes without animations, bones, lights or cameras assigned are 
    collapsed and joined.
mrvux commented 7 years ago

I need to recheck what defaults are passed, but in any case, those could be exposed.

As a side note I wanted to move to another wrapper than the one I use now (P/Invoke version, so less 32/64 bits issues, and complete one), so it's a bit part of larger work.

mediadog commented 7 years ago

Great! I did some testing using the Assimp viewer to apply the flags to a model and save it back out again. The model that got me looking into this is one done by some architecture graduate students (not 3D modeling savvy) in Rhino that is fully textured with 3600+ meshes.

As exported, it renders on my i7 laptop in vvvv at 12FPS. The model converted using these flags has 320 meshes and renders at 70FPS with no visual difference, quite the win! (I'm guessing lots of meshes in DX11 ia a Very Bad Idea...)