Creating LoD models
Case study 1: Bent tube
This is based on a question at the official Second Life forum. The OP was trying to make a shackle for a padlock, simply a bent cylinder, and although the question wsn't about LoD, the shape is such a great example of the most basic principles of LoD optimisation so I thoguht I'd post an extended version of my reply here.
First, lets look at the high model. Here it is with a generous 24 curve resolution (curve resolution numbers are always for the full circle btw so the bend only has 12 segment since it's just half a circle):
That gives it a triangle count of 672 which is way too high for a simple object like this. Let's try to delete every other edge loop to get the curve resolution down to 12:
Woops! That didn't work too well. The profile of the cylinder is fine - it's possible we could reduce that even more - but the bend is way too edgy. Solution? You guessed it: reduce the curve resolution for the profile only and keep the bend as it is:
That's more like it!
Before we go on getting rid of triangles, we should look at the normals. They need to be smooth. If they aren't already, change it here:
Smooth normals are essential for curved surfaces. What they do, is adjust the shaders so joined surfaces at different angles blend into each other.
With flat normals, the cylinder would have looked like this even with 24 curve resolution:
With smooth normal we get this with only 12 curve resolution around the profile:
That's more like it, and this is with only half the triangles we started with!
Now, for the medium LoD model. This is so simple anybody who can handle a 3D modelling program at all can do it. Just remove edge loops to reduce curve resolution. Most people would probably remove every other loop here but we can actually take it further. Remove two out of three loops around the cylinder circumeference and every other loop around the bend:
Yes, it looks dodgy on closeup but this model si only seen at a distance. I promise you it will be fine. Note that I made the not-a-cylinder-anymore profile diamond shaped with edges rather than faces pointing along the axises. This is partly so that I don't have to mess around with the edge loop that is a seam but mostly because this tends to give a more credible circular look. Try both options and you'll see.
For the low model, let's go for a triangular circumference and curve resolution 8 around the bend:
This means we'll have to reposition some edge loops a bit to keep the volume of the cylinder but it's not that much work and it's sooo worth it when it means we can get a LoD model that looks perfectly fine with only 36 triangles. Here are the low and high models superimposed onto each other so you can see how their profiles fit:
Now for the lowest LoD model and an important thing to remember:
It's not always the high LoD model that is the main one!!! |
In fact, it usually isn't. The main model is the one people usually see and which one that is, depends on the object's size. In this case, it's the lowest LoD model.
Fortunately this padlock shackle is so small you'll never see much details at any realistic view distance anyway so we can keep it very simple: triangular profile, square bend:
That gives us 18 triangles and 12 vertices and there's hardly any point going further than that.
But if you still want to reduce more, you can get it down to only 12 triangles by removing the inner faces:
Seen from below(ish):
And that's it.Triangle counts: 336, 64, 36 and 18 respectively.
For comparasion, the uploader wants to use 336, 82, 20 and 10 triangles for the LoD models of this item but the result it produces with those values is absolutely horrible. To get a decent look from the uplaoder's auto-generated LoD models, you have to increase the triangle counts to 336, 167, 82 and 82 that's a lot of wasted land impact and lag.
No comments:
Post a Comment