Auto LOD generation
Members - Reputation: 204
Posted 07 December 2010 - 05:07 PM
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?
Members - Reputation: 539
Posted 07 December 2010 - 05:30 PM
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!
Members - Reputation: 785
Posted 07 December 2010 - 06:07 PM
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.
Members - Reputation: 531
Posted 07 December 2010 - 08:49 PM
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.
Members - Reputation: 204
Posted 08 December 2010 - 02:35 AM
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.
Members - Reputation: 213
Posted 08 December 2010 - 02:59 AM
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.
Members - Reputation: 1119
Posted 08 December 2010 - 03:07 AM
Treating each object individually will result in either lots of gaps or very poor simplification.
GDNet+ - Reputation: 400
Posted 08 December 2010 - 03:24 AM
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.
Members - Reputation: 229
Posted 09 December 2010 - 04:06 AM
First, you should not have problems with texture coordinates, since you should handle them in the same manner as the positional info, so you won't delete texture seams, etc.
It is common for all LOD algorithms to treat all vertex data in a similar way, be it tangents, positions or texture coordinates.
But the task you are doing is not by far the simplest thing at all.
Imo, your lead don't exactly knows, what a beast a LOD can turn into.
Most people do it by hand.
Introducing vertices should be a must, where they touch geometric surfaces or else you'll get holes and wierd stuff.
Btw, for very distant stuff you could try depth sprites (require rerendering of the original mesh) or a more generic LOD approach - marching cubes over the mesh, until some cube size, then bake the geometry into a single quad/triangle + baked texture from this piece of the mesh. Very straightforward and generally easy to write, but will require unique texture for the whole mesh.
Members - Reputation: 100
Posted 09 December 2010 - 02:23 PM
u can try some other way,for example,try to render the complex-large-mesh to a texture in real-time but not every frame,and use billboard technique.Some culling
and batch methods are also useful.
Members - Reputation: 229
Posted 09 December 2010 - 08:38 PM
Original post by _swx_
This document shows the results of remeshing and simplifying complex models and then packing the textures and materials:
Looks stunningly good! Grats for actually succeeding where many failed :)