Jump to content

What is this LI principle?


Pamela Galli
 Share

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

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

Recommended Posts


Pamela Galli wrote:

Due to scripted windows and doors etc, neither of these options would seem to work very well.

This is another very good reason to include the physical shape in your upload. As I understand it, you need to link a prim to your scripted door the way you do things now and make sure that linkset isn't linked to anything else, or you need a script for both your visible mesh door and your physical SL prim door. If you make the door in mesh with its own physical shape included, you can link the door to anything and it only needs one script.


However, could I have a small cube like up in the attic, with the physics shape for the whole house attached to it? IOW could the bounding box be different? 

Instead of using a seperate physical object, you can "fake" or "make" a bounding box before you actually build the physical shape for your meshes. You can use two single triangles for that, one in the lower corner, one in the opposite upper corner. That way the bounding box is the same, anything in between the two triangles won't change the overall dimensions.

 

 

  • Like 2
Link to comment
Share on other sites

"Instead of using a seperate physical object, you can "fake" or "make" a bounding box before you actually build the physical shape for your meshes. You can use two single triangles for that, one in the lower corner, one in the opposite upper corner. That way the bounding box is the same, anything in between the two triangles won't change the overall dimensions."

Furthermore, if you have their normals pointing inwards and use "Solid" with "Analyze", they will still have the desired effect on the boundinmg box, but should disappear from the final physics shape, thus avoiding unwanted collision effects.

  • Like 1
Link to comment
Share on other sites

Well this IS my attempt to look into it, and things were very much clarified.

Okay one more thing -- the wall shapes should have a back, front, and top only?

Also, right now I have the interior walls of each room joined. Is there going to be any advantage to joining mulptile interior rooms?

 

Link to comment
Share on other sites

I'd go with a back and front only, the ceilings and floors should cover the top and bottom. If the walls are very thick you could add the sides too so people can't walk inside your walls. On the other hand, that could be a feature:).

If you can use a single plane for multiple rooms, that should lower the load. It means less and bigger triangles, both are good for the physics engine.

  • Like 1
Link to comment
Share on other sites

It dependes. Kwak is talking about triangle-based shapes. They are usually the lowest weight optiuon. For these you should avoid including any edges, to, bottom or sides, unless you really need them to collide with. They will make narrow triangles that will push up the weight. If you use "Analyze", that's completely different. The result is a collection of convex hulls whose weight doesn't change at all with size. So for these you get the best results by using solid blocks, preferably not overlapping or connected.

With either type of shape, you usually aim to get the physics cost lower than the download weight. It's rare to need a phyics shape that's higher. Unfortunately you can't see the physics weight until you upload the mesh and set it to type "Prim", because the uploader only tells you the default convex hull weight - the one that's used when you set the physics type to "Convex hull". That is the convex hull of the physics mesh if you provide it, or of the low LOD mesh if you don't. It stops you going inside.

  • Like 1
Link to comment
Share on other sites

I don't understand about triangle based shapes; I thought all shapes were made of triangles.

 

I still don't really know what a convex hull is, other than it sort of shrink wraps things and closes holes. I don't understand Analyze and Simplify either. But hopefully I don't need to know this to accomplish my objective.

Link to comment
Share on other sites

The data used for convex hulls is just a list of vertices.. The havok engine doesn't need to know what the triangles are. When you upload a physocs shape without doing "Analyze", the engine gets the triangles and has to work out whether you are colliding with each triangle. That's expensive. When you do "Analyze" the shape is changed into a set of subshapes, each of which is a convex hull. These have no inward going surfaces, so that every surface can lie on a flat table. The engine doesn't have to know about the triangles for these. It just gets a list of the vertices. From this, knowing it's convex, it can calculate collisions more efficiently than with the same shape made of triangles. That's why triangles are more expensive if you use all those unecessary surfaces, but you don't - you just use the two planes for a wall. Then the triangles  can compete. The engine can also tell whether you are inside a convex hull and push you out. The breaking down of a concave shape into convex components is complicated. That's why it works best if you give it a set of shapes that are already convex - simple non-overlapping shapes without any indentations or L-shapes. Then it will just use these.

  • Like 1
Link to comment
Share on other sites

Thanks, it does not sound like for this project I will need to do anything about physics except make the whole house shape, which I have started on.  Again, thanks to the generous contributors of wisdom in this thread!

 

ETA Uh oh.  I just realized that using the separate physics shape objects means using a rezzer for the house. Back to the drawing board.

Link to comment
Share on other sites


Pamela Galli wrote:

 

ETA Uh oh.  I just realized that using the separate physics shape objects means using a rezzer for the house. Back to the drawing board.

 

I think you're still lacking some fundamental insight in how physics work, that's fine. Or maybe I'm missing the point. I guess that's fine as well.

Anyway, the only three scenarios where, as far as I can think of, you need a rezzer to keep your house in one piece, are these:

- The house is so big it can't be linked.

