Jump to content

Mesh Physics & Script Impacts experiment


Toysoldier Thor
 Share

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

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

Recommended Posts

Yes I know the Mesh smart ones know all this but this is for Pamela and any mesh noobs that also want to know.

So I am working on a project where I am creating Music notes.  One of them is a note symbol that will be used as an entry archway.  But when I uploaded the first one and rezzed it in, I noticed that I could not walk through the archway.  The picture below show as far as I could get before getting blocked.

Snapshot_001.png

The 1st one that I am trying to wlak thru was imported with Physics.  The LOD was at its lowest of 10 and the preview physics structure showed that the physics was only in the legs - not in the gap.  Yet when I rezzed it - you can see I cannot walk thru it. 

So I looked at the Physics Shape Type and I noticed that convex Hull was selected.  With a hollow prim, if you select Convex Hull - the hollow space is physics covered.  But I didnt think this was the case for Mesh.  So I selected PRIM.  When I did I was able to walk thru the arch and bump into the legs (as I would expect).

This first Note Arch had a Rez LI of 1.4 with only 3 LODs (lowest used lower) and lower set at 10 vertices and with a texture.

When I resized it from its initial size of 2.5x2.5x.9 to the size you see of 10x10x3, the LI flew up from 1 to 17.

So I thought I would do a test and I uploaded the same mesh and this time I did not set a physics at all.  Everything else was set the same.  I was thinking "Well if a mesh comes into SL with NO Physics - it should be much more LI efficient right?"

The 2nd arch you see has no physics and its calculated LI was almost identical at just under 1.4 even though it had no physics.  When I rezzed it beside the other one and increased its size to the same 10x10x3, it ended up having the identical LI of 17 even without physics.

Also, this mesh lost a physics shape type of "PRIM" and only had Convex and NONE.  So the only way to walk thru it was to set it to phantom.   So... now I have a Mesh with no uploaded physics AND set to Phantom and yet once again my mesh with the same startnig LI as my first mesh with physics has the same LI when 10m large.

So then I decided to add a script to both these 10Meter mesh models and it did not change the LI at all.  Heck I even added 7 scripts into the meshes and it did not change the LI.    BUT, when I reduced the meshes down to its initial rez size of 2.5m, everything changed!!

For the first mesh with physics the LI only dropped from 17 to 13.  But for the Mesh with no physics the script loaded mesh dropped from 17 to 1.  wha???  why would a mesh with physics and scripts get hit with such a massive LI impact vs a mesh with no physics?  What does physics have to do with a script being in the mesh or not?  That doesnt seem to make any sense at all for LI calculation?

But what Kwak was trying to say on script impact on large mesh makes sense.  I do feel bad for anyone that has to create a mesh with scripts AND physics.  If you want to avoid a huge script penalty on a mesh - try not to make the mesh with physics.  Scripts penalties seem to be 0 on meshes with no physics.  Not sure the LL logic on that but ohh well - good to know.

 

Some other questions I have:

 

  1. Why can I not select NONE as a physics type?  I get the error "you cannot set the root prim to have no shape".  What??? I wasnt setting a shape - I was setting a Physics Shape Type.  And this mesh has no Physics so why cant I set the shape type to none?
  2. Related to Q#1, I rezed a prim cube and linked it to this mesh and then tried to set the mesh to NONE.  But even though the cube was the Root, I still got the error.  So what is the purpose of the Physics Shape Type of NONE?
  3. Why in the Upload Mesh Model interface can I not select a Physics LOD of NONE?  The only way you can set the Physics to NONE is if you never touch the option at all.  If you happen to change it to any LOD and then decide you would rather set it back to NONE - you cant.  You need to cancel and restart the Upload Model and not touch the LOD parameter.   Why is NO LOD not an option?

  There you have it.  So Mesh Smart Ones... what are your answers and thoughts?

 

Link to comment
Share on other sites

I'm not overly mesh-smart as you call it, but #1 is what it says. The root prim cannot be set to type 'none'.

You can do it for all childprims however. I like to think of it as setting the child prims 'phantom' (even if that may not be an entirely accurate comparison).  This works marvelously with prim builds and sculpties as well and helps to save on LI in many cases.

#2 Are you confident the cube was root? It *should* be working that way, perhaps there is a bug?

#3 Not sure on this, i always supply custom physics shapes. They are quick to build and i suspect if you do not need accurate collision, then putting a simple box shape might be lighter than convex hull but that is me just guessing.

If i am reading your post correctly and physics are driving up your LI on the big notes, then creating a simple U-shape from a poly box could possibly greatly improve your LI.

 

Link to comment
Share on other sites

