Jump to content

Loss of detail in physics shape


Hieronimos Audeburgh
 Share

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

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

Recommended Posts

Hey all!

somehow I can't get the proper physics for a castle I'm building. 

Below is the physics shape from file, using exactly the same file as the normal model. As you can see it's totally unusable as a physics shape; because of the errors, but most of all because there's all sorts of details included that are absolutely unnecessary for the physics model.

Physics_02.jpg

 

So I decided to make a simplified model for the physics, basically deleting all unnecessary details from the original file, leaving only the walls and the floors, including the staircases, in other words, only those things which absolutely require a physics shape (leaving only cube shapes: all prism-shapes, tapered edge shapes, arches, roofs, barrel vaults, etc. have been removed). 

When attaching this separate file for physics, however, I get the result shown below:

Physics.jpg

The staircases (A) have turned into one huge cube; all openings in other words have disappeared, making this file unusable as a physics shape. Also, for some reason the tower roofs (B) have been included into the physics shape, while I deleted those from the file as they don't need any shape (not yet anyway) - so there should be no roofs showing in the physics shape at all at the moment.

I've tried uploading a single staircase, with a separate physics file attached to it and then there is no problem and the shape is exactly how it should be. I've tried this for other elements also: again no problem. Stil, when I delete almost everything in the physics file, leaving only the staircase, and attach it to the castle model as a physics shape again it turns into a large cube.

I've pretty much tried everything I could think of: I just can't find out what's happening here. 

Does anyone know how I can keep the required detail in the physics shape and/or why this is happening?

Thanks!

Jay

 

Link to comment
Share on other sites

I'm guessing here, that your model has multiple mesh objects in it, and that your physics mesh has the same number but not in the same order. Unfortunately, the uploader associantes visible mesh objects and physics objects solely according to the order they appear in the collada (dae) files. So it is essential that the order of physics mesh objects matches the order of the visible meshes. Otherwise you get the wrong shape associated with the wrong object (as in getting a box for the staris). Each physics shape is also stretched and/or squeezed so that it fits the bounding box of the associated visible object. That's why the box fits the stairs although it may have been supposed to fit an object of different size.

In Bkender, thanks to Gaia et al., this can be solved by using appropraite naming, with a postfix indicating the LOD/physics, something like <xxx_hi, xxx_med.xxx_lo, xxx_lwst, xxx_phys> where xxx is the same for corresponding objects, for the LOD and physics meshes. Then if you select the "Sort by Object name" collada export option (automatically selected by the SL presets), each file will have the objects in the same alphabetic order of xxx. I don't know if/how you can define the order of objects in other software. Maybe others can say. In all cases you also need to have the same number of physics objects as visible objects (not strictly true, but you need to be even more careful if you do).

Link to comment
Share on other sites

By the way, if it is indeed lots of objects, you might see undesirable LOD behaviour as you move the camera away. Each object switches LOD at a distace proportional to the length diagonal of its bounding box. So smaller objects will switch at nearer points than larger. Some of this can be avoided by combning into larger mesh objects, although there is a compromise to be made because this will increase the download weight part of the LI. It's also harder to make effective physics shapes the more complex a mesh object is, and you are limited to eight texture faces per mesh object.

Another important thing with triangle-based shapes (as in your upload view - no "Analyze") is that the shape will switch to Convex hull if any dimension is less than 0.5m, closing off holes for doors etc. This can be a problem with a thinner wall as one separate mesh object. This does not apply with "Analyze"d shapes which are collections of convex hulls.

Link to comment
Share on other sites

Hey Drongle!

Thanks a lot for this very useful info! I think indeed the problem is in the names of the separate mesh objects; I never had a problem with that before but this model has a far more simplified physics shape than my usual builds, so I guess I was just lucky till now. 

I also didn't know that not analyzing less than 0,5m objects closed openings... Is the opposite, namely that <0,5m objects may have unintended openings on the sides, also true? 

*Enthusiastically continues the building*

Thanks a lot!

/Jay

Link to comment
Share on other sites

Hi

An example of a physics mesh for a simple castle:

Castle Physics.png

 

The physics mesh is coloured just to show better the different elements.

When using this hull "box" method to create the physics shape make sure the boxes don't overlap (leave a little space between each part) Doing that insures you end up with the exact same physics shape that you create in your 3D software when it is Analyzed in the mesh uploader.

