Jump to content

Physical mesh, Prim, and Convex Hull ... How, when, why ?


Gaia Clary
 Share

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

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

Recommended Posts

Some results of a few experiments:

 

  1. Upload a mesh without phyical shape definition
    I end up with an autogenerated convex Hull. From my experiments it looks like this hull is generated from the highest LOD3 shape. Meshes created like this typically show high prim costs and the physics boundary is a convex hull and can not be changed.
  2. Upload a mesh with explicitly telling to use LOD3 shape as physics shape
    The primcosts are similar to above. But now i can switch between the Convex Hull and the Prim type (in the object editor, look in the features tab -> "Physics shape type" When i use the "Prim" type the costs get higher, but on the other hand the physics shape seems very acurate and the object behaves physically almost correct. By default a mesh rezzes with prim type "Convex Hull" even if it has a physics mesh.
  3. Upload a mesh with explicitly telling to use the LOD1 shape as physics shape
    The primcosts go significantly down. I still have 2 Physics shape types to choose. By default a mesh rezzes with prim type "Convex Hull" even if it has a physics mesh.
  4. Upload a mesh and explicitly tell to use a highly optimized physics shape instead of the lowest (LOD0) shape.
    Depending on the shape type i get one of 2 situations:
    • Either the prim costs go down again significantly.
    • Or sometimes i can see a weird behaviour:
      The streaming cost display turns to "0". I can import the mesh,
      but when i try to rezz it, it won't rez and silently fail without visible notifications.
      In that sense the streaming costs of "0" makes some sense to me ;-)

Is that intended behaviour and if so why ?
Here is my expectations which may be wrong,
but thats what i think would make more sense as default behaviour:

 

  1. Upload a mesh without phyical shape definition:
    Use the lowest LOD0 shape as physics shape.
    Allow to switch between "Convex Hull: based on that shape
    and "Prim" essentially being the LOD0 shape itself.
    Default shold be the physics type "Convex Hull" (because i have not specified a shape.
  2. Upload a mesh with explicitly telling to use one specific LOD-shape as physics shape
    Allow to switch between "Convex Hull: based on that shape
    and "Prim" essentially being the specified shape itself.
    Default should be the physics type "Prim" (because i have specified a shape)
  3. Upload a mesh with a sepcialised physics shape:
    Same as 2.) above

 

Would that make sense ?

Link to comment
Share on other sites

  1. Upload a mesh without physical shape definition.  I end up with an autogenerated convex Hull. From my experiments it looks like this hull is generated from the highest LOD3 shape. Meshes created like this typically show high prim costs and the physics boundary is a convex hull and can not be changed.

 Correct. A convex hull is expensive if it has numerous surface vertices. This will always be the case for rounded shapes and quite often for angular shapes. This is one of the main reasons you need a physics shape. It is also why the change that made the default CH from all meshes from the high LOD was recently reverted.

    2. Upload a mesh with explicitly telling to use LOD3 shape as physics shape.  The primcosts are similar to above. But now i can switch between the Convex Hull and the Prim type (in the object editor, look in the features tab -> "Physics shape type" When i use the "Prim" type the costs get higher, but on the other hand the physics shape seems very acurate and the object behaves physically almost correct. By default a mesh rezzes with prim type "Convex Hull" even if it has a physics mesh.

 This will use the triangles of the supplied mesh as the basis of the physics shape. It is accurate if you use the high LOD, but will always be expensive. Using a defined physics mesh can be much cheaper and give adequate accuracy. All meshes default to physics type CH.

    3. Upload a mesh with explicitly telling to use the LOD1 shape as physics shape. The prim costs go significantly down. I still have 2 Physics shape types to choose. By default a mesh rezzes with prim type "Convex Hull" even if it has a physics mesh.

 Yes, but the things that make a good low LOD and the things that make a good physics shape are different (think of always closed windows in a wall). So the low LOD will never be the optimum physics shape.

    4. Upload a mesh and explicitly tell to use a highly optimized physics shape instead of the lowest (LOD0) shape.     Depending on the shape type i get one of 2 situations: * Either the prim costs go down again significantly. * Or sometimes i can see a weird behaviour:  The streaming cost display turns to "0". I can import the mesh, but when i try to rezz it, it won't rez and silently fail without visible notifications. In that sense the streaming costs of "0" makes some sense to me ;-)

 The second case is a bug.

--------------------------------------------------------------------------------------------------------------------

    1. Upload a mesh without phyical shape definition: Use the lowest LOD0 shape as physics shape.  Allow to switch between "Convex Hull: based on that shape and "Prim" essentially being the LOD0 shape itself. Default shold be the physics type "Convex Hull" (because i have not specified a shape.

   2. Upload a mesh with explicitly telling to use one specific LOD-shape as physics shape  Allow to switch between "Convex Hull: based on that shape and "Prim" essentially being the specified shape itself.  Default should be the physics type "Prim" (because i have specified a shape)

   3. Upload a mesh with a sepcialised physics shape:  Same as 2.) above

I don't think you can generalize. The lowest LOD will not always be a suitable physics shape, especially if the high LOD has protrusions that are removed in the low LOD to reduce streaming costs. In that case the protrusions would be effectively phantomised. It isn't very difficult to switch to the Physics tab and select which LOD you want to use! In general I would always make an explicit physics mesh. For example, with your kettle, do you really need the depression in the top in the physics shape? Wouldn't a simple hexagonal cylinder do?

I'm not sure about the default. The default CH is made from the physics shape mesh if you specify it (explicitly or by choosing a LOD mesh). In that case, the default should always be lower cost than the triangle-based "Prim" shape (I think). You don't want to find you can't rez something because of parcel prim limits when you could have rezzed it if it was the CH. When they did start making the default CH from LOD3 for a while (Aaaarrrgghhh-monstrous first-rez physics costs), I did make a feature request for a radio button to pick the default physics type at upload time, but I think that may not be needed since that change was reverted.

Next installment - decomposing your physics shape? :matte-motes-confused:

See: https://wiki.secondlife.com/wiki/Mesh/Mesh_physics which is a bit hard to read, but does contain the explanations for all of this.

Note that the new-format-experimental server is giving hugely increased physics costs. I sincerely hope that is a bug.

Link to comment
Share on other sites


Gearsawe Stonecutter wrote:

I remember Drongle saying something about the LODs being a little random on how they are generated. If you choose LOD0 for the physics shape and silently fails usualy the case I found LOD0 is a trianlge lieing perfectly in a flat plain with no thickness.

This is a good hint! So physical shapes need physical dimensions then ? Actually i added a single triangle to get 2 submeshes (faces? surfaces?)  because the object itself has also got 2 (kettle + handle) So i will check if changing the secnd physical shape from a triangle to a 3 dimensional simple object will fix the issue.

Question: Why do all objects actually need a physics shape when rezzed ? Theoretically a rezzed object could always be a phantom with no physics until you decide to make it physical (and enable its CH, or Prim shape)... Would that make a difference regarding resource costs ?

Question: When an object gets attached to an Avatar, then its physical shape is deactivated, correct ?

Link to comment
Share on other sites

I have used physics shapes made of flat one-sided planes. They work. They are cheap. They get eliminated with solid decomposition, but not with surface decomposition.

Phantom does not affect the physics cost in the edit dialog. Type "None" does set it to zero, but it has to be a non-root part of a linkset for that.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4701 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...