No I am not sure now that you say that if the root prim was the cube then it should have worked.  I will have to go back and try it again.

As for the physics shape, I didnt create a Custome LOD but I set the LOW LOD to 10 vertices which was just high enough to place physics into the legs of the note.  BUT, why does the initial rez physics shape type get selected to CONVEX if it should be PRIM for a mesh's physics to collide properly?  Convex type seems to be doing to my mesh what it does to any other prim like a torus.  I just set it to Prim and my physics was being honored.  I could walk thru the arch and I would collide with the legs.

As for your last statement... thats not exactly what I said.  I said that when the Notes are resized to 10meters, both scripting and physics factors on either note had NO IMPACT.  It seems like just the download factor of that large mesh size was the largest LI factor and therefore it seems that this trumped any factors to scripts or physics.

BUT....

The part that makes no sense is that when I resized both mesh notes back down to 2.5meters, the mesh with physics & scripts got hard realllll hard with LI (LI=13 when it was LI=1 without scripts) yet the mesh with no physics was not hit at all by the the 7 loaded scripts in its mesh (i.e. LI=1 with or without the 7 scripts).

Question.... why is my mesh with physics being penalized so hard for having a script vs my mesh with no physics??   This makes no sense in calculating LI.

Based on this current logic, if had a mesh that needed a script - I would try to upload it WITHOUT physics or else the mesh will be slammed for have having a script. 

Makes no sense to me.

Link to comment
Share on other sites

(Just a quick reply (typing this on my work break!))

With physics for mesh, especially for a complex organic shape such as this example, it is highly recommended you create a separate, low triangle count mesh to use as physics hull. This mesh is selected in the physics tab of the uploader menu. All that this mesh does is simulate interactive physics - it isn't visible at all.

A physics mesh (often referred to as a physics hull) really only needs to describe basic interactivity for AVs... such as boxes or similar primitive shapes to represent the legs of your mesh, for example. Ideally, if you keep your physics mesh very simple in triangle count, with LARGE triangles instead of lots of tiny ones, the physics cost will actually be very low - probably less impact than the overall land impact of your original mesh.

Basically - The more complicated a PHYSICS MESH is, the higher its associated Land Impact cost - this is purely due to how difficult or easy the shape is for the SL physics engine to work with. Large, flat surfaces with few triangles are actually MORE EFFICIENT than complicated surfaces with lots of small triangles. Also, the BOUNDING BOX (the total volume) of your physics mesh should match the bounding box of your original mesh (so that it aligns correctly, when the uploader combines the main mesh and the physics mesh).

I am pretty sure that with a relatively simple, low triangle count PHYSICS mesh, you should retain your original Land Impact cost of your main mesh object.

:matte-motes-smile:

Link to comment
Share on other sites

OK I went back and did the root prim test again as well as I went thru all the tests on resizing and script insertion and ressize reduction......

1)  Yup I got the prim cube backward.... when it was the root - the mesh was allowed to be NONE.  Mystery solved on that one

 

2)  Now this doesnt make sense so I guess it was just a Beta sim lag or anomaly, because when I rezzed the two notes again, both had an LI=1.  Then resized them both to 10x10x3 like last time and both had their LI increase to 17.  I added 7 scripts to both mesh models and the LI stayed at 17 for both.   BUT... when reduce both mesh models down to 2.5 meters this time, both mesh models went to and LI = 1.

so...... at least on the tests I see here on the Beta Grid, Script and a very low vertices Physics on a mesh doesnt seem to have any impact to the mesh.

This is great news.... but I am confused why adding scripts and adding physics has no LI impact.

Just for Shoots & Giggles I resized both my physics and non physics models to 64x64x20 .  The LI skyrocketed to 537 on both of them.  Again this indicates that Scripts and Physics has no impact.  The only impact that has any impact to the LI (in a huge way) was the size of the mesh.

 

Link to comment
Share on other sites

Thanks Maeve but as you can see from my last posting, when I went back to the grid and did the exact tests once again.... the LI values were completely different than from the first time I did the test.

I do normally upload mesh with a LOWEST LOD Auto-Generated with a vertices count of 10 then I set my physics to the lowest LOD.  I dont create a custom one as I dont need any specific collision shape but it assures that I cant walk through my art.

BUT Maeve, what I also noticed and posted just now was that Physics or no physics..... it didnt change the LI at all.  Even when I loaded both mesh with 7 scripts.  Scripts and Physics made no difference to my two mesh.

Is the Beta Grid not stable which is why I say inconsistant LI results between the two tests? 

Link to comment
Share on other sites

I am pretty sure that 'convex' is the default setting an item will have when you rez it. No matter if how physics are uploaded.

