• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
gamelife

Auto LOD generation

12 posts in this topic

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?
0

Share this post


Link to post
Share on other sites
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!
0

Share this post


Link to post
Share on other sites
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).
0

Share this post


Link to post
Share on other sites
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.
0

Share this post


Link to post
Share on other sites
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.
0

Share this post


Link to post
Share on other sites
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.
0

Share this post


Link to post
Share on other sites
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.
0

Share this post


Link to post
Share on other sites
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.
0

Share this post


Link to post
Share on other sites
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.
0

Share this post


Link to post
Share on other sites
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.
0

Share this post


Link to post
Share on other sites
Mm, did your lead make some outline of the LOD process that should do the job?
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.
0

Share this post


Link to post
Share on other sites
The same thing happens in our company too. The artists agree with us that the lod mesh must be created by them,but they also say that "we are too busy...".

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.
0

Share this post


Link to post
Share on other sites
Quote:
Original post by _swx_
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



Looks stunningly good! Grats for actually succeeding where many failed :)
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0