Automatic LOD generation

This is Simplygon: http://www.youtube.com/watch?v=slEmpq-4Ez4

Wouldn’t it be awesome for Blender to have a similar tool set?

Especially interesting feature is the one that generates LODs for skinned and animated meshes, retaining UV map (could be rebaking texture from original model onto LOD levels) and vertex weights (I wonder if there is a way to “bake” weights from original model to lower poly model).

So no one cares?

Is something like that doable in Blender (I know textures can be re-baked to lower poly meshes; but I wonder about transferring weights from higher poly mesh to lower poly mesh, assuming Armature is the same) ?

The number of views this thread has tells me a lot of people care but probably don’t know much about the source code in order to judge if it could be integrated / would be a good idea to integrate it.
Unfortunately there are only a few bge programmers here.

I think it would be good idea.

It can be made as an addon and would probably work pretty good just by automatizing some decimation modifiers and re-baking at lower resolutions but it would also produce a lot of messy meshes and blurry textures and people would just complain. And using the decimation to create LOD levels manually is pretty fast and gives great results is the mesh is modeled with quads.

@Josip_Kladaric:
It’s funny, because if manual labor would be such a clean, fast and precise way doing everything, Simplygon wouldn’t exist.

You don’t need quads in games. As a matter of fact you need triangles, to define silhouette better.

The main challenge I see right now is vertex weights transfer.

It’s funny, because if manual labor would be such a clean, fast and precise way doing everything, Simplygon wouldn’t exist.

Simplygon doesn’t actually give you clean results, it looks good in some games because the base for the model for creating LOD levels is very high. If you look into it a bit more (on blogs from modelers at studios that use it) you will notice that models must be made in a certain way for the reduction to work, and most of the resulting UVs and textures are redone after poly and material reduction.

You don’t need quads in games. As a matter of fact you need triangles, to define silhouette better.

The game engine will convert all quads to triangles for you. Its better to work with quads because its easier to establish forms and poly loops that give better results when animating. Models made of quads also give better results when you reduce the polycount, even with Simplygon. The result is a triangulated mesh but the base mesh is in quads mostly.

The main challenge I see right now is vertex weights transfer.

It can be done using the same technique used for transfer of normals from one mesh to another.
Vertex weight is also a major factor when reducing polycount of animated objects or characters.

Have you played games that use Simplygon? I have. I didn’t see any mess. You never see LOD iterations close up.

I am not sure what is your argument but my point was that we can get almost the same looking results with tools built into Blender.

I am not even going to get into argument when it comes to modeling for games. You can model in quads, but in reality you will need to triangulate mesh before export. And when you triangulate it, you will see that you need to turn edges on many of the former quads. Engine doesn’t triangulate for you. Even such top notch engine as UE3 required to models to be triangulated before exporting them to UE3 format.

Again, I have no idea are you selling Simplygon or what but why would we export models before using them in Blender. And the game engine does convert all your quads into triangles.

I thought your original intent was to get the same results for games in Blender and I explained that it is possible and we just need to automate it. There is no need to change the Blender source code, it can be an addon.

Bye

I like that idea,

My game is going for Fallout New vegas level detail,

and without LOD it just will not work,

What about LaserBlaster and bens Dynamic terrain LOD? is that done with code or a shader?

@Josip_Kladaric
To be clear, I don’t use BGE. World has many other game engines, some of which are simply better in many aspects than BGE. Those engines need models to be in tris, not quads. Maybe exporter does smart job or triangulation algorithm in other 3D apps is better, but when I triangulate quad based character / organic mesh in Blender, the silhouette breaks in many places, so I have to turn edges and tweak vertices to compensate.

Remeshing and polygon reduction is done better in MeshLab, so Blender isn’t as great as you can think in that area. Decimation tool can be improved.

I also never said Blender’s source needs changes. I was inquiring if Blender can transfer weights from original mesh to lower poly mesh, regardless of topology (it will be approximation). Another thing that came to me right now is if there is a way to unwrap lower poly mesh to approximate UV map of the original mesh and save resources on draw calls (if we bake texture to lower poly mesh, we will have to have yet another material and texture set, which means we’ll have extra draw calls)

@BluePrintRandom
I think that terrain LOD (if that’s the one I am thinking about) is done in code.

Transferring vertex weights between meshes is fairly simple- select the source mesh and then the target mesh, go into weight paint mode, and go weights -> transfer weights. In the tool shelf change the Group pulldown to All, and it should project all the vertex weights from the source mesh to the target mesh (it might also allow multiple source meshes)

As for triangulation, a number of engines triangulate quads automatically, but the results, being algorithmic, are generally not the best. As far as I know the only time a video card can accept a quad is when all four polygons lie exactly on the same plane with each other (IE it is perfectly flat), so at some point down the line your mesh will be broken into triangles- might as well make sure it’s done right yourself. Working with quads is good to maintain loops that deform well, but once your model is done I recommend triangulating it and manually rotating edges that split the wrong way (that will also break up any NGons if you accidentally left some in)
However, a lot of algorithms work better on quads than triangles, so it may be to your advantage to export the mesh with quads to whatever program you use to generate LODs (I recommend trying it both ways and comparing, if it turns out the results aren’t any better then don’t bother)

Terrain LOD is generally a lot simpler because most game terrain is a flat plane with a grid that is displaced to varied heights- so you can just reduce the grid resolution. The difficulty comes in when you are dealing with objects of arbitrary topology.