As for the physics sizing problem, i did a quick test with one of my objects and the results were rather wierd.

The same object at different sizes with custom physics shape and set to prim type.

 

0.4x0.4x0.4

0.3 download

0.4 physics

 

0.5x0.5x0.5

0.5 download

9.5 physics

 

1x1x1

1.7 download

4.8 physics

 

5x5x5

41.7 download

1.0 physics

 

What gives? o.O

 

 

 

 

Link to comment
Share on other sites

Good question.


Aveline Stein wrote:

I am pretty sure that 'convex' is the default setting an item will have when you rez it. No matter if how physics are uploaded.

As for the physics sizing problem, i did a quick test with one of my objects and the results were rather wierd.

The same object at different sizes with custom physics shape and set to prim type.

 

0.4x0.4x0.4

0.3 download

0.4 physics

 

0.5x0.5x0.5

0.5 download

9.5
physics

 

1x1x1

1.7 download

4.8 physics

 

5x5x5

41.7 download

1.0 physics

 

What gives?
o.O

 

 

 

 

Toy I don't see any effect of physics type on script penalty.

Link to comment
Share on other sites

In the building floater where it says...

1 object selected, land impact x

Remaining capacity xxxx,. More info <- click on more info, it will open another window that lets you see all the goodies.

 

edit: you may need to be on Firestorm, LL or another V3 viewer to be able to see it. As far as i know it is not available in Phoenix.

Link to comment
Share on other sites

me neither.  Maybe LL decided to listen and removed Physics and Scripts off the LI factors. :)

Wouldnt that be nice if that were true.   Still doesnt help my specific category of SL business since the one factor that has a HUGEEE factor on LI is the size of the mesh.  My 64meter music notes has an LI of 537.when it was 1 at initial 2.5meter rez size.

 

Link to comment
Share on other sites

So I logged into Firestorm to see these details... and I used the same mesh sizes you did as well as one huge one for my music notes... both with and without Physics and both with 7 scripts loaded in them....

At a size of 25m x 25m x 25m

Mesh with Physics: = 137.0 download / 0.9 physics / 1.0 server

Mesh with No Physics = 137.0 download / 0.3 physics / 1.0 server

 

At a size of ...  0.4x0.4x0.4

Mesh with Physics: = 0.3 download / 0.9 physics / 1.0 server

Mesh with No Physics = 0.5 download / 0.3 physics / 1.0 server

 

0.5x0.5x0.5

Mesh with Physics: = 0.4 download / 0.9 physics / 1.0 server

Mesh with No Physics = 0.5 download / 0.3 physics / 1.0 server

  

1x1x1

Mesh with Physics: = 0.5 download / 0.9 physics / 1.0 server

Mesh with No Physics = 0.7 download / 0.3 physics / 1.0 server

 

5x5x5

Mesh with Physics: = 6.3 download / 0.9 physics / 1.0 server

Mesh with No Physics = 6.4 download / 0.3 physics / 1.0 server

 

Seems consistent for my tests of both my meshes but i do believe your tests were weird as the first time I tested when i posted this thread I saw weird LI results.

 

 

 

Link to comment
Share on other sites

Toy...

1. There is no such thing as a mesh with no physics shape. The uploader always generates a "default" convex hull (shrink-wrap-like with no holes) for the whole mesh. This is the default shape for any mesh when it is rezzed and when it is set to physics shape type "Convex Hull". If you don't specify a physics shape at upload, this is the only shape available (other than "None"), which is why the "Prim" type is not there. If you do specify a physics shape at upload, the "Prim" option appears and it has to be selected to use the supplied physics shape.

2. The LI of the mesh is set to the highest of three independently calculated weights, download, physics or server. Only the server weight is affected by adding scripts (it is doubled by adding any scripts, irrespective of how many). Thus there will be no effect of scripts on LI unless the doubled server weight becomes more than the other weights. This only happens for the simplest meshes, with very low download and physics weights, as the server weight is just a fixed 0.5 per mesh.

3. Here I am guessing - I think the experiment that gave you 13 for the resized mesh with physics shape but 1 for the resized mesh without physics, and then worked differently the next time, was because you had the "Prim" physics shape type selected the first time you did the experiment. This appears to be possible given the order you described your actions. So my hypothesis is that the first time you were looking at the "Prim" type physics weight of 13, which was now higher than the download weight, while the second time you were looking at the "Coinvex Hull" physics weight. (see also below). You can easily test this in anotehr xeperiment.

Aveline...