- The house has scripted doors (or similair) made out of multiple objects that can't be linked to the main structure.

- Some parts of the house are set to "phantom" and some are not.

The first one I don't see a solution for, other than combining small pieces over linklimit of 54 (?) meters apart being merged into one mesh object. The limit in size is 64 meters, so with some clever splitting and linking you should be able to make a linkset well over 100 meters long  (two 64 meter objects 54 meters apart, I'd say 32+54+32 = 118 meters). The second one, as I said earlier, can be fixed by including the physical shape in your upload. The only obstacle is you need to make the bounding box twice the size of the door, so the hinge point, or pivot point is on the edge of it rather than in the centre. This isn't that difficult and Drongle and I showed you the way to do that. The third one can be fixed by either uploading the physical shape in your upload or by linking the seperate physical shape to the visible object. Just make sure the parent or main prim is one of the physical shapes, not the visible ones. Set the physical shapes to either "prim" or "convex hull", depending on how you made the shape, then set all the visible pieces to physics type "none". (You can't set the parent object to "none".) Other than setting the object to phantom, this "none" will remove the object completely from the physics calculation, lowering the load on the servers.

  • Like 1
Link to comment
Share on other sites

Not sure what you mean you would not do.

 

Codewarrior said this:

 

2) make a separate object. Which is i.e. Just simple 6 face box of the size of your house (which you will texture transparent) and apply to this one a physics shape that contains all the walls, floors etc. (Edit - as drongle said: But in this case be aware its a separate object so could be scaled indepently.)

Then you suggested instead of a box I could just put triangles at the house bounding box corners.

I was thinking I should not link this physics shape object to the house, but now I am thinking, yes I can link it to the house. 

 

However, Drongle said this:

 

 Using linked prim boxes, undistorted, as physics is very efficient for the engine because it uses havok primitives. That's why the only cost 0.1 weight each.

 

Which is exactly what I have used in my other mesh houses (smaller ones). However, this house is larger and more detailed so I have to cut every possible LI and I am hoping making this physics shape will accomplish this.

Link to comment
Share on other sites

I mean I wouldn't make a seperate physics shape you can link to your house. I would upload the physical shape along with the visible shape(s).

I'm a bit confused, you ARE aware of the fact you can have a mesh object with physical behaviour all in one right? That way you can avoid a ton of trouble.

For objects like houses, prim boxes can be better for the physics engine, but they will be a) hard to work with since they are all single boxes, a lot of them, b) add graphical load, at least as long as invisible objects are still rendered which as far as I know they are and c) add server load since you have more objects.

  • Like 1
Link to comment
Share on other sites

Okay (and thank you for your patience with my denseness) so you are saying when I upload the house meshes all together, I can upload the whole-house physics shape at that time?  I think I was thinking it was one P-shape per mesh.

 

Also this is what I am now thinking since I understand more about bounding boxes:  the house is basically shaped like a big two story cube, so it would be most efficient to link all the exterior walls into one mesh* rather than in one mesh per side.  Is this correct?

 

*I have pretty much abandoned any effort to make the house modifiable in the way non mesh houses are. With my other houses I made each wall a separate mesh so make them more modular but with mesh houses you really can't use separate walls very easily because of the baked textures.

Link to comment
Share on other sites


Pamela Galli wrote:

Okay (and thank you for your patience with my denseness) so you are saying when I upload the house meshes all together, I can upload the whole-house physics shape at that time?  I think I was thinking it was one P-shape per mesh.

It is one physics shape per mesh, one upload, one package. I got the idea that you wanted to upload the visibles and physics as seperate objects, which is usually a bad idea if you ask me. I think we are just confusing eachother:)


Also this is what I am now thinking since I understand more about bounding boxes:  the house is basically shaped like a big two story cube, so it would be most efficient to link all the exterior walls into one mesh* rather than in one mesh per side.  Is this correct?


That's a bit of a tricky question. For physics, the answer is yes. Less physical objects means easier calculations. ( I could be wrong/incomplete here if the havoc engine takes object size into the calculations).

For server/network load, yes, less objects usually means less data traffic (unless you're working with duplicate objects.)

For rendering load (and download weight) it really depends on your LoD models. Everything in one means a bigger bounding box, so later LoD switches, so a higher landimpact for the highest LoD. You might be able to use simpler LoD models though, lowering the load again. Maybe Drongle can fill you in with a ton of graphs and pics:) Personally I rather estimate and try some different setups. One method isn't better than the other I'd say.


*I have pretty much abandoned any effort to make the house modifiable in the way non mesh houses are. With my other houses I made each wall a separate mesh so make them more modular but with mesh houses you really can't use separate walls very easily because of the baked textures.

The baked textures are usually more appealing to the eye, but I don't see why prims can't have baked textures or mesh can't have unbaked textures. The two are in no way related. Since all mesh builds are done in an external program, the baking might seem more obvious since that's part of that same program, but that doesn't make it mandatory.

  • Like 1
