Auto LOD generation

Started by
11 comments, last by Zemedelec 13 years, 4 months ago
The artists in my company build large objects by putting separate parts together. For example, we have separate models of windows, walls, ledges, pillars, doors, etc. To make a whole building, they put multiple parts at different positions, allowing the parts to simply touch or intersect. As a result, a building would consist of 100 disconnected meshes.

Now I'm assigned the task of writing a tool for auto LOD generation. I found that it's hard to avoid holes after polygon reduction. I've tried many methods like locking the open edges or coincidnet vertices, but holes cannot be 100% avoided. I also tried to auto-split touching or intersecting edges, but it results in tremendous increase of polygon count.

So do you think it's a good idea of modellng large objects by simply putting small pre-made pieces together, without resolving the intersecting polys? It would definitely save poly count, but it also hinder auto LOD generation. What's the common practice in game companies?
Advertisement
You know honestly, you might get some good info here, but I would really talk to a more senior graphics programmer there at your company or your lead if they know about graphics programming.

If you are the most senior... i am really sorry... you are probably in for some major pain and i hope you are willing to be tossed in the "deepest end" of the pool. You will have major problems near the end of the project when everything is broken and nothing runs fast enough and no one there has experience enough to know what to do about it without having to learn everything for the first time.

Anyhow, I'm not a graphics programmer but i'll try a response!

The good thing about how they generate those models is that instanced geometry can be really fast to render and can take up very little memory since each building isn't it's own complete model.

HOWEVER, part of optimizing rendering is to minimize draw calls to as few as possible. Doing what you are saying could make the number of draw calls HUGE depending on how many buildings you have on the screen at any one time and how you do your LODing.

Also, since there are so many models you'd wand a really efficient kind of rendering setup, like perhaps BSP trees, so that you could quickly cull away everything that wasn't visible.

deferred rendering may also be a good idea.

Onto the idea of lodding... for low lod buildings have you thought about doing something like for instance, using a textured quad (without any transparency in that image) for the windows when they are far away?

You could render to texture to automatically get that lowest level of LODing for a building.

You could possibly even render the entire side of a building to texture and just paint that onto the side of a building as a single quad if appropriate.

If you had other buildings you knew were the same building you could re-use that texture for them too.

Hope this helps or starts some more discussion!
Hmm, I think the situation is not that worst. At medium to far distance, the parts of a building are combined together as a single mesh (1 draw call).
Have you profiled already to determine that too many vertices is your bottleneck?

If not I'd suggest you do some profiling first, depending on your platform there are different tools to investigate where your GPU bottlenecks are.

No sense in wasting a lot of time developing this auto LOD system if your time could be better spent somewhere else.
Is it possible to merge the pieces and then do the LOD conversion? This would help to prevent holes.

You might also be able to tweak your algorithm so that the smaller LOD never loses volume but instead matches or gains volume. That could assure no holes are produced from separate pieces.
My task is assigned from the lead programmer so I think he has already done profiling.

I already merged the pieces before LOD. It helps a bit, but not perfect.

In far distances, I second that render to texture is a good choice. The problem is just medium distances. The LOD tool is used to merge the pieces, perform LOD, and combine textures.

I've voiced out several times that LOD can't be perfect when the input mesh is disconnected, and we'd better get artists to clean up the result by hand. Apart from the holes issue, the UV mapping after LOD needs to be fixed manually too. But I was told that the artists are too busy, so I need to try making the tool cover all cases and yield the best result. Errrrr.
Well best case here would be simply to have lower LODs for each individual piece that still match up together. If the artists don't have time to work on that though then you're going to have to do it the hard way.

What you could do is for each piece, before joining the individual meshes find which vertices are touching other parts (the duplicate vertices that are removed when joining the meshes) and ensure that they never get moved or deleted. After that the internal vertices of each piece can be optimised by whatever algorithm suits.
Portfolio & Blog:http://scgamedev.tumblr.com/
This document shows the results of remeshing and simplifying complex models and then packing the textures and materials:

http://www.donyalabs.com/pdf/SceneOptimizationWhitepaper.pdf

Treating each object individually will result in either lots of gaps or very poor simplification.
I've already tried locking the coincident vertices. It does not help much, since a large amount of pieces are touching in edges, or even intersecting.
Batch objects using same material, and spend time on occlusion culling before getting yourself into this. Unless of course, you already have occlusion culling, and assuming it is fast enough.

Quote:
My task is assigned from the lead programmer so I think he has already done profiling


Maybe you should go talk to him first and make sure he knows what really the problem is. My lead here already asked me to do an auto LOD before, but he is not a graphic programmer and didn't really know. LOD should be done by art team. And art team agreed, but didn't want to do it. So we ended up with a better culling system, and everything worked out.

This topic is closed to new replies.

Advertisement