The effects of size on physics weights are not what you might expect. They refelect the load placed on the physics engine, which hates small triangles but loves convex hulls. The physics weights of convex hulls does not change with size. So the physics weight of a mesh set to physics shape type "Convex hull" is constant.

When you set physics shape type to "Prim", so using the uploaded physics shape, then it all depends whether or not you pressed the "Analyze" button. Pressing this button makes a "decomposed" physics shape which is a collection of convex hulls (see the numbers at the bottom change when you do this). Because they are convex hulls, the weight does not change with size.

If you don't "Analyze", the physics shape is simply the collection of triangles making up the mesh you supplied for the physics shape. Perhaps surprsingly, the weight of this gets larger as the triangles get smaller, because of th extra engine load imposed by smaller triangles. At very small sizes, this can become ruinous. In the beta, we could easily make meshes whose physics weight was more than a whole sim capacity just by shrinking them. So at a certain size limit, the actual physics shape used by the engine switches to the default convex hull even though you have type "Prim" selected. This results in an abrupt drop in physics weight as you shrink the mesh past that limit.

A couple of other points may be worth noting at this stage ...

Convex hulls do not necessarily have low physics weights. Their weights depend on the number of vertices that remain after all the concavities in the surface are filled in. With rounded shapes, this can be quite high. So rounded shaoes tand to produce larger convex hulkl physics weights. This is one of the reasons why it is nearly always better to provide a simplified physics shape specifically designed for that purpose. The complexity reductions that work best for visual appearance are not generall the same as those that work best fopr physics.

This applies even more to decomposed shapes, where the most effective appraoach is to provide a mesh that is a collection of simple (preferably unrounded) shapes that are each already convex hulls. This gives you the maximum control of the ultimate decomposed shape.

Finally, with large meshes where the physics shape provided only has large triangles, the triangle-based physics shape can be less than the decomposed shape, in which case it should be used, as this reflects the lower load on the physics engine. This applies, for eaxmple, to large lanscaping meshes which you want to walk on accurately.

All of this information is implicitly dscribed in the knowledge base  page on land impact and the wiki (this page, and the wiki links therein), although the descriptions there are perhaps a bit too technical for the likes of many users.

 

 

Both...

Link to comment
Share on other sites


Toysoldier Thor wrote:

 

The part that makes no sense is that when I resized both mesh notes back down to 2.5meters, the mesh with physics & scripts got hard realllll hard with LI (LI=13 when it was LI=1 without scripts) yet the mesh with no physics was not hit at all by the the 7 loaded scripts in its mesh (i.e. LI=1 with or without the 7 scripts).

Question.... why is my mesh with physics being penalized so hard for having a script vs my mesh with no physics??   This makes no sense in calculating LI.

Based on this current logic, if had a mesh that needed a script - I would try to upload it WITHOUT physics or else the mesh will be slammed for have having a script. 

Makes no sense to me.

 

You are missing some very important basics here, I'll try to explain....

 

Any object is assigned three weights: download weight, physics weight and server weight.

The landimpact is the rounded off version of the highest of these three values.

If you scale up an object, the download weight will quickly rise, I'll spare you the details. Physics weight is affected by size aswell, but in a different way. Size has no influence on the server weight.

