Jump to content

LOD and Physics - Any suggestions?


Medhue Simoni
 Share

You are about to reply to a thread that has been inactive for 4145 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Running around the Beta grid, you will quickly find that many people are in flux about what to do with LOD. It also seems to me that different types of objects require different LODs. For instance, a building might need to be a really high LOD at medium then possibly a tree or an object you wear. Personally, I don't have much experience with LODs. Looking at some of my own objects, like guns, I'm leaning toward adjusting the medium setting to be about 60-65% of the verts that the High level has. Low at around 30% and Lowest is of little concern to me. Of course, I'm talking about autogenerated LODs. Has any1 else notices that messing with the medium and low settings has little affect on the total prims? Lowest has a major affect tho.

This brings up another point. In the beginning, it seemed pretty obvious that it would be better to generate all of your own LODs and physics models. Now, I don't really see the point, not that it takes that long, but any time saved is a huge plus. IMHO, the uploader has more than enough controls to generate pretty decent LODs and Physics shapes. Sure, you can save a few verts here and there, but overall, I'm somewhat impressed with the range of results I can get.

Sooo.... what do you think about LODs and physics? What settings do you like for specific objects? Do you autogenerate, or make your own? Why or why not?

Link to comment
Share on other sites

Oh dear. Now you will have me writing several pages. I'll try starting with few quick answers....

I am solidified. I think custom-made LOD and physics meshes are essential for economic and responsible mesh building in the great majority of cases.  I never use auto generated LOD for final products (so settings not applicable). Triangle/vertex reductions vary a lot, depending ob the requirements of specific objects. Minimum target is 1/2 per LOD step, more of possible. I rarely use a LOD mesh to make a triangle-based physics shape, especially for buildings, but get much better results with a purpose made physics mesh, usually with decomposition.

There are two reasons for being careful with LOD and physics meshes. First is the effect on the prim cost of the model. This will be either the resource cost (previously called streaming cost) of the visual model, which depends on the LODs, or the physics cost, which depends on the physics shape, whichever is higher. The other reason is concern for the common good - lower resource consumption for less lag. The prim costs are an incentive towards this too, but sometimes the physics costs are predominant and nothing is saved by better LODs of the visual cost predominates and there is no saving from a good physics shape. However, the resource consumptions all add up whether they are limiting for a particular model or not. Therefore it is good practice to pay attention to both whether they affect the final cost or not.  Unfortunately attachments are not limited by prim costs, and in that case we have to rely on the altruism of creators and purchasers to make LODs that will not overburden people's graphics cards.

I did make some graphs to illustrate the behaviour of the function used to calculate the visual (streaming/resource) prim costs. These have changed a bit as indicated in the edit there and I should replace them. However, some important characteristics that are relevant to you questions can be seen.  Note that in the latest viewers there is still a big error in the resource cost shown in the upload dialog. (It uses the object radius to the power 4 instead of 2.) I intend to update these graphs when that is corrected.

First, "different types of objects require different LODs"'. The major effect here is the size of the object. Once the radius (half diagonal of bounding box) of an object reaches a certain size, the successive LODs, starting at the lowest, no longer contribute any cost saving because the LOD concerned is never used. These steps happen at r = 4.33, 8.67 and 34.66 (with the current parameters). So for building, r nearly always > 8.67,  the lowest two LODs can usually be ignored, and the lowest practically always.  Conversely, for small things, the lowest LOD has the major effect on the resource cost, as most observers will be too far away most of the time to see the higher levels.

The levels of reduction you suggest are much less than the defaults (all 1/4; 25%, 6% and 1.6%), and may leave you with rather high prim costs in some cases.

Personally, I usually find it absolutely essential to make custom LOD meshes for all steps. The auto generator has no idea what is and is not important visually. It usually does ugly things unless your high LOD mesh has lots of unnecessary detail. As it is now, it is non-deterministic, doing different things at its own whim. Using the auto LOD invariably means unacceptable compromise of either the cost or the appearance compared with manually produced meshes.

For the physics shapes, it does depend very much on the nature of the mesh. Again it is very dependent on the size of the object, but in the opposite direction. Small triangles are anathema for the physics engine and triangle-based (not decomposed into convex hulls) physics for small objects can prohibitively expensive. For relatively large objects, with only large triangles, triangle-based shapes can be cheaper than the best achievable convex hull decomposition. If you use "Analyze" to make the decomposition into convex hulls, the size-dependence goes away.

There is a big problem with the default single convex hull for shapes with many surface vertices, such as a sphere. The generated hull for these remains very expensive. This problem of unnecessary complexity also often applies to decomposition into multiple hulls.  I have never been able to get anything like as good a physics shape using any of the LOD meshes as starting point as I can by making a mesh specifically for the physics shape. For things you need to go inside, it is completely impossible. Triangle-based shapes can often work well though. All things together, I usually find that I can make huge savings in the physics cost by providing a purpose-made mesh and decomposing it, once I began to understand how to make the decomposer do what I wanted. I like to do this even when the physics cost isn't limiting because that way I know I am minimizing the burden on the physics engine.

Note that all this is probably biased by the fact that I tend to make angular things. The automatic tools for LOD and physics probably work mush better for smoother curvy things, just as they do for sculpties.



  • Like 1
Link to comment
Share on other sites

Thanks Drongle!

Yeah, I been mostly playing around with objects like guns or things that are held in the hand. These things will probably make up the majority of things that I will make. From a strictly mesh efficiency stand point, I totally see where you are coming from. With any object, if you have total control over every LOD then it really can be ultra efficient. My goal is to make super efficient meshes as I hope they will be used in situations where mass amounts of people are playing together.

To be more specific tho, if 1 looks at the gun market, it is hard to find a gun that is less than 20 prims, and uses multiple sculpties. So, those are not hard to beat in efficiency. I do have a couple of 1 prim sculpty guns, but I still think that the mesh 1's will look better and be equally efficient. Currently, my M4 is showing to be 5 prims, using the uploader and tweaking LODs. If I created the LODs all myself, I doubt I could get it much lower than 4 prims, if that. For these types of items that are only going to be 1 - 6 prims, I'm weighing the benefits. I'll sit and make all the LODs for the M4 and see what the difference is.

Link to comment
Share on other sites

I guess guns are mostly used as attachments so the prim count isn't that important. Also all attachments are non-physical so physics shape doesn't matter either. You could use a simple elongated box as the physics shape to keep the cost down for when it's put down, displayed in a shop or whatever. It would have lots of tiny triangles, and a complex convex hull. So a simple physics shape is probably essential if it's ever going to be unattached. If it's around a meter long. you are well inside the range where a really simple lowest LOD would give you good resource cost savings. The user would never see that, although others with default renderVolumeLODFactor might. Then you can be less stringent with the intermediate LODs. Whatever, the same thing made from mesh is certain to be much more efficient in rendering than a bunch of sculpties. (And you won't be carrying around balloons for all new arrivals!) If they are going to be used in a combat situation, I guess anything to reduce load on any resources is wellcome, although this is never to be the overriding resource consumer.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4145 days.

Please take a moment to consider if this thread is worth bumping.

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
 Share

×
×
  • Create New...