Link to comment
Share on other sites


Kwakkelde Kwak wrote:


Pamela Galli wrote:

Okay (and thank you for your patience with my denseness) so you are saying when I upload the house meshes all together, I can upload the whole-house physics shape at that time?  I think I was thinking it was one P-shape per mesh.

It
is
one physics shape per mesh, one upload, one package. I got the idea that you wanted to upload the visibles and physics as seperate objects, which is usually a bad idea if you ask me. I think we are just confusing eachother:)

Also this is what I am now thinking since I understand more about bounding boxes:  the house is basically shaped like a big two story cube, so it would be most efficient to link all the exterior walls into one mesh* rather than in one mesh per side.  Is this correct?


That's a bit of a tricky question. For physics, the answer is yes. Less physical objects means easier calculations. ( I could be wrong/incomplete here if the havoc engine takes object size into the calculations).

For server/network load, yes, less objects usually means less data traffic (unless you're working with duplicate objects.)

For rendering load (and download weight) it really depends on your LoD models. Everything in one means a bigger bounding box, so later LoD switches, so a higher landimpact for the highest LoD. You might be able to use simpler LoD models though, lowering the load again. Maybe Drongle can fill you in with a ton of graphs and pics:) Personally I rather estimate and try some different setups. One method isn't better than the other I'd say.

*I have pretty much abandoned any effort to make the house modifiable in the way non mesh houses are. With my other houses I made each wall a separate mesh so make them more modular but with mesh houses you really can't use separate walls very easily because of the baked textures.

The baked textures are usually more appealing to the eye, but I don't see why prims can't have baked textures or mesh can't have unbaked textures. The two are in no way related. Since all mesh builds are done in an external program, the baking might seem more obvious since that's part of that same program, but that doesn't make it mandatory.

Yes I am confused but that is my normal state :-)  

The problem with this house is the download weight -- the other factors are fine. I have made LODs for all the high LI trim elements, tho I have only uploaded one, so hoping that will significantly reduce that. I was hoping physics shapes would help too but maybe they will not. I will try different linking setups and report back here on that.

Link to comment
Share on other sites

It is no doubt a good thing but I still don't understand the alternative. You and CW suggested making an object with the same BB as the house (which is many meshes I upload all at once) and Kwak seemed to be saying he would not make a separate object, but maybe I misunderstood.

Link to comment
Share on other sites


Drongle McMahon wrote:

The LI is the highest of the three weights, download, physics and server. So if you download weight is the highest, then reducing the physics weight will have no effect on the LI. It;s still a good thing though, as it means you are asking for less work from the physics engine.

Also Kwak said above that the prim cubes are less work for the physics engine?

Link to comment
Share on other sites

Okay Nacy made a demo that mimiced what I want to do:

 

She made a demo house of three separate mesh rooms, selected them all and exported as a dae object. Then she copied those and stripped out some extraneous geometry and exported those as a dae, to be the P shape.

Then she uploaded the "house" mesh (the visible one) and in the same upload selected the P shape dae to be the P shape and voila!

 

But here is a question: do the p shapes meshes need to be selected in the same order the visible object meshes were selected?

 

 

Link to comment
Share on other sites


Pamela Galli wrote:

The problem with this house is the download weight -- the other factors are fine. [...] I was hoping physics shapes would help too but maybe they will not. I will try different linking setups and report back here on that.

Like Drongle said, if you're just looking at the LI, only lowering the highest of the three weights will do you any good. If that is download weight, changing the physics shape won't help. It's still good to lowerphysics and server weight if you can, just to lower the load on the system, preventing lag.

 

btw when I say "a separate object" I mean a separate object in SL, made with a separate upload. You'll always have to build a separate object in Blender.

  • Like 1
Link to comment
Share on other sites

"...do the p shapes meshes need to be selected in the same order the visible object meshes were selected?"

I'll explain this in more detail...

The thing that matters is the order the c<geometry> sections appear in the collada files. They must be the same, so that if it's A, B, C in the visual mesh, they it must be A, B, C in the physics mesh. Otherwise the uploader will attach the wrong physics mesh to each visual mesh. The selection order in Blender does not control the order in the exported collada. So it doesn't work.

Instead, you need to name your Blender objects so that they are in the right order alphabetically, then check the "Sort by Object Name" option in the exporter (it will automatically be checked if you select the SL Presets). The same applies to the LOD meshes if you are supplying those.

This is most easily done by adding a postfix to the same names for the visual and physics objects.So, for example, the names might be "thingy", "rubbish" etc..., for the high LODs (no postfix here because this becomes the object name in SL); then the LOD meshes are "thingy_med", "thingy_low", "rubbish_med", "rubbish_low", etc., and the physics meshes are "thingy_phys" and "rubbish_phys". Now when each set of objects is exprted with the "Sort by Object Name" option, they will automatically appear in the right order in the collada files.

  • Like 2
Link to comment
Share on other sites

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