Jump to content

Strange land impact


Madeliefste Oh
 Share

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

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

Recommended Posts

It doesn't matter what psysics. In both cases prim or convex hull this land impact shows up.

As long as I have the object in a size of 2,4 m height and 2,0 m width the LI is 1.
I think I should finetune the LOD levels a bit, to see if I can get better LI results for bigger size.

 

Link to comment
Share on other sites

My guess would be that the downsizing of the mesh makes the physics hull TRIANGLES more condensed, and hence an increased LI (due to the smaller triangles being penalised in relation to physics calculations).

I've had similar experiences with stairs of my own - even with an optimised physics hull, the overall LI increased when i shrunk down the stairs - and I am pretty sure it was due to the physics triangle compression.

My guess is that your model is experiencing the same effect here (although difficult to tell without seeing the physics hull mesh).

:matte-motes-smile:

Link to comment
Share on other sites

I can make some statements about expected behaviours, one or more of which may contain the explanation....

1. Traingle-based physics shapes (the kind you get if you specify a mesh but don't click "Analyze" and choose type "Prim") increase in physics cost wioth decreasing size.

2. Convex hulll-base physics ahapes (either the default you get by choosing "Convex Hull" type or the decomposed shape you get by clicking "Analyze" then set type "Prim") do not change with size.

3. The automatic LOD generation is non-deterministic, meaning it can give different meshes on different occasions despite identical inputs. These can sometimes result in different download weights.

4. If (some of) the mesh has no UV coordinates, the uploader seems to use uninitialised data, which can lead to large differences in download weights.

 

Link to comment
Share on other sites


Drongle McMahon wrote:

I can make some statements about expected behaviours, one or more of which may contain the explanation....

1. Traingle-based physics shapes (the kind you get if you specify a mesh but don't click "Analyze" and choose type "Prim") increase in physics cost wioth decreasing size.

2. Convex hulll-base physics ahapes (either the default you get by choosing "Convex Hull" type or the decomposed shape you get by clicking "Analyze" then set type "Prim") do not change with size.

3. The automatic LOD generation is non-deterministic, meaning it can give different meshes on different occasions despite identical inputs. These can sometimes result in different download weights.

4. If (some of) the mesh has no UV coordinates, the uploader seems to use uninitialised data, which can lead to large differences in download weights.

 

4 is not the case, the complete mesh has UV coordinates.

Actually I'm not sure I get the meaning of 'convex hull'. In my mind convex hull was just another name for physic shape, but now you speak of triangle based physics shapes and convex hull based physic shapes, I conclude this cannot be the case.

Can you please explain or show what exactly is the convex hull?

Link to comment
Share on other sites

Google produces some rather obscure mathematical definitions of convex hulls in terms of sets, which are not terribly easy to grasp. So I will have a go. I stand ready for any necessary corrections.

In two dimensions, it's quite easy. If you have  a set of points (the vertices of your mesh), then the comvex hull is the subset of those points which touch an elastic band shrunk around the whole group. It's called convex, the opposite of concave, because every point can lie on a line in such a way that all the other points are on the same side of the line. In other words, if you roll the shape along while it rests on the line, every point will have its turn touching the line. If the set of points is concave, there is at least one point that never touches the line.

This is illustrated in the first picture. On the left is a 2D convex shape. In the middle is a shape with a concavity. The highlighted point will never touch the line as you roll the shape. Since the first shape is already convex, its convex hull is all its points. To obtain the convex hull of the middle shape, we have to omit the point that never touches the line, the point that makes it concave. That gives the shape on the right which is the convex hull of the middle shape.

chull_2d.png

It gets more difficult in three dimensions. The rubber band analogy is often extended in descriptions that describe the convex hull as the shape of a shrink wrapped membrane around the shape. This is a useful description, but not quite accurate, as, unlike rubber bands in two dimensions, shrink wraps can form saddles thst are concave (as in the last example below).

I think we can, however, extend the rolling analogy. So the convex hull is that set of points, vertices of the mesh, that can touch a flat surface as we roll the object around in all possible ways on the surface. All the other points, that never touch the surface, fail to do so because they are causing concavities in the surface. When these are removed, we have the convex hull.

Here are a few examples. First, a torus. The mesh is shown on the left. All the highlighted points will never touch the surface as we roll the torus around. So these have to be removed. We are left with the points on the right, all of which will touch the surface at some angle of rolling. This, the convex hull of a torus, is in fact the physics shape used for sculpties. It satisfies the generally round shape they were originally intended for, while having two flat parts that allow it to have a natural resting position.

chull_torus.png

The convex hull of the torus still has many points, as do those of any convex rounded shapes, such as the sphere. These are still quite expensive in terms of physics weight, which is why using convex hulls does not automatically result in low weight. The second example is the opposite. It is a complicated but very concave shape. However it is rolled, it will always rest on just four of the points. So its convex hull is a cube, with just eight points.

chull_pointy.png

Finally, here is the problematic saddle shape, that can appear in shrink wrapped membranes. This is another example where the convex hull is much simpler than the original mesh. Again it is just eight points. It will have a low physics weight (0.36).

chull_saddle.png

I have deliberately tried to talk about the convex hull as a set of points, as opposed to a mesh with vertices. The diagrams do show surfaces, because it is easier to visualise them that way. In reality though, the convex hull as uploaded to SL is simply the list of points. It does not include any information about edges, triangles or polygons, as these are not required for the simpler collision calculations that the physics engine uses for convex hulls. I have no understanding of the details of these calculations, but I am assured that the use of convex hulls allows much more efficient collision detection than shapes that are defined as triangles (unless the triangles are very big).

Only triangles calculations can allow shapes to be concave (like rooms you can go inside). The uploader provides a compromise between the computationally expensive trangle-based shape and the default convex hull for the whole mesh. That is invoked when you click the "Analyze" button. It then tries to make an approximation of the collision shape as a collection of multiple convex hulls. In suitable cases, and where the resulting hulls are few enough and simple enough, this can provide more computationally efficient collision calculations that the triangle-based shape, while still allowing the overall effect to be concave. This process is called decomposition.

Either kind of shape, decomposed or triangle based, is only used, for collisions and for weight calculations, when you set the physics shape type of the rezzed mesh to "Prim". You can't have both available. You have to make the choice at upload time. When the physics shape type is et to "Convex Hull", you are using the default, undecomposed, convex hull of the whole mesh. You can never go inside a single-mesh room that has this physics shape type. This is always available even if you don't specify a physics mesh at all. The "Prim" type is only avaiabl;e if you did specify a physics mesh.

ETA - whoops - a small error in the third picture. The two lowest points at the back should not be highlighted ....sorry.

ETA - I also note one thing I am uncertain about. I could have drawn the torus convex hull with a vertex at the centre of the top and bottom. Now if we started with that shape, should the central point in the top and bottom discs remain in the convex hull or be removed? I think it should be removed, as the mathematical definitions talk about a minimum set. In that case, the rolling definition is not really sufficient, as that point will touch the surface and would not be marked for removal. Something about removing internal points from faces touching the plane would have to be added. The same applies to the points removed along the edges in the last figure.

  • Like 2
Link to comment
Share on other sites

For completeness concerning the original question, here is a flight of steps. The middle and right show the convex hull before and after removal of redundant points, those lying within or on the edges of on a flat plane on the surface of the hull, as highlighted. This convex hull has 12 points, which should give a physics weight of 0.52 (that is 0.04 * [number of points + number of hulls] ).

chull_steps.png

Link to comment
Share on other sites


Madeliefste Oh wrote:

I did make better models for the several LOD levels. Result: LI 1 for the whole lenght
:)

 

Lodfinetuned.jpg

Nice! I thought 2 would be a good LI but 1 is even better, Plus, if you link the stairs together, you might even gain another prim out of the set.

Yeah, plastic wrap around the object is a good way to think about convex hulls. Even if you think you need a prim physic shape, you could break up the model and get the same affect with 2 or more convex hulls, saving more prims.

Link to comment
Share on other sites

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

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...