The base value for server weight is 0.5 per object. Add a script to it (or set it to physical so it's affected by gravity) and the value will be 1.0. The number of scripts or its length or its lag production have no influence at all. A script is "a" script in this case.

Assuming your object is a single object rather than a linkset, this means both your objects won't be affected by the scripts, nor CAN they be affected by it. If your object without a physical shape has a lower landimpact than the one with a physical shape ( physics type set to "prim"), that's where you need to look.

Scripts can only affect your LI if the server weight without any scripts is more than half of any of the other two values. A single object (not a linkset) can never have a server weight higher than 1.0. So you'll only see a rise in LI if you have lots of very small items linked together.

You can check the three weights in "edit  -> more" and it would really help if you added them to posts like this.

Link to comment
Share on other sites

Thanks Drongle for the detailed explanantion.  It was helpful.

 

The only part that doesnt make sense but I can see this is the case regardless is that a Mesh MUST HAVE a physics shape.  I know now that you are saying - this is the rule....  but Why?

My understanding is that a mesh has a rez / display shape which is the shape we all see in front of us.  And a mesh has a Physics shape which is an invisible shape in the mesh that is used to deal with collision interaction with other objects on the sim.... i.e. this is the shape that my avatar would bump into but that i cannot see.

Unless my understanding is completely wrong, then IF I decided that I want to have a mesh that requires NO physicial interaction with other objects on the sim.... (i.e. identical to a basic prim with Phantom enabled), why would I be forced to give a mesh model a physics element that it does not need and force the Sim engine to have to put processing power resources to handle the physics of a mesh that does not need physics?

Am I missing something here?  Specially in light of LL Mesh team and their closest follower constantly harping on the deep need to reduce lag at all cost. 

So this poses a couple naive mesh questions to the LL Mesh team.....  Why cant my Mesh Model Uploader have an option that says "NO PHYSICS" and that the sim engine would not force a Convex Hull to be default placed on the mesh?  Wouldnt this reduce sim lag?

Related to this..... since right now I cannot tell the mesh to have NO PHYSICS because LL forces the Convex Hull upon my mesh anyway...... I am forced to make the mesh PHANTOM.   But then as far as I see, even though my phantom mesh should be far more efficient by opting it out of any need to place physics handling resources, my mesh IS NOT REWARDED for reduce lag in the form of a reduce LI.

Why?

I am sure there are many technical reasons but doesnt seem to make sense to me.

Link to comment
Share on other sites

I don't have any explanation for why a mesh cannot be set to physics type "None" when it is unlinked (and thus the root of a one-member linkset). I suppose it must be some requirement for the physics engine on the sim server. Maybe someone else can explain that.

However, as long as you link your mesh to a root prim, you can set it to "None", and then it will incur zero physics cost. The root prim will still have a physics shape, but if it's an undistorted box, that will be only 0.1 (it uses an efficient havok primitive - havok is the physics engine). The server cost of the two-piece linkset will be 1.0 (2.0 is it's scripted). So if you use a tiny cube for this purpose, you can get all the advantage of a zero physics weight for your mesh.

You can do even better if you upload a physics shape with your mesh that is a simple box and will decompose to a single 8 vertex cconvex hull*, that will have a physics weight of 0.36. Then the server weight is going to be only 0.5. The only problem with that is that the physics shape will be stretched to touch the bounding box of the visual mesh on all sides, which may cause obstruction that you don't want. There are ways of working around that by using extra flat triangles and solid decomposition to keep the effective physics shape small. This is described in the text file that comes with the sample mesh door avaialable from the wik. It has also been discussed in this forum. I will add the link if I can find iot.

*In fact you can do better with a tetrahedron etc., but it's already less than the server weight.

Link to comment
Share on other sites


Drongle McMahon wrote:

I don't have any explanation for why a mesh cannot be set to physics type "None" when it is unlinked (and thus the root of a one-member linkset). I suppose it must be some requirement for the physics engine on the sim server. Maybe someone else can explain that.

I'm pretty sure that's exactly why it has to have a physical shape. If you have an object with no physical shape at all and you set it to physical ( yes very confusing, but I mean let gravity affect it), the physics engine has no way of telling when the object hits the ground. In other words it will keep falling.

Not having a physical shape and a prim being set to phantom is not the same. Rezz a box, move it slightly up from the ground (lindenground!), set it to both physical and phantom and you'll see it will drop onto the floor. It will drop through any other items though. This means the box still has a physical shape.

If you link two of these objects together and set the physical shape of the child object to "none", you'll see it will fall through the floor and will only stop when the parent object hits the floor.

Link to comment
Share on other sites

I understand your explanation if that is how the SL Physics engine works.  In theory the physics engine could have looked for the object's lowest Z position coordinate and taken actions of object's Z = Linden Lab ground.  But that is not how the engine was written so no big deal.

Two things...

1)  My brain must be off but exactly how does not take any prim and rez it into the air and let it go whereby it would fall to the ground?  Am I forgetting something?  When I rez a cube and place it at any level and let it go... it stays there.  The only way a cube could drop is if I placed a script in the prim that would tell it to drop.

2)  No one answered why a mesh that is Phantom is not rewarded with a lower LI?  The Physics Engine does not have to deal with a mesh colliding with any other objects that runs into it.  Wouldnt this reduce server lag and thereby be rewarded on LI?

Link to comment
Share on other sites


Drongle McMahon wrote:

1) Make it physical (object tab) then deselect it.

2) I don't know.

Are we talking about a mesh object?  A basic prim will not fall from the sky if you deselect it.  If that were true every skybox in SL would have come crashing to the ground long time ago :)

but i didnt know mesh naturally abides by sim gravity if its put in the air and let go.

Link to comment
Share on other sites

Just tick the "physical" box on the left, that works for any object, as long as it has a physics weight lower than 32 if it's mesh. For sculpts and prims it's a landimpact of 32.

The option could be in the features tab rather than object tab...I'm not sure.

EDIT ..no definately in the object tab, on the left, where you can tick boxes for "Locked", "Physical", "Temporary" and "Phantom"

Link to comment
Share on other sites

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