Saturday 5 August 2017

Reducing Polycount


Hey guys! Welcome back for another blog post! This week I finally completed a major phase of the project I'm working on. So I thought I'd share some tips I learned from that.

As part of an assignment for my 3D course, I am to model a detailed building. So I selected a church. A nice one built in the old style. As it turns out I got more detail than I bargained for.

As you continue reading, remember I am using an Open Source software called Blender for my 3D work.

I decided the best way to build the church was to build all of the components from within edit mode. Everything I've learned up until now involved starting with a generic shape and making extrusions and manipulating vertices. I may have even encountered advice against adding primaries (cubes, spheres, etc.) from within edit mode. And yet, that's what I chose to do. As I'm sure you can guess by this point, that was my first mistake. The result was a whole lot of overlapping faces, random vertices in the middle of nowhere, lots of hidden internal geometry, and many hours of clean up. I now understand the value in modeling via extrusion. Another option would have been to build things as I did, but with everything created as a separate object and then use the boolean modifier to union everything together.

The model turned out quite nice, but even now while I'm working on texturing it, I'm still finding issues with the way the mesh is constructed. I found myself asking "How did I ever put this together in the first place?" It was a rather confusing mesh. Anyone who knows anything about 3D art can tell you that the more polygons (faces) you have, the slower the final render will be. So when faced with this confusing mess of a model, I knew I had to find a way to simplify it. But doing so manually pretty much meant building the church over again, while using my original model as the blueprint... That... would be... a lot of work. There had to be a better way. And guess what? There is!

Step 1 is to save your work! If anything goes wrong with the following steps, you can always revert to the original work.

Step 2 was to Remove Doubles. This involves selecting the entire mesh in edit mode first. Otherwise Blender doesn't know what you want to work on. I actually did this a lot during the modeling process itself, but if you haven't done this by the time your model is complete, then make sure you do it before you go any further.

Step 3 is to run the Decimate modifier. What this does is it reduces the geometry of your model based on a percentage. It's a fantastic tool, but be aware it can cause a loss of detail. 1.0 (aka 100%) means there is no reduction at all. Effectively, the modifier is not in use. While 0.0 is maximum reduction, and a complete obliteration of your model. There's still a model there, but it's an extremely ugly version of your original. I imagine you will almost never want to use the maximum value, but it's good to play with it so you know the limits. Of course, none of this is permanent until you click the apply button (and of course you can undo if you decide you're not satisfied after clicking apply), so feel free to adjust the settings to get the best balance of quality vs geometry. I dropped down to 0.89 before a noticeable drop in quality. And even then, it was minimal, as you can see in the screenshots below. This single step caused the largest amount of reduction, and accounts for almost all of the difference between the Hi Poly and the Lo Poly models. This step must be applied before proceeding to the next step.

Step 4 is to use the Limited Dissolve tool. Again in the edit mode, select the entire model. Then press X to delete, and in the menu that pops up, select Limited Dissolve. In the tools section on the left of the window (you may need to press T to bring it up), there are options to customize the Limited Dissolve parameters. The chief option to change here is the Max Angle. The default of 5 degrees worked very well for me. I played around with this, but ultimately settled on the 5 degrees being optimum. Remember, that as with the Decimate modifier, there is a potential of lost detail, so make sure you find the right setting for your purposes.

Finally, the 5th and final step was to remove the interior faces which are completely unnecessary for the rendering, as they aren't even seen. To do this, we once again need to be in Edit mode, but this time we need to ensure that no parts of the model are selected to start with. Then, open the Select Menu, choose Select All by Trait and and choose the Interior Faces. With all the interior faces selected, you can now delete them (X, then Delete Faces). In my case I found that there were some faces that were in fact still necessary, so I deselected them before erasing them.

Hi Poly Model (Before geometry reduction)  - Note the Face count in the upper right
Lo Poly Model (After all 5 steps of geometry reduction) - Note the reduced Face count

When I first approached the dilemma of reducing the geometry in my model, I wasn't sure how to approach it at first. I hope that this post will help you to deal with this issue in a more efficient manner than I did.

--Charlie Griffin

Stick with me, and we'll get wise together. 

No comments:

Post a Comment