When using the Hull method and Analyzing there isn't a problem with wall thickness or "unintended openings on the sides"

Link to comment
Share on other sites

"Is the opposite, namely that <0,5m objects may have unintended openings on the sides, also true? "

I don't think so. Both triangle-based and convex hull (Analyzed) sjapes can be penetrated, expecially if you are moving fast. With CH shapes, you get pushed our, but with TB shapes you can get stuck between the two faces if the wall has two sides. Your best bet is probably to use Analyze, following Aquila's advice about non-overlapping parts. They physics weight may be a bit higher than the optimised TB equivalent, but it's much easier to optimise and has less problems inworld.

Link to comment
Share on other sites

For completeness  here is an example of a triangle based (planes) physics shape for the castle and underneath is a comparison of the LI weights of the 2 types of Physics mesh . As drongle said the Physics weight is a lot lower when using the triangle based mesh for physics.

Castle Physics Planes.png

When using this method always avoid using small triangles in the physics mesh. Small triangles = a higher Physics weight. For this reason the faces making up the thickness of the walls are often deleted but because castles have thick walls its ok to use them here. The bigger and fewer the triangles used in the physics mesh the lower will be the Physics weight .

Link to comment
Share on other sites

Thanks again for this very helpful info Aquila and Drongle!

I guess a combination of analyzed cubes (especially for the steeper staircases) and non-analyzed planes for the bigger parts would be the ideal solution; especially since the castle is generally speaking one big box with rooms and corridors chisseled out.

Is it possible to have one analyzed cube-based upload for the smaller parts and a non-analyzed planes upload for the big parts linked into one object in SL while maintaining the specific physics properties of both, or would this negate the effect?

Also, Aquila, in your example using planes/triangle based shapes... If I understand correct the walls, towers and ramp are also solid? In that case a physics count of 1.0 is... Astounding : )

Link to comment
Share on other sites

"Is it possible to have one analyzed cube-based upload for the smaller parts and a non-analyzed planes upload for the big parts linked into one object in SL"

Possible only if you upload them separately and link them inworld. The "Analyze" applies to the whole of an upload, whether it's one mesh or many (which end up as a linkset). So you can't mix them in one upload.

Link to comment
Share on other sites


Hieronimos Audeburgh wrote:

 

Also, Aquila, in your example using planes/triangle based shapes... If I understand correct the walls, towers and ramp are also solid? In that case a physics count of 1.0 is... Astounding : )

 Yes.

You can actually see the collision shapes inworld from the Develop menu at the top or your viewer.

     Develop > Render Metadata > Show Physics      

http://community.secondlife.com/t5/Mesh/Problem-with-home-mesh/m-p/1787413#M18544

And Yes its often a good idea to upload things that can /will only be seen from the inside of a building separately. Not just because you can use a different Physics model type but because you can work on the LOD models separately and so save a lot of LI costs .

 

Link to comment
Share on other sites

Well, I'm only just learning, but it seems a good physics model actually helps to reduce land impact. Besides this, the more realistic the physics, the more realistic the experience - of course, for as far as it's within possibility. With a normal house one generally doesn't end up on the roof, but as in case of a castle (or at least this one), the top of the walls/roof are meant to be an active part of the experience. At least some form of physics for the towers/roofs can be handy in that the camera will sense when there's an obstacle in between the camera and the avatar - especially when there's multiple obstacles this can be quite annoying.

Link to comment
Share on other sites

Hi :)

The physics mesh has to extend to the bounding box of of the castle in some way and as the triangles making up the turrets are quite large they don't add much to the physics weight .

Remember this is a triangle based physics mesh so, for the tops of the walls .. they needed filling in because the walls are so thick if someone on the roof of the castle decide to promenade along the tops of the walls they would fall down between the inner and outer collision walls. If the walls had been normal house thickness (say less than 0.2m) the filling in maybe wouldn't have been necessary.

  For the side walls of the ramp .....well the stairs are over 2 meters high so they need a collision walls at the sides and at the rear to stop avatar walking through the visual mesh .

 

 

Link to comment
Share on other sites


Hieronimos Audeburgh wrote:

Well, I'm only just learning, but it seems a good physics model actually helps to reduce land impact. Besides this, the more realistic the physics, the more realistic the experience - of course, for as far as it's within possibility. With a normal house one generally doesn't end up on the roof, but as in case of a castle (or at least this one), the top of the walls/roof are meant to be an active part of the experience. At least some form of physics for the towers/roofs can be handy in that the camera will sense when there's an obstacle in between the camera and the avatar - especially when there's multiple obstacles this can be quite annoying.

I did not know that some physics would reduce LI more than no physics. I just assumed it always potentially added, never subtracted. 

 

I dont understand what you mean about the camera sensing physics, tho.

Link to comment
Share on other sites


Aquila Kytori wrote:

Hi
:)

The physics mesh has to extend to the bounding box of of the castle in some way and as the triangles making up the turrets are quite large they don't add much to the physics weight .

Remember this is a triangle based physics mesh so, for the tops of the walls .. they needed filling in because the walls are so thick if someone on the roof of the castle decide to promenade along the tops of the walls they would fall down between the inner and outer collision walls. If the walls had been normal house thickness (say less than 0.2m) the filling in maybe wouldn't have been necessary.

  For the side walls of the ramp .....well the stairs are over 2 meters high so they need a collision walls at the sides and at the rear to stop avatar walking through the visual mesh .

 

 

I understand -- it is larger than it looks. 

 

PS As far as stopping people from walking under the ramp, I would probably just let them walk under it if they wanted to, and figure if they got stuck under there they would have learned their lesson! :smileytongue:

 

Link to comment
Share on other sites

"I did not know that some physics would reduce LI more than no physics. I just assumed it always potentially added, never subtracted."

 

Well, no physics at all would of course bring down the physics weight, but I doubt it'd reduce the land impact as server and download weight are bound to be the dominant factor when determining the LI of such a build.

 

"I dont understand what you mean about the camera sensing physics, tho."

 

I don't know whether physics is the only thing of influence on this, but let's say your avatar is standing in a small room; when there's no physics the camera will go through the walls, roof, etc. just like your avatar can walk through them. Because the camera doesn't sense the obstacle as being an obstacle, you'd have to constantly change the camera view manually in order to see what's going on inside the room. 

Link to comment
Share on other sites

Hey again!

apparently I'm still doing something wrong...

 

The visual model:

Visual_SL.png

 

The physics shape as it should be (in Blender):

Physics_Blender.png

 

The physics shape how it turns out in SL after after attaching it to the visual model as a physics shape and analyzing (the box/hull mehthod), shape set to "prim":

Physics_SL.png

 

I made sure I left space in between the different boxes... Anyone have ideas why is the physics shape still not showing up properly?

Thanks in advance!

 

 

Link to comment
Share on other sites

What it looks like is happening is that one of your physics meshes is being stretched to the bounding box of the complete castle.

 

If your castle is made up of more than one mesh object  try uploading only one part along with the appropriate Physics mesh .

IF you then still have a problem post an images of that mesh object and its Physics mesh but this time in Edit mode and also of how it looks when rezzed and set to Physics Shape type Prim when Show Physics is enabled.

If your castle is a single object  check that all those "boxes" making up the physics mesh are one object as well. It really looks like only a couple of those boxes are being used ....

Also there is something wrong with the lower part of your physics mesh. It doesn't seem to correspond with the mesh  Like its missing the lower 2 meters?

 

Link to comment
Share on other sites

I agree with Aquila's assesment. Make sure you have the same number of Blender objects in the exported models for pjysics as for the high LOD. Also, make sure you have applied rotation and scale for each object. (Then the rotations in object mode should all be zero, and the scales all 1 - I can only see how the two hulls we see came from one of your meshes if it was rotated).

Finally, make sure the object names have the same alphabetic order in the physics mesh as their coresponding objects in the LOD mesh.

I think your physics mesh could be quite a bit simpler too. Remember that the physics is invisible.

 

 

 

 

 

 

 

 

Link to comment
Share on other sites

Got it! : D

The problem was indeed a combination of stretching to bounding boxes, rotations and errors in object naming/object order : )

After I got the box/hull method to work I tried some experiments with plains physics... And now with all the necessary details like open arrow slits, it's 5.0 physics and 5 LI total (5.5 download weight wouldn't allow me to go lower anyway : ) So, perfect : ))

Thanks both of you lots for helping me wrapping my mind around this issue! : )

 

Link to comment
Share